Skip to content

Commit 8e4514f

Browse files
committed
Revert compiler/mpi aliases for LMOD modules. Update util/modules_config_check.py so that tests pass
1 parent 4af677d commit 8e4514f

File tree

6 files changed

+33
-54
lines changed

6 files changed

+33
-54
lines changed

.github/workflows/ubuntu-ci-x86_64-gnu.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ jobs:
234234
235235
export ENVNAME=ue-gcc-11.4.0
236236
export ENVDIR=$PWD/envs/${ENVNAME}
237-
ls -l ${ENVDIR}/install/modulefiles/Core
237+
ls -l ${ENVDIR}/modules/Core
238238
239239
module use ${ENVDIR}/modules/Core
240240
module load stack-gcc/11.4.0

.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242
243243
export ENVNAME=ue-oneifx-2024.2.0
244244
export ENVDIR=$PWD/envs/${ENVNAME}
245-
ls -l ${ENVDIR}/install/modulefiles/Core
245+
ls -l ${ENVDIR}/modules/Core
246246
247247
module use ${ENVDIR}/modules/Core
248248
module load stack-intel-oneapi-compilers/2024.2.0

.github/workflows/ubuntu-ci-x86_64-oneapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242
243243
export ENVNAME=ue-oneapi-2024.2.0
244244
export ENVDIR=$PWD/envs/${ENVNAME}
245-
ls -l ${ENVDIR}/install/modulefiles/Core
245+
ls -l ${ENVDIR}/modules/Core
246246
247247
module use ${ENVDIR}/modules/Core
248248
module load stack-intel-oneapi-compilers/2024.2.0

configs/common/modules_lmod.yaml

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,10 @@ modules:
1010
core_compilers::
1111
- gcc@4.6
1212
projections:
13-
# Note: These translations of compiler and MPI library names must match the ALIASES
14-
# dictionary in spack-ext/lib/jcsda-emc/spack-stack/stack/meta_modules.py
15-
# Defaults
16-
'^intel-oneapi-compilers-classic^intel-oneapi-mpi': 'impi/{^mpi.version}/intel/{compiler.version}/{name}/{version}'
17-
'^intel-oneapi-compilers-classic^mpi': '{^mpi.name}/{^mpi.version}/intel/{compiler.version}/{name}/{version}'
18-
'^intel-oneapi-compilers-classic': 'intel/{compiler.version}/{name}/{version}'
19-
'^intel-oneapi-compilers^intel-oneapi-mpi': 'impi/{^mpi.version}/oneapi/{compiler.version}/{name}/{version}'
20-
'^intel-oneapi-compilers^mpi': '{^mpi.name}/{^mpi.version}/oneapi/{compiler.version}/{name}/{version}'
21-
'^intel-oneapi-compilers': 'oneapi/{compiler.version}/{name}/{version}'
22-
^intel-oneapi-mpi: 'impi/{^mpi.version}/{compiler.name}/{compiler.version}/{name}/{version}'
23-
^mpi: '{^mpi.name}/{^mpi.version}/{compiler.name}/{compiler.version}/{name}/{version}'
24-
all: '{compiler.name}/{compiler.version}/{name}/{version}'
25-
# The special cases - Intel classic compilers
26-
'nlohmann-json ^intel-oneapi-compilers-classic': 'intel/{compiler.version}/json/{version}'
27-
'nlohmann-json-schema-validator ^intel-oneapi-compilers-classic': 'intel/{compiler.version}/json-schema-validator/{version}'
28-
'libjpeg-turbo ^intel-oneapi-compilers-classic': 'intel/{compiler.version}/libjpeg/{version}'
29-
'prod-util ^intel-oneapi-compilers-classic': 'intel/{compiler.version}/prod_util/{version}'
30-
# The special cases - Intel LLVM compilers
31-
'nlohmann-json ^intel-oneapi-compilers': 'oneapi/{compiler.version}/json/{version}'
32-
'nlohmann-json-schema-validator ^intel-oneapi-compilers': 'oneapi/{compiler.version}/json-schema-validator/{version}'
33-
'libjpeg-turbo ^intel-oneapi-compilers': 'oneapi/{compiler.version}/libjpeg/{version}'
34-
'prod-util ^intel-oneapi-compilers': 'oneapi/{compiler.version}/prod_util/{version}'
35-
# The special cases - other compilers
36-
nlohmann-json: '{compiler.name}/{compiler.version}/json/{version}'
37-
nlohmann-json-schema-validator: '{compiler.name}/{compiler.version}/json-schema-validator/{version}'
38-
libjpeg-turbo: '{compiler.name}/{compiler.version}/libjpeg/{version}'
39-
prod-util: '{compiler.name}/{compiler.version}/prod_util/{version}'
40-
13+
nlohmann-json: 'json/{version}'
14+
nlohmann-json-schema-validator: 'json-schema-validator/{version}'
15+
libjpeg-turbo: 'libjpeg/{version}'
16+
prod-util: 'prod_util/{version}'
4117
exclude:
4218
# List of packages for which we don't need modules
4319
- apple-libunwind

spack-ext/lib/jcsda-emc/spack-stack/stack/meta_modules.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"MPIROOT": "",
5353
}
5454

