Skip to content

Commit

Permalink
add wait and append_script_part to Slurm job array script end template (
Browse files Browse the repository at this point in the history
#404)

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Oct 31, 2023
1 parent 13c17c8 commit d0aac56
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dpdispatcher/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
{slurm_number_gpu_line}
{slurm_partition_line}"""

slurm_job_array_script_end_template = """
wait
{append_script_part}
"""


class Slurm(Machine):
def gen_script(self, job):
Expand Down Expand Up @@ -296,9 +302,13 @@ def gen_script_command(self, job):
return script_command

def gen_script_end(self, job):
# We cannot have a end script for job array
# We cannot touch tag for job array
# we may check task tag instead
return ""
append_script = job.resources.append_script
append_script_part = "\n".join(append_script)
return slurm_job_array_script_end_template.format(
append_script_part=append_script_part,
)

@retry()
def check_status(self, job):
Expand Down

0 comments on commit d0aac56

Please sign in to comment.