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
5757ALIASES = {
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 (
0 commit comments