diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 611b9a1dbf..638cc91fdd 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -406,10 +406,19 @@ class RegressionTest: #: #: Time limit is specified as a three-tuple in the form ``(hh, mm, ss)``, #: with ``hh >= 0``, ``0 <= mm <= 59`` and ``0 <= ss <= 59``. + #: If set to :class:`None`, no time limit will be set. + #: The default time limit of the system partition's scheduler will be used. + #: #: #: :type: :class:`tuple[int]` #: :default: ``(0, 10, 0)`` - time_limit = fields.TimerField('time_limit') + #: + #: .. note:: + #: .. versionchanged:: 2.15 + #: + #: This attribute may be set to :class:`None`. + #: + time_limit = fields.TimerField('time_limit', allow_none=True) #: Extra resources for this test. #: diff --git a/reframe/core/schedulers/__init__.py b/reframe/core/schedulers/__init__.py index badc68bbba..ab84120cc4 100644 --- a/reframe/core/schedulers/__init__.py +++ b/reframe/core/schedulers/__init__.py @@ -64,7 +64,7 @@ def __init__(self, num_tasks_per_socket=None, num_cpus_per_task=None, use_smt=None, - time_limit=(0, 10, 0), + time_limit=None, script_filename=None, stdout=None, stderr=None, diff --git a/reframe/core/schedulers/local.py b/reframe/core/schedulers/local.py index 28cb7f25e7..98fa2f05cf 100644 --- a/reframe/core/schedulers/local.py +++ b/reframe/core/schedulers/local.py @@ -133,8 +133,12 @@ def wait(self): return # Convert job's time_limit to seconds - h, m, s = self.time_limit - timeout = h * 3600 + m * 60 + s + if self.time_limit is not None: + h, m, s = self.time_limit + timeout = h * 3600 + m * 60 + s + else: + timeout = 0 + try: self._wait_all(timeout) self._exitcode = self._proc.returncode diff --git a/reframe/core/schedulers/pbs.py b/reframe/core/schedulers/pbs.py index 7b4fc12053..a822960b44 100644 --- a/reframe/core/schedulers/pbs.py +++ b/reframe/core/schedulers/pbs.py @@ -70,10 +70,14 @@ def _run_command(self, cmd, timeout=None): def emit_preamble(self): preamble = [ self._format_option('-N "%s"' % self.name), - self._format_option('-l walltime=%d:%d:%d' % self.time_limit), self._format_option('-o %s' % self.stdout), self._format_option('-e %s' % self.stderr), ] + + if self.time_limit is not None: + preamble.append( + self._format_option('-l walltime=%d:%d:%d' % self.time_limit)) + if self.sched_partition: preamble.append( self._format_option('-q %s' % self.sched_partition)) diff --git a/reframe/core/schedulers/slurm.py b/reframe/core/schedulers/slurm.py index ba594fa711..30ab367ef4 100644 --- a/reframe/core/schedulers/slurm.py +++ b/reframe/core/schedulers/slurm.py @@ -79,7 +79,6 @@ def _format_option(self, var, option): def emit_preamble(self): preamble = [ self._format_option(self.name, '--job-name="{0}"'), - self._format_option('%d:%d:%d' % self.time_limit, '--time={0}'), self._format_option(self.num_tasks, '--ntasks={0}'), self._format_option(self.num_tasks_per_node, '--ntasks-per-node={0}'), @@ -97,6 +96,10 @@ def emit_preamble(self): self._format_option(self.stderr, '--error={0}'), ] + if self.time_limit is not None: + preamble.append(self._format_option('%d:%d:%d' % self.time_limit, + '--time={0}')) + if self.sched_exclusive_access: preamble.append(self._format_option( self.sched_exclusive_access, '--exclusive')) diff --git a/unittests/test_launchers.py b/unittests/test_launchers.py index b62e2592b4..9cd4d86c78 100644 --- a/unittests/test_launchers.py +++ b/unittests/test_launchers.py @@ -120,7 +120,6 @@ def expected_command(self): def expected_minimal_command(self): return ('srun ' '--job-name=fake_job ' - '--time=0:10:0 ' '--output=./fake_job.out ' '--error=./fake_job.err ' '--ntasks=1 '