job name in submit script

This commit is contained in:
Benoît Sierro
2021-05-07 12:33:16 +02:00
parent 2ba65cd80e
commit b21d8d3606
2 changed files with 3 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/bash
#SBATCH --time={time}
#SBATCH --job-name="{job_name}"
### This script works for any number of nodes, Ray will find and manage all resources
#SBATCH --nodes={nodes}

View File

@@ -65,7 +65,8 @@ def main():
sim_num, _ = count_variations(config)
file_name = "submit " + config["name"] + "-" + format(datetime.now(), "%Y%m%d%H%M") + ".sh"
submit_sh = template.format(**vars(args))
job_name = f"supercontinuum {config['name']}"
submit_sh = template.format(job_name=job_name, **vars(args))
with open(file_name, "w") as file:
file.write(submit_sh)
subprocess.run(["sbatch", "--test-only", file_name])