Skip to content

Commit f7c37a5

Browse files
authored
Merge pull request #419 from E3SM-Project/copilot/update-cime-machine-config-another-one
Update config_machines.xml to upstream E3SM revision ec75ebef
2 parents 1479645 + 792329d commit f7c37a5

4 files changed

Lines changed: 65 additions & 50 deletions

File tree

mache/cime_machine_config/config_machines.xml

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,11 @@
240240
<command name="load">cray-libsci/25.09.0</command>
241241
</modules>
242242

243-
<modules>
243+
<modules compiler="!nvidia">
244244
<command name="load">craype-accel-host</command>
245+
</modules>
246+
247+
<modules>
245248
<command name="load">craype/2.7.35</command>
246249
<command name="load">cray-mpich/9.0.1</command>
247250
<command name="load">cmake/3.30.2</command>
@@ -619,8 +622,11 @@
619622
<command name="load">cray-libsci/25.09.0</command>
620623
</modules>
621624

622-
<modules>
625+
<modules compiler="!nvidia">
623626
<command name="load">craype-accel-host</command>
627+
</modules>
628+
629+
<modules>
624630
<command name="load">craype/2.7.35</command>
625631
<command name="load">cray-mpich/9.0.1</command>
626632
<command name="load">cmake/3.30.2</command>
@@ -995,8 +1001,11 @@
9951001
<command name="load">cray-libsci/25.09.0</command>
9961002
</modules>
9971003

998-
<modules>
1004+
<modules compiler="!nvidia">
9991005
<command name="load">craype-accel-host</command>
1006+
</modules>
1007+
1008+
<modules>
10001009
<command name="load">craype/2.7.35</command>
10011010
<command name="load">cray-mpich/9.0.1</command>
10021011
<command name="load">cmake/3.30.2</command>
@@ -1638,51 +1647,6 @@
16381647
</environment_variables>
16391648
</machine>
16401649

1641-
<machine MACH="ghci-oci">
1642-
<DESC>OCI-based container</DESC>
1643-
<NODENAME_REGEX>ghci-oci</NODENAME_REGEX>
1644-
<OS>LINUX</OS>
1645-
<COMPILERS>gnu</COMPILERS>
1646-
<MPILIBS>mpich</MPILIBS>
1647-
<CIME_OUTPUT_ROOT>/projects/e3sm/scratch</CIME_OUTPUT_ROOT>
1648-
<DIN_LOC_ROOT>/projects/e3sm/inputdata</DIN_LOC_ROOT>
1649-
<DIN_LOC_ROOT_CLMFORC>/projects/e3sm/ptclm-data</DIN_LOC_ROOT_CLMFORC>
1650-
<DOUT_S_ROOT>/projects/e3sm/scratch/archive/$CASE</DOUT_S_ROOT>
1651-
<BASELINE_ROOT>/projects/e3sm/baselines/$COMPILER</BASELINE_ROOT>
1652-
<CCSM_CPRNC>/usr/local/packages/bin/cprnc</CCSM_CPRNC>
1653-
<GMAKE>make</GMAKE>
1654-
<GMAKE_J>4</GMAKE_J>
1655-
<TESTS>e3sm_developer</TESTS>
1656-
<BATCH_SYSTEM>none</BATCH_SYSTEM>
1657-
<SUPPORTED_BY>e3sm-team</SUPPORTED_BY>
1658-
<MAX_TASKS_PER_NODE>16</MAX_TASKS_PER_NODE>
1659-
<MAX_MPITASKS_PER_NODE>16</MAX_MPITASKS_PER_NODE>
1660-
<mpirun mpilib="default">
1661-
<executable>mpirun</executable>
1662-
<arguments>
1663-
<arg name="num_tasks"> -launcher fork -hosts localhost -np {{ total_tasks }}</arg>
1664-
</arguments>
1665-
</mpirun>
1666-
<module_system type="none"/>
1667-
<RUNDIR>/projects/e3sm/scratch/$CASE/run</RUNDIR>
1668-
<EXEROOT>/projects/e3sm/scratch/$CASE/bld</EXEROOT>
1669-
<environment_variables>
1670-
<env name="E3SM_SRCROOT">$SRCROOT</env>
1671-
</environment_variables>
1672-
<environment_variables mpilib="mpi-serial">
1673-
<env name="NETCDF_PATH">/usr/local/packages</env>
1674-
<env name="PATH">/usr/local/packages/bin:$ENV{PATH}</env>
1675-
<env name="LD_LIBRARY_PATH">/usr/local/packages/lib</env>
1676-
</environment_variables>
1677-
<environment_variables mpilib="!mpi-serial">
1678-
<env name="NETCDF_PATH">/usr/local/packages</env>
1679-
<env name="PNETCDF_PATH">/usr/local/packages</env>
1680-
<env name="HDF5_ROOT">/usr/local/packages</env>
1681-
<env name="PATH">/usr/local/packages/bin:$ENV{PATH}</env>
1682-
<env name="LD_LIBRARY_PATH">/usr/local/packages/lib</env>
1683-
</environment_variables>
1684-
</machine>
1685-
16861650
<machine MACH="melvin">
16871651
<DESC>Linux workstation for Jenkins testing</DESC>
16881652
<NODENAME_REGEX>(melvin|watson|s999964|climate|penn|sems)</NODENAME_REGEX>

mache/spack/config_machines.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,13 @@ def extract_spack_from_config_machines(
168168

169169

170170
def _matches_selector(pattern, value):
171-
"""Return whether a selector regex matches the whole value."""
171+
"""Return whether a selector regex matches the whole value.
172+
173+
If the pattern begins with ``!``, the remaining pattern must *not*
174+
match ``value`` (CIME negation syntax, e.g. ``compiler="!nvidia"``).
175+
"""
176+
if pattern.startswith('!'):
177+
return re.fullmatch(pattern[1:], value) is None
172178
return re.fullmatch(pattern, value) is not None
173179

174180

mache/spack/templates/pm-cpu_nvidia_mpich.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ spack:
150150
- PrgEnv-nvidia
151151
- nvidia/25.9
152152
- cray-libsci/25.09.0
153-
- craype-accel-host
154153
- craype/2.7.35
155154
- libfabric/1.20
156155
environment:

tests/test_spack_config_machines.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,49 @@ def test_extract_machine_config_requires_full_compiler_match(tmp_path: Path):
7070
assert "{{ render_env_var('BOTH_REGEX', '1', 'sh') }}" in cpu_script
7171
assert "{{ render_env_var('CPU_ONLY', '1', 'sh') }}" in cpu_script
7272
assert "{{ render_env_var('GPU_ONLY', '1', 'sh') }}" not in cpu_script
73+
74+
75+
def test_extract_machine_config_negation_selector(tmp_path: Path):
76+
xml_file = tmp_path / 'config_machines.xml'
77+
xml_file.write_text(
78+
'<config_machines>\n'
79+
' <machine MACH="test-machine">\n'
80+
' <module_system type="module">\n'
81+
' <modules compiler="nvidia">\n'
82+
' <command name="load">nvidia-only-module</command>\n'
83+
' </modules>\n'
84+
' <modules compiler="!nvidia">\n'
85+
' <command name="load">non-nvidia-module</command>\n'
86+
' </modules>\n'
87+
' <modules>\n'
88+
' <command name="load">common-module</command>\n'
89+
' </modules>\n'
90+
' </module_system>\n'
91+
' </machine>\n'
92+
'</config_machines>\n',
93+
encoding='utf-8',
94+
)
95+
96+
nvidia_config = extract_machine_config(
97+
xml_file=xml_file,
98+
machine='test-machine',
99+
compiler='nvidia',
100+
mpilib='mpich',
101+
)
102+
nvidia_script = config_to_shell_script(nvidia_config, 'sh')
103+
104+
assert 'nvidia-only-module' in nvidia_script
105+
assert 'non-nvidia-module' not in nvidia_script
106+
assert 'common-module' in nvidia_script
107+
108+
intel_config = extract_machine_config(
109+
xml_file=xml_file,
110+
machine='test-machine',
111+
compiler='intel',
112+
mpilib='mpich',
113+
)
114+
intel_script = config_to_shell_script(intel_config, 'sh')
115+
116+
assert 'nvidia-only-module' not in intel_script
117+
assert 'non-nvidia-module' in intel_script
118+
assert 'common-module' in intel_script

0 commit comments

Comments
 (0)