Skip to content

Commit

Permalink
Add clusters to scancel
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Tyler committed Nov 13, 2024
1 parent a61b4f3 commit 53d8744
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions parsl/providers/slurm/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __init__(self,
_cmd = "sacct"
# Add clusters option to sacct if provided
if self.clusters:
_cmd = f"sacct --clusters={self.clusters}"
_cmd += f" --clusters={self.clusters}"
# Using state%20 to get enough characters to not truncate output
# of the state. Without output can look like "<job_id> CANCELLED+"
self._cmd = _cmd + " -X --noheader --format=jobid,state%20 --job '{0}'"
Expand All @@ -195,7 +195,7 @@ def __init__(self,
_cmd = "squeue"
# Add clusters option to squeue if provided
if self.clusters:
_cmd = f"squeue --clusters={self.clusters}"
_cmd += f" --clusters={self.clusters}"
self._cmd = _cmd + " --noheader --format='%i %t' --job '{0}'"
self._translate_table = squeue_translate_table

Expand Down Expand Up @@ -359,7 +359,14 @@ def cancel(self, job_ids):
'''

job_id_list = ' '.join(job_ids)
retcode, stdout, stderr = self.execute_wait("scancel {0}".format(job_id_list))

# Make the command to cancel jobs
_cmd = "scancel"
if self.clusters:
_cmd += f" --clusters={self.clusters}"
_cmd += " {0}"

retcode, stdout, stderr = self.execute_wait(_cmd.format(job_id_list))
rets = None
if retcode == 0:
for jid in job_ids:
Expand Down

0 comments on commit 53d8744

Please sign in to comment.