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
4 changes: 4 additions & 0 deletions config/cscs-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
{
'name': 'gpu',
'scheduler': 'slurm',
'time_limit': '10m',
'access': [
'--constraint=gpu',
'--partition=cscsci',
Expand Down Expand Up @@ -58,6 +59,7 @@
{
'name': 'slurm',
'scheduler': 'slurm',
'time_limit': '10m',
'access': [
'--constraint=gpu',
f'--account={osext.osgroup()}'
Expand All @@ -80,6 +82,7 @@
{
'name': 'pbs',
'scheduler': 'pbs',
'time_limit': '10m',
'access': [
'proc=gpu',
f'-A {osext.osgroup()}'
Expand All @@ -94,6 +97,7 @@
{
'name': 'torque',
'scheduler': 'torque',
'time_limit': '10m',
'access': [
'-l proc=gpu',
f'-A {osext.osgroup()}'
Expand Down
4 changes: 4 additions & 0 deletions config/cscs.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
},
{
'name': 'gpu',
'time_limit': '10m',
'scheduler': 'slurm',
'container_platforms': [
{
Expand Down Expand Up @@ -230,6 +231,7 @@
{
'name': 'mc',
'scheduler': 'slurm',
'time_limit': '10m',
'container_platforms': [
{
'type': 'Sarus',
Expand Down Expand Up @@ -348,6 +350,7 @@
{
'name': 'gpu',
'scheduler': 'slurm',
'time_limit': '10m',
'container_platforms': [
{
'type': 'Sarus',
Expand Down Expand Up @@ -389,6 +392,7 @@
{
'name': 'mc',
'scheduler': 'slurm',
'time_limit': '10m',
'container_platforms': [
{
'type': 'Sarus',
Expand Down
9 changes: 9 additions & 0 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ System Partition Configuration
A list of `environment module objects <#module-objects>`__ to be loaded before running a regression test on this partition.


.. js:attribute:: .systems[].partitions[].time_limit

:required: No
:default: ``null``

The time limit for the jobs submitted on this partition.
When the value is ``null``, no time limit is applied.


.. js:attribute:: .systems[].partitions[].variables

:required: No
Expand Down
37 changes: 30 additions & 7 deletions reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,11 @@ def pipeline_hooks(cls):
#:
#: Time limit is specified as a string in the form
#: ``<days>d<hours>h<minutes>m<seconds>s`` or as number of seconds.
#: If set to :class:`None`, no time limit will be set.
#: The default time limit of the system partition's scheduler will be used.
#: If set to :class:`None`, the |time_limit|_
#: of the current system partition will be used.
#:
#: :type: :class:`str` or :class:`float` or :class:`int`
#: :default: ``'10m'``
#: :default: :class:`None`
#:
#: .. note::
#: .. versionchanged:: 2.15
Expand All @@ -662,7 +662,25 @@ def pipeline_hooks(cls):
#: - The old syntax using a ``(h, m, s)`` tuple is dropped.
#: - Support of `timedelta` objects is dropped.
#: - Number values are now accepted.
time_limit = variable(type(None), field=fields.TimerField, value='10m')
#:
#: .. versionchanged:: 3.5.1
#: The default value is now :class:`None` and it can be set globally
#: per partition via the configuration.
#:
#: .. |time_limit| replace:: :attr:`time_limit`
#: .. _time_limit: #.systems[].partitions[].time_limit
time_limit = variable(type(None), field=fields.TimerField, value=None)

#: .. versionadded:: 3.5.1
#:
#: The time limit for the build job of the regression test.
#:
#: It is specified similarly to the :attr:`time_limit` attribute.
#:
#: :type: :class:`str` or :class:`float` or :class:`int`
#: :default: :class:`None`
build_time_limit = variable(type(None), field=fields.TimerField,
value=None)

#: .. versionadded:: 2.8
#:
Expand Down Expand Up @@ -1228,7 +1246,11 @@ def compile(self):
self.modules, self.variables.items())
environs = [self._current_partition.local_env, self._current_environ,
user_environ, self._cdt_environ]

self._build_job.time_limit = (
self.build_time_limit or rt.runtime().get_option(
f'systems/0/partitions/@{self.current_partition.name}'
f'/time_limit')
)
with osext.change_dir(self._stagedir):
# Prepare build job
build_commands = [
Expand Down Expand Up @@ -1328,8 +1350,9 @@ def run(self):
self.job.num_tasks_per_socket = self.num_tasks_per_socket
self.job.num_cpus_per_task = self.num_cpus_per_task
self.job.use_smt = self.use_multithreading
self.job.time_limit = self.time_limit

self.job.time_limit = (self.time_limit or rt.runtime().get_option(
f'systems/0/partitions/@{self.current_partition.name}/time_limit')
)
exec_cmd = [self.job.launcher.run_command(self.job),
self.executable, *self.executable_opts]
commands = [*self.prerun_cmds, ' '.join(exec_cmd), *self.postrun_cmds]
Expand Down
1 change: 1 addition & 0 deletions reframe/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@
}
},
"modules": {"$ref": "#/defs/modules_list"},
"time_limit": {"type": ["string", "null"]},
"variables": {"$ref": "#/defs/envvar_list"},
"max_jobs": {"type": "number"},
"prepare_cmds": {
Expand Down