Skip to content
Snippets Groups Projects
Commit 191aca37 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Use sbatch --parsable option to get job ID

parent 5c82b0a3
No related branches found
No related tags found
1 merge request!489Assorted cleanup of xfel-calibrate
......@@ -711,7 +711,7 @@ def concurrent_run(
finalize_script: Optional[str] = None, cluster_cores=8,
sequential=False, dep_jids=(),
show_title=True, user_venv: Optional[Path] = None,
):
) -> Optional[str]:
""" Launch a concurrent job on the cluster via SLURM
"""
......@@ -768,9 +768,7 @@ def concurrent_run(
output = check_output(srun_base).decode('utf8')
jobid = None
if not sequential:
for line in output.split("\n"):
if "Submitted batch job " in line:
jobid = line.split(" ")[3]
jobid = output.partition(';')[0].strip()
print("Submitted job: {}".format(jobid))
return jobid
......
......@@ -18,7 +18,7 @@ logo_path = "xfel.pdf"
# the command to run this concurrently. It is prepended to the actual call
sprof = os.environ.get("XFELCALSLURM", "exfel") # TODO: https://git.xfel.eu/gitlab/calibration/planning/issues/3
launcher_command = "sbatch -t 24:00:00 --requeue --output {temp_path}/slurm-%j.out"
launcher_command = "sbatch -t 24:00:00 --requeue --output {temp_path}/slurm-%j.out --parsable"
free_nodes_cmd = "sinfo -p exfel -t idle -N --noheader | wc -l"
preempt_nodes_cmd = "squeue -p all,grid --noheader | grep max-exfl | egrep -v 'max-exfl18[3-8]|max-exfl100|max-exflg' | wc -l"
max_reserved = 8
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment