Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#:
Expand Down
2 changes: 1 addition & 1 deletion reframe/core/schedulers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions reframe/core/schedulers/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion reframe/core/schedulers/pbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 4 additions & 1 deletion reframe/core/schedulers/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'),
Expand All @@ -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'))
Expand Down
1 change: 0 additions & 1 deletion unittests/test_launchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down