alg benchmarking runner and processor

This commit is contained in:
2025-11-05 12:08:34 +01:00
parent 79bc443bcb
commit d494228d77
2 changed files with 118 additions and 9 deletions

View File

@@ -3,8 +3,6 @@ import subprocess
from datetime import datetime
################ HELPER FUNCTIONS ################
def load_template(template_path: str):
output_template = ""
with open(template_path, "r") as handle:
@@ -16,7 +14,6 @@ def write_batch(batch_fpath: str, batch_content: str):
with open(batch_fpath, "w") as handle:
_ = handle.write(batch_content)
################### SETUP DIRS ###################
output_dir = os.getcwd()+"/output/"
err_dir = os.getcwd()+"/error/"
@@ -33,7 +30,7 @@ if os.path.isdir(batch_files_dir) == False:
os.mkdir(batch_files_dir)
################ GLOBAL DEFAULTS #################
mpi1_bin = "/home/hpc/ihpc/ihpc136h/workspace/prototyping/bin/IMB-MPI1"
mpi1_bin = "/home/hpc/ihpc/ihpc136h/workspace/mpi-benchmark-tool/bin/IMB-MPI1"
default_parameter = {
"time_stamp": datetime.now().strftime("%y_%m_%d_%H-%M-%S"),
"job_name": "",
@@ -198,9 +195,9 @@ for flag in off_cache_flags:
f"{collective}_{alg.strip().replace('`','').replace(' ','_').replace('/','_')}.sh")
write_batch(batch_file,
multiple_node_template.format(**multiple_node_parameter))
# result = subprocess.run(["sbatch", batch_files_dir+collective+".sh"],
# capture_output=True, text=True)
# log += f"#{collective} {n_procs}" + "\n"
# log += "\tSTDOUT:" + result.stdout + "\n"
# log += "\tSTDERR:" + result.stderr + "\n"
result = subprocess.run(["sbatch", batch_file],
capture_output=True, text=True)
log += f"#{collective} {n_procs}" + "\n"
log += "\tSTDOUT:" + result.stdout + "\n"
log += "\tSTDERR:" + result.stderr + "\n"
print(log)