Skip to content
Snippets Groups Projects
Commit d36201df authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #8437: Provide SLURM partition name when scheduling jobs, to prevent...

Task #8437: Provide SLURM partition name when scheduling jobs, to prevent scheduling to wrong partition
parent b432fa85
No related branches found
No related tags found
No related merge requests found
...@@ -136,6 +136,9 @@ class Slurm(object): ...@@ -136,6 +136,9 @@ class Slurm(object):
def __init__(self, headnode="head01.cep4"): def __init__(self, headnode="head01.cep4"):
self.headnode = headnode self.headnode = headnode
# TODO: Derive SLURM partition name
self.partition = "cpu"
def _runCommand(self, cmdline): def _runCommand(self, cmdline):
cmdline = "ssh %s %s" % (self.headnode, cmdline) cmdline = "ssh %s %s" % (self.headnode, cmdline)
runCommand(cmdline) runCommand(cmdline)
...@@ -144,7 +147,7 @@ class Slurm(object): ...@@ -144,7 +147,7 @@ class Slurm(object):
if sbatch_params is None: if sbatch_params is None:
sbatch_params = [] sbatch_params = []
stdout = self._runCommand("sbatch --job-name=%s %s bash -c '%s'" % (jobName, " ".join(sbatch_params), cmdline)) stdout = self._runCommand("sbatch --partition=%s --job-name=%s %s bash -c '%s'" % (self.partition, jobName, " ".join(sbatch_params), cmdline))
# Returns "Submitted batch job 3" -- extract ID # Returns "Submitted batch job 3" -- extract ID
match = re.search("Submitted batch job (\d+)", stdout) match = re.search("Submitted batch job (\d+)", stdout)
......
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