Skip to content

Commit

Permalink
Add config + a test
Browse files Browse the repository at this point in the history
  • Loading branch information
ekouts committed Apr 10, 2024
1 parent be25706 commit 257ac38
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
33 changes: 32 additions & 1 deletion docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ ReFrame can launch containerized applications, but you need to configure properl
Custom Job Scheduler Resources
==============================

ReFrame allows you to define custom scheduler resources for each partition that you can then transparently access through the :attr:`~reframe.core.pipeline.RegressionTest.extra_resources` attribute of a regression test.
ReFrame allows you to define custom scheduler resources for each partition that you can then transparently access through the :attr:`~reframe.core.pipeline.RegressionTest.extra_resources` attribute of a regression test or the environment.

.. py:attribute:: systems.partitions.resources.name
Expand Down Expand Up @@ -766,6 +766,27 @@ ReFrame allows you to define custom scheduler resources for each partition that
The backend assumes a ``qsub`` option, if the options passed in these attributes start with a ``-``.


.. py:attribute:: systems.partitions.env_resources.name
:required: Yes

The name of this resources.
This name will be used to request this resource in a programming environment :attr:`~environments.resources`.

.. versionadded:: 4.6


.. py:attribute:: systems.partitions.env_resources.options
:required: No
:default: ``[]``

A list of options to be passed to this partition’s job scheduler.
This is very similar to the :attr:`~config.systems.partitions.resources.options` parameter, but it is used to define resources that are specific to a programming environment.

.. versionadded:: 4.6


Environment Configuration
=========================

Expand Down Expand Up @@ -948,6 +969,16 @@ They are associated with `system partitions <#system-partition-configuration>`__
It first looks for definitions for the current partition, then for the containing system and, finally, for global definitions (the ``*`` pseudo-system).


.. py:attribute:: environments.resources
:required: No
:default: ``{}``

This is similar to a regression test's :attr:`~reframe.core.pipeline.RegressionTest.extra_resources`.

.. versionadded:: 4.6


.. _logging-config-reference:

Logging Configuration
Expand Down
9 changes: 9 additions & 0 deletions unittests/resources/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ def hostname():
]
}
],
'env_resources': [
{
'name': 'uenv',
'options': [
'--mount={mount}',
'--file={file}'
],
},
],
'features': ['cuda', 'mpi'],
'extras': {
'gpu_arch': 'a100'
Expand Down
6 changes: 6 additions & 0 deletions unittests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@ def test_system_create(site_config):
assert resources_spec == ['#DW jobdw capacity=100GB',
'#DW stage_in source=/foo']

env_resources_spec = partition.get_env_resource(
'uenv', mount='mount_point', file='file_path'
)
assert env_resources_spec == ['--mount=mount_point',
'--file=file_path']

# Check processor info
assert partition.processor.info is not None
assert partition.processor.topology is not None
Expand Down

0 comments on commit 257ac38

Please sign in to comment.