Skip to content

Commit

Permalink
Merge pull request #3098 from OliverPerks/feature/environment_nvccpath
Browse files Browse the repository at this point in the history
[feat] Add `nvcc` as an environment configuration parameter
  • Loading branch information
vkarak authored Jan 31, 2024
2 parents 35fce1e + 7580506 commit 5c136e8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/config_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,16 @@ They are associated with `system partitions <#system-partition-configuration>`__
A list of linker flags to be used with this environment by default.


.. py:attribute:: environments.nvcc
:required: No
:default: ``"nvcc"``

The NVIDIA CUDA compiler to be used with this environment.

.. versionadded:: 4.6


.. py:attribute:: environments.target_systems
:required: No
Expand Down
5 changes: 5 additions & 0 deletions reframe/core/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class ProgEnvironment(Environment):
_cc = fields.TypedField(str)
_cxx = fields.TypedField(str)
_ftn = fields.TypedField(str)
_nvcc = fields.TypedField(str)
_cppflags = fields.TypedField(typ.List[str])
_cflags = fields.TypedField(typ.List[str])
_cxxflags = fields.TypedField(typ.List[str])
Expand Down Expand Up @@ -320,4 +321,8 @@ def ldflags(self):

@property
def nvcc(self):
'''The NVIDIA CUDA compiler of this programming environment.
:type: :class:`str`
'''
return self._nvcc
1 change: 1 addition & 0 deletions reframe/core/systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ def create(cls, site_config):
cc=site_config.get(f'environments/@{e}/cc'),
cxx=site_config.get(f'environments/@{e}/cxx'),
ftn=site_config.get(f'environments/@{e}/ftn'),
nvcc=site_config.get(f'environments/@{e}/nvcc'),
cppflags=site_config.get(f'environments/@{e}/cppflags'),
cflags=site_config.get(f'environments/@{e}/cflags'),
cxxflags=site_config.get(f'environments/@{e}/cxxflags'),
Expand Down
2 changes: 2 additions & 0 deletions reframe/schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
"cc": {"type": "string"},
"cxx": {"type": "string"},
"ftn": {"type": "string"},
"nvcc": {"type": "string"},
"cppflags": {
"type": "array",
"items": {"type": "string"}
Expand Down Expand Up @@ -528,6 +529,7 @@
"environments/cc": "cc",
"environments/cxx": "CC",
"environments/ftn": "ftn",
"environments/nvcc": "nvcc",
"environments/cppflags": [],
"environments/cflags": [],
"environments/cxxflags": [],
Expand Down
1 change: 1 addition & 0 deletions unittests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def test_select_subconfig(site_config):
assert site_config.get('systems/0/partitions/0/max_jobs') == 8
assert len(site_config['environments']) == 7
assert site_config.get('environments/@PrgEnv-gnu/cc') == 'gcc'
assert site_config.get('environments/@PrgEnv-gnu/nvcc') == 'nvcc'
assert site_config.get('environments/1/cxx') == 'g++'
assert site_config.get('environments/@PrgEnv-cray/cc') == 'cc'
assert site_config.get('environments/2/cxx') == 'CC'
Expand Down

0 comments on commit 5c136e8

Please sign in to comment.