From aea4ea7d43e86ddd5083d45634ddc0e1777626cc Mon Sep 17 00:00:00 2001 From: Alex Thom Date: Tue, 27 Mar 2018 16:20:15 +0100 Subject: [PATCH] A fix to allow single-processor jobs to run along with parallel ones in a submission script. --- lib/testcode2/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/testcode2/__init__.py b/lib/testcode2/__init__.py index c9f84b0..0ef81fc 100644 --- a/lib/testcode2/__init__.py +++ b/lib/testcode2/__init__.py @@ -140,9 +140,11 @@ def run_cmd(self, input_file, args, nprocs=0): cmd = cmd.replace('tc.args', '') cmd = cmd.replace('tc.output', output_file) cmd = cmd.replace('tc.error', error_file) - if nprocs > 0 and self.launch_parallel: + if self.launch_parallel: cmd = '%s %s' % (self.launch_parallel, cmd) - cmd = cmd.replace('tc.nprocs', str(nprocs)) + npr=nprocs + if nprocs==0: npr=1 + cmd = cmd.replace('tc.nprocs', str(npr)) return cmd def extract_cmd(self, path, input_file, args):