Commit b2d54aa0 authored by David Trudgian's avatar David Trudgian
Browse files

Guard use of timelimit_per_task with if

parent ecc7df03
......@@ -175,9 +175,13 @@ class SrunExecutor(BaseExecutor):
def run_cmd(self, cmd, stderr_file, stdout_file):
cpus_per_task = self.params.vals['cpus_per_task']
timelimit_per_task = self.params.vals['timelimit_per_task']
srun_cmd = "srun --exclusive -N1 -n1 --cpus-per-task=%d --distribution=cyclic -t %s %s" % (
cpus_per_task, timelimit_per_task, cmd['__command']['value'])
if 'timelimit_per_task' in self.params.vals:
timelimit_per_task = self.params.vals['timelimit_per_task']
srun_cmd = "srun --exclusive -N1 -n1 --cpus-per-task=%d --distribution=cyclic -t %s %s" % (
cpus_per_task, timelimit_per_task, cmd['__command']['value'])
else:
srun_cmd = "srun --exclusive -N1 -n1 --cpus-per-task=%d --distribution=cyclic %s" % (
cpus_per_task, cmd['__command']['value'])
ret = call(srun_cmd, shell=True, stderr=stderr_file,
stdout=stdout_file, env=os.environ)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment