Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add nvcc as an environment configuration parameter #3098

Merged
merged 2 commits into from
Jan 31, 2024
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
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
Loading