Skip to content

Commit

Permalink
Merge branch 'container' into feature/c5c6build
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-a-potts committed Oct 22, 2024
2 parents cbed8f8 + 3308c44 commit a094f10
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 6 deletions.
23 changes: 23 additions & 0 deletions modulefiles/gsiutils_container.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
help([[
]])

prepend_path("MODULEPATH", "/opt/spack-stack/spack-stack-1.8.0/envs/unified-env/install/modulefiles/Core")

--local python_ver=os.getenv("python_ver") or "3.11.6"
local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.10.0"
local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.12.2"
local cmake_ver=os.getenv("cmake_ver") or "3.27.9"
local prod_util_ver=os.getenv("prod_util_ver") or "2.1.1"

load(pathJoin("stack-intel", stack_intel_ver))
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))
load(pathJoin("cmake", cmake_ver))

load("gsiutils_common")

load(pathJoin("prod_util", prod_util_ver))

pushenv("CFLAGS", "-march=ivybridge")
pushenv("FFLAGS", "-march=ivybridge")

whatis("Description: GSI utilities environment in a container with Intel Compilers")
10 changes: 6 additions & 4 deletions ush/detect_machine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ case $(hostname -f) in
*) MACHINE_ID=UNKNOWN ;; # Unknown platform
esac

if [[ ${MACHINE_ID} == "UNKNOWN" ]]; then
if [[ ${MACHINE_ID} == "UNKNOWN" ]]; then
case ${PW_CSP:-} in
"aws" | "google" | "azure") MACHINE_ID=noaacloud ;;
*) PW_CSP="UNKNOWN"
Expand All @@ -64,7 +64,9 @@ if [[ "${MACHINE_ID}" != "UNKNOWN" ]]; then
fi

# Try searching based on paths since hostname may not match on compute nodes
if [[ -d /lfs/h3 ]]; then
if [[ -d /opt/spack-stack ]]; then
MACHINE_ID=container
elif [[ -d /lfs/h3 ]]; then
# We are on NOAA Cactus or Dogwood
MACHINE_ID=wcoss2
elif [[ -d /lfs/h1 && ! -d /lfs/h3 ]]; then
Expand All @@ -78,8 +80,8 @@ elif [[ -d /scratch1 ]]; then
MACHINE_ID=hera
elif [[ -d /work ]]; then
# We are on MSU Orion or Hercules
mount=$(findmnt -n -o SOURCE /home)

This comment has been minimized.

Copy link
@DavidBurrows-NCO

DavidBurrows-NCO Oct 22, 2024

Contributor

@mark-a-potts Was this intended? L81-82 are currently in develop. I can clean up if not.

This comment has been minimized.

Copy link
@mark-a-potts

mark-a-potts Oct 22, 2024

Author Contributor

No, it was not intended.

if [[ ${mount} =~ "hercules" ]]; then
if [[ -d /apps/other ]]; then
# We are on Hercules
MACHINE_ID=hercules
else
MACHINE_ID=orion
Expand Down
33 changes: 31 additions & 2 deletions ush/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ if [[ $MACHINE_ID = jet* ]] ; then
source /apps/lmod/lmod/init/bash
fi
module purge
elif [[ $MACHINE_ID = container* ]] ; then
if ( ! eval module help > /dev/null 2>&1 ) ; then
source /usr/lmod/lmod/init/bash
fi
module purge

elif [[ $MACHINE_ID = hera* ]] ; then
# We are on NOAA Hera
Expand Down Expand Up @@ -35,7 +40,6 @@ elif [[ $MACHINE_ID = s4* ]] ; then
source /usr/share/lmod/lmod/init/bash
fi
module purge

elif [[ $MACHINE_ID = wcoss2 ]]; then
# We are on WCOSS2
module reset
Expand Down Expand Up @@ -63,8 +67,33 @@ elif [[ $MACHINE_ID = gaea* ]] ; then
# the module command fails. Hence we actually have to source
# /etc/profile here.
source /etc/profile
__ms_source_etc_profile=yes

This comment has been minimized.

Copy link
@DavidBurrows-NCO

DavidBurrows-NCO Oct 22, 2024

Contributor

@mark-a-potts Was this intended? L67 is currently in develop. I can clean up if not intended

This comment has been minimized.

Copy link
@mark-a-potts

mark-a-potts Oct 22, 2024

Author Contributor

Ah no. I only intended to add in the lines for the container. Sorry about that.

else
__ms_source_etc_profile=no
fi
module purge
# clean up after purge
unset _LMFILES_
unset _LMFILES_000
unset _LMFILES_001
unset LOADEDMODULES
module load modules
if [[ -d /opt/cray/ari/modulefiles ]] ; then
module use -a /opt/cray/ari/modulefiles
fi
if [[ -d /opt/cray/pe/ari/modulefiles ]] ; then
module use -a /opt/cray/pe/ari/modulefiles
fi
if [[ -d /opt/cray/pe/craype/default/modulefiles ]] ; then
module use -a /opt/cray/pe/craype/default/modulefiles
fi
if [[ -s /etc/opt/cray/pe/admin-pe/site-config ]] ; then
source /etc/opt/cray/pe/admin-pe/site-config
fi
if [[ "$__ms_source_etc_profile" == yes ]] ; then
source /etc/profile
unset __ms_source_etc_profile
fi
module reset

elif [[ $MACHINE_ID = expanse* ]]; then
# We are on SDSC Expanse
Expand Down

0 comments on commit a094f10

Please sign in to comment.