55-
# Aliases to shorten module paths. These aliases must match the compiler
56-
# and MPI name translations in configs/common/modules_{tcl,lmod}.yaml
55+
# Aliases to shorten module paths for tcl modules. These aliases must match
56+
# the compiler and MPI name translations in configs/common/modules_tcl.yaml
5757
ALIASES = {
5858
"none" : "none",
5959
# Compilers
@@ -246,8 +246,11 @@ def remove_compiler_prefices_from_tcl_modulefiles(modulepath, compiler_list, mpi
246246
for compiler in compiler_list:
247247
# First, compiler-dependent modules
248248
(compiler_name, compiler_version) = compiler.split("@")
249-
# Module paths are short names
250-
compiler_alias = ALIASES[compiler_name]
249+
# Module paths are short names for tcl modules
250+
if module_choice == "lmod":
251+
compiler_alias = compiler_name
252+
else:
253+
compiler_alias = ALIASES[compiler_name]
251254
cmd = "sed -i {4} 's#{0} {1}/{2}/#{0} #g' {3}".format(
252255
pattern, compiler_alias, compiler_version, filepath, sed_syntax_fix
253256
)
@@ -257,8 +260,11 @@ def remove_compiler_prefices_from_tcl_modulefiles(modulepath, compiler_list, mpi
257260
# If mpi_provider is not None, also do compiler+mpi-dependent modules
258261
if not mpi_provider:
259262
continue
260-
# Module paths are short names
261-
mpi_alias = ALIASES[mpi_provider.name]
263+
# Module paths are short names for tcl modules
264+
if module_choice == "lmod":
265+
mpi_alias = mpi_provider.name
266+
else:
267+
mpi_alias = ALIASES[mpi_provider.name]
262268
cmd = "sed -i {6} 's#{0} {1}/{2}/{3}/{4}/#{0} #g' {5}".format(
263269
pattern,
264270
mpi_alias,
@@ -400,8 +406,11 @@ def custom_sort_key(entry):
400406
for compiler in compilers:
401407
logging.info(f" ... configuring compiler {compiler.name}@{compiler.version}")
402408

403-
# Short names for modulepaths
404-
compiler_alias = ALIASES[compiler.name]
409+
# Module paths are short names for tcl modules
410+
if module_choice == "lmod":
411+
compiler_alias = compiler.name
412+
else:
413+
compiler_alias = ALIASES[compiler.name]
405414

406415
modulepath_save = os.path.join(module_dir, compiler_alias, str(compiler.version))
407416
if not os.path.isdir(modulepath_save):
@@ -513,7 +522,7 @@ def custom_sort_key(entry):
513522
# compiler dependencies; remove the compiler/mpi prefices from the moduless
514523
if module_choice == "tcl":
515524

516-
# Short names for modulepaths
525+
# Module paths are short names for tcl modules
517526
mpi_alias = ALIASES[mpi_provider.name]
518527

519528
modulepath_save = os.path.join(module_dir, mpi_alias, str(mpi_provider.version), "none", "none")
@@ -534,8 +543,11 @@ def custom_sort_key(entry):
534543
)
535544
)
536545

537-
# Short names for modulepaths
538-
compiler_alias = ALIASES[compiler.name]
546+
# Module paths are short names for tcl modules
547+
if module_choice == "lmod":
548+
mpi_alias = compiler.name
549+
else:
550+
compiler_alias = ALIASES[compiler.name]
539551

540552
# Spack mpi+compiler module hierarchy
541553
modulepath_save = os.path.join(

util/modules_config_check.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,12 @@
2020
yaml_raw = f.read().replace("lmod:", "LMOD_OR_TCL:").replace("tcl:", "LMOD_OR_TCL:")
2121
modules[lmod_or_tcl] = syaml.load_config(yaml_raw)
2222

23-
# Check subset of projection to ensure keys match
24-
lmod_projections = modules["lmod"]["modules"]["default"]["LMOD_OR_TCL"]["projections"].keys()
25-
tcl_projections = modules["tcl"]["modules"]["default"]["LMOD_OR_TCL"]["projections"].keys()
26-
assert set(lmod_projections) == set(tcl_projections)-{"all", "^mpi"}
27-
28-
for lmod_or_tcl in ("lmod", "tcl"):
29-
for key in modules[lmod_or_tcl]["modules"]["default"]["LMOD_OR_TCL"]["projections"].keys():
30-
modules[lmod_or_tcl]["modules"]["default"]["LMOD_OR_TCL"]["projections"][key] = "DUMMYVALUE"
31-
3223
# Removing sections we don't want to compare; note this will
33-
# affect line numbers in the diff output
24+
# affect line numbers in the diff output
3425
del(modules["lmod"]["modules"]["default"]["LMOD_OR_TCL"]["core_compilers"])
3526
del(modules["lmod"]["modules"]["default"]["LMOD_OR_TCL"]["hierarchy"])
36-
del(modules["tcl"]["modules"]["default"]["LMOD_OR_TCL"]["projections"]["all"])
37-
del(modules["tcl"]["modules"]["default"]["LMOD_OR_TCL"]["projections"]["^mpi"])
27+
del(modules["lmod"]["modules"]["default"]["LMOD_OR_TCL"]["projections"])
28+
del(modules["tcl"]["modules"]["default"]["LMOD_OR_TCL"]["projections"])
3829

3930
# If sections mismatch, print a diff of the whole configuration
4031
dump_lmod = syaml.dump_config(modules["lmod"]).split("\n")

0 commit comments

Comments
 (0)