Skip to content
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
2 changes: 2 additions & 0 deletions configs/common/modules_lmod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ modules:
^esmf@8.8.0+debug snapshot=none: 'esmf-8.8.0-debug'
^esmf@8.9.0~debug snapshot=none: 'esmf-8.9.0'
^esmf@8.9.0+debug snapshot=none: 'esmf-8.9.0-debug'
^esmf@8.9.1~debug snapshot=none: 'esmf-8.9.1'
^esmf@8.9.1+debug snapshot=none: 'esmf-8.9.1-debug'
fms:
suffixes:
constants=GFS: 'gfs-constants'
Expand Down
2 changes: 2 additions & 0 deletions configs/common/modules_tcl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ modules:
^esmf@8.8.0+debug snapshot=none: 'esmf-8.8.0-debug'
^esmf@8.9.0~debug snapshot=none: 'esmf-8.9.0'
^esmf@8.9.0+debug snapshot=none: 'esmf-8.9.0-debug'
^esmf@8.9.1~debug snapshot=none: 'esmf-8.9.1'
^esmf@8.9.1+debug snapshot=none: 'esmf-8.9.1-debug'
fms:
suffixes:
constants=GFS: 'gfs-constants'
Expand Down
6 changes: 5 additions & 1 deletion configs/common/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ packages:
esmf:
require:
- ~xerces ~pnetcdf +shared +external-parallelio
- any_of: ['@=8.6.1 snapshot=none', '@=8.8.0 snapshot=none', '@=8.9.0 snapshot=none']
- any_of: ['@=8.6.1 snapshot=none', '@=8.8.0 snapshot=none', '@=8.9.0 snapshot=none', '@=8.9.1 snapshot=none']
- any_of: ['fflags="-fp-model precise" cxxflags="-fp-model precise"']
when: '%intel'
message: Extra ESMF compile options for Intel
Expand Down Expand Up @@ -305,6 +305,10 @@ packages:
py-cartopy:
require:
- +plotting
# Pin py-colorama to avoid duplicate packages, hopefully can be removed soon
py-colorama:
require:
- '@0.4.6'
# Pin to version 42 to avoid maturin dependency that breaks Intel oneAPI builds
py-cryptography:
require:
Expand Down
14 changes: 10 additions & 4 deletions configs/sites/tier1/nautilus/packages_gcc-13.3.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ packages:
mpi:
buildable: False
require:
- openmpi@4.1.8
- openmpi@5.0.8
gcc-runtime:
buildable: False
externals:
Expand All @@ -23,8 +23,14 @@ packages:
openmpi:
buildable: False
externals:
- spec: openmpi@4.1.8
prefix: /p/app/penguin/openmpi/4.1.8/gcc-13.3.1
- spec: openmpi@5.0.8
prefix: /p/app/penguin/openmpi/5.0.8/gcc-13.3.1
modules:
- penguin/openmpi/4.1.8/gcc-13.3.1
- penguin/openmpi/5.0.8/gcc-13.3.1
- slurm
extra_attributes:
environment:
set:
OMPI_MCA_coll: "^hcoll,cuda"
OMPI_MCA_pml: "ucx"

8 changes: 4 additions & 4 deletions configs/templates/neptune-dev/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ spack:
include: []

specs:
- neptune-env ~debug +espc ^esmf@=8.9.0
- neptune-env +debug +espc ^esmf@=8.9.0
- neptune-python-env ^neptune-env ~debug +espc ^esmf@=8.9.0
- jedi-neptune-env +adp ^neptune-env ~debug +espc ^esmf@=8.9.0
- neptune-env ~debug +espc ^esmf@=8.9.1
- neptune-env +debug +espc ^esmf@=8.9.1
- neptune-python-env ^neptune-env ~debug +espc ^esmf@=8.9.1
- jedi-neptune-env +adp ^neptune-env ~debug +espc ^esmf@=8.9.1
- crtm@3.1.2
- crtm@v2.4.1-jedi.2

Expand Down
2 changes: 1 addition & 1 deletion configs/templates/neptune-ops/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spack:
include: []

specs:
- neptune-env ~debug +espc ^esmf@=8.9.0
- neptune-env ~debug +espc ^esmf@=8.9.1

packages:
# Turn off python variant for esmf
Expand Down
12 changes: 6 additions & 6 deletions configs/templates/skylab-dev/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ spack:
specs:
- ewok-env
#- ai-env
- geos-gcm-env ^esmf@=8.6.1
- geos-gcm-env ^esmf@=8.9.1
- jedi-fv3-env
- jedi-geos-env ^esmf@=8.6.1
- jedi-geos-env ^esmf@=8.9.1
- jedi-mpas-env
- jedi-neptune-env ^esmf@=8.9.0
- jedi-neptune-env ^esmf@=8.9.1
- jedi-tools-env
- jedi-ufs-env ^esmf@=8.8.0
#- jedi-um-env
- neptune-env ^esmf@=8.9.0
- neptune-python-env ^esmf@=8.9.0
- neptune-env ^esmf@=8.9.1
- neptune-python-env ^esmf@=8.9.1
- soca-env

# Various crtm tags (list all to avoid duplicate packages)
Expand All @@ -33,7 +33,7 @@ spack:
# Various esmf tags (list all to avoid duplicate packages)
- esmf@=8.6.1
- esmf@=8.8.0
- esmf@=8.9.0
- esmf@=8.9.1

packages:
# Turn on python variant for esmf
Expand Down
12 changes: 6 additions & 6 deletions configs/templates/unified-dev/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ spack:
specs:
- ewok-env
#- ai-env
- geos-gcm-env ^esmf@=8.9.0
- geos-gcm-env ^esmf@=8.9.1
- global-workflow-env ^esmf@=8.6.1 ^crtm@=3.1.2
- gmao-swell-env ^crtm@=v2.4.1-jedi.2
- gsi-env ^crtm@=3.1.2
- jedi-fv3-env
- jedi-geos-env ^esmf@=8.9.0
- jedi-geos-env ^esmf@=8.9.1
- jedi-mpas-env
- jedi-neptune-env ^esmf@=8.9.0
- jedi-neptune-env ^esmf@=8.9.1
#- jedi-tools-env
- jedi-ufs-env ^esmf@=8.8.0
#- jedi-um-env
- neptune-env ^esmf@=8.9.0
- neptune-python-env ^esmf@=8.9.0
- neptune-env ^esmf@=8.9.1
- neptune-python-env ^esmf@=8.9.1
- soca-env
- ufs-srw-app-env ^esmf@=8.8.0 ^crtm@=3.1.2
- ufs-weather-model-env ^esmf@=8.8.0 ^crtm@=3.1.2
Expand All @@ -38,7 +38,7 @@ spack:
# Various esmf tags (list all to avoid duplicate packages)
- esmf@=8.6.1
- esmf@=8.8.0
- esmf@=8.9.0
- esmf@=8.9.1

# Various fms builds
- fms +gfs_phys constants=GFS
Expand Down
32 changes: 23 additions & 9 deletions spack-ext/lib/jcsda-emc/spack-stack/stack/meta_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ def custom_sort_key(entry):
raise Exception(f"Expected no or one MPI provider, but got {mpi_providers}")
logging.info(f" ... mpi_providers: {mpi_providers}")

# To catch errors (invalid compilers, etc) we check that the number of written
# stack-* meta modules matches what we expect: One module for the preferred
# compiler, and (if applicable) one for each (currently one) MPI provider.
number_of_meta_modules_expected = 1 + len(mpi_providers)
number_of_meta_modules_written = 0

# Prepare meta module directory
logging.info("Preparing meta module directory ...")
meta_module_dir = os.path.join(module_dir, "Core")
Expand Down Expand Up @@ -508,6 +514,7 @@ def custom_sort_key(entry):
with open(compiler_module_file, "w") as f:
f.write(module_content)
logging.info(" ... writing {}".format(compiler_module_file))
number_of_meta_modules_written += 1

# If this is the last compiler in the list (i.e. the preferred compiler),
# then save the substitutes for later when building the MPI meta module
Expand All @@ -520,13 +527,15 @@ def custom_sort_key(entry):
# Create mpi modules - currently, only one mpi provider is allowed
for mpi_provider in mpi_providers:

if module_choice == "lmod":
mpi_alias = mpi_provider.name
else:
mpi_alias = ALIASES[mpi_provider.name]

# For tcl, append modulepath for external specs and for specs without
# compiler dependencies; remove the compiler/mpi prefices from the moduless
if module_choice == "tcl":

# Module paths are short names for tcl modules
mpi_alias = ALIASES[mpi_provider.name]

modulepath_save = os.path.join(module_dir, mpi_alias, str(mpi_provider.version), "none", "none")
if not os.path.isdir(modulepath_save):
os.makedirs(modulepath_save)
Expand All @@ -548,7 +557,7 @@ def custom_sort_key(entry):

# Module paths are short names for tcl modules
if module_choice == "lmod":
mpi_alias = compiler.name
compiler_alias = compiler.name
else:
compiler_alias = ALIASES[compiler.name]

Expand Down Expand Up @@ -654,10 +663,10 @@ def custom_sort_key(entry):
substitutes["FC"] = COMPILER_SUBSTITUTES_SAVE["FC"]

# Environment variables
if "environment" in compiler.extra_attributes.keys():
for action in compiler.extra_attributes["environment"].keys():
for env_name in compiler.extra_attributes["environment"][action]:
env_values = compiler.extra_attributes["environment"][action][env_name]
if "environment" in mpi_provider.extra_attributes.keys():
for action in mpi_provider.extra_attributes["environment"].keys():
for env_name in mpi_provider.extra_attributes["environment"][action]:
env_values = mpi_provider.extra_attributes["environment"][action][env_name]
substitutes["ENVVARS"] += envmod_command(
module_choice,
action,
Expand Down Expand Up @@ -689,5 +698,10 @@ def custom_sort_key(entry):
with open(mpi_module_file, "w") as f:
f.write(module_content)
logging.info(" ... writing {}".format(mpi_module_file))
number_of_meta_modules_written += 1

logging.info("Metamodule generation completed successfully in {}".format(meta_module_dir))

if number_of_meta_modules_written == number_of_meta_modules_expected:
logging.info("Metamodule generation completed successfully in {}".format(meta_module_dir))
else:
raise Exception("Metamodule generation NOT successful, check output (invalid compiler?)")