Skip to content

Commit

Permalink
Merge pull request #2638 from vkarak/feat/num-gpus-per-node-default
Browse files Browse the repository at this point in the history
[feat] Change default value of `num_gpus_per_node` to `None`
  • Loading branch information
vkarak authored Oct 22, 2022
2 parents 8efea83 + b9e1b00 commit 2320f1d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,12 @@ def pipeline_hooks(cls):
#: For more information on test resources, have a look at the
#: :attr:`extra_resources` attribute.
#:
#: :type: integral
#: :default: ``0``
num_gpus_per_node = variable(int, value=0, loggable=True)
#: :type: integral or :const:`None`
#: :default: :const:`None`
#:
#: .. versionchanged:: 4.0.0
#: The default value changed to :const:`None`.
num_gpus_per_node = variable(int, type(None), value=None, loggable=True)

#: Number of CPUs per task required by this test.
#:
Expand Down Expand Up @@ -1890,7 +1893,7 @@ def _get_cp_env():
environs.insert(2, cp_env)

# num_gpus_per_node is a managed resource
if self.num_gpus_per_node > 0:
if self.num_gpus_per_node:
self.extra_resources.setdefault(
'_rfm_gpu', {'num_gpus_per_node': self.num_gpus_per_node}
)
Expand Down

0 comments on commit 2320f1d

Please sign in to comment.