Skip to content

Commit 47034fc

Browse files
authored
Merge pull request #192 from mnlevy1981/support_nvhpc
Add support for nvhpc on ncar machines
2 parents 298d20a + 7618bcd commit 47034fc

17 files changed

Lines changed: 2564 additions & 214 deletions

File tree

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
path = MOM6
33
url = https://github.com/NCAR/MOM6.git
44
fxDONOTUSEurl = https://github.com/NCAR/MOM6.git
5-
fxtag = dev/ncar_240923
5+
fxtag = dev/ncar_241003
66
fxrequired = AlwaysRequired
77

88
[submodule "stochastic_physics"]
@@ -16,6 +16,6 @@
1616
path = externals/MARBL
1717
url = https://github.com/marbl-ecosys/MARBL.git
1818
fxDONOTUSEurl = https://github.com/marbl-ecosys/MARBL.git
19-
fxtag = marbl0.47.1
19+
fxtag = marbl0.48.0
2020
fxrequired = AlwaysRequired
2121

cime_config/testdefs/testlist_mom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@
119119
<option name="wallclock">00:30:00</option>
120120
</options>
121121
</test>
122-
<test name="SMS_Ld2_D" grid="TL319_t232" compset="C1850MARBL_JRA">
122+
<test name="SMS_Ld1_D" grid="TL319_t232" compset="C1850MARBL_JRA">
123123
<machines>
124+
<machine name="derecho" compiler="intel" category="aux_mom"/>
124125
<machine name="derecho" compiler="intel" category="aux_mom_MARBL"/>
126+
<machine name="derecho" compiler="intel" category="prebeta"/>
125127
</machines>
126128
<options>
127129
<option name="wallclock">00:30:00</option>

externals/MARBL

standalone/build/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ intel/
22
intel-*/
33
gnu/
44
gnu-*/
5+
nvhpc/
6+
nvhpc-*/

standalone/build/build_examples.sh

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ FMS_ROOT=${CESM_ROOT}/libraries/FMS
1818
# Default compiler
1919
COMPILER="intel"
2020
MACHINE="ncar"
21+
DEBUG=0 # Set to False (REPRO Mode)!
2122

2223
# Parse command line arguments
2324
while [[ "$#" -gt 0 ]]; do
@@ -28,6 +29,8 @@ while [[ "$#" -gt 0 ]]; do
2829
--machine)
2930
MACHINE="$2"
3031
shift ;;
32+
--debug)
33+
DEBUG=1 ;;
3134
*)
3235
echo "Unknown parameter passed: $1"
3336
echo "Usage: $0 [--compiler <compiler>] [--machine <machine>]"
@@ -58,38 +61,63 @@ case $MACHINE in
5861
JOBS=4
5962
;;
6063
"ncar")
61-
JOBS=36
64+
JOBS=32
6265
;;
6366
*)
6467
echo "Invalid machine type for make -j option: $MACHINE"
6568
exit 1
6669
;;
6770
esac
6871

69-
if [ -e $1 ]; then
70-
BLD_ROOT=${COMPILER}
72+
if [ "${DEBUG}" == 1 ]; then
73+
BLD_ROOT=${COMPILER}-debug
7174
else
72-
BLD_ROOT=$1
75+
BLD_ROOT=${COMPILER}
76+
fi
77+
78+
79+
# Load modules for NCAR
80+
if [ "$MACHINE" == "ncar" ]; then
81+
HOST=`hostname`
82+
# Load modules if on derecho
83+
if [ ! "${HOST:0:5}" == "crhtc" ] && [ ! "${HOST:0:6}" == "casper" ]; then
84+
module --force purge
85+
. /glade/u/apps/derecho/23.09/spack/opt/spack/lmod/8.7.24/gcc/7.5.0/c645/lmod/lmod/init/sh
86+
module load cesmdev/1.0 ncarenv/23.09
87+
case $COMPILER in
88+
"intel" )
89+
module load craype intel/2023.2.1 mkl ncarcompilers/1.0.0 cmake cray-mpich/8.1.27 netcdf-mpi/4.9.2 parallel-netcdf/1.12.3 parallelio/2.6.2 esmf/8.6.0
90+
;;
91+
"gnu" )
92+
module load craype gcc/12.2.0 cray-libsci/23.02.1.1 ncarcompilers/1.0.0 cmake cray-mpich/8.1.27 netcdf-mpi/4.9.2 parallel-netcdf/1.12.3 parallelio/2.6.2-debug esmf/8.6.0-debug
93+
;;
94+
"nvhpc" )
95+
module load craype nvhpc/23.7 ncarcompilers/1.0.0 cmake cray-mpich/8.1.27 netcdf-mpi/4.9.2 parallel-netcdf/1.12.3 parallelio/2.6.2 esmf/8.6.0
96+
;;
97+
*)
98+
echo "Not loading any special modules for ${COMPILER}"
99+
;;
100+
esac
101+
fi
73102
fi
74103

75104
# 1) Build FMS
76105
cd ${INTERFACE_ROOT}/standalone/build
77106
mkdir -p ${BLD_ROOT}/FMS
78107
cd ${BLD_ROOT}/FMS
79108
${MKMF_ROOT}/list_paths ${FMS_ROOT}/src
80-
# We need shr_const_mod.F90 and shr_kind_mod.F90 from ${SHR_ROOT}/src
81-
# to build FMS
109+
# We need shr_const_mod.F90 and shr_kind_mod.F90 from ${SHR_ROOT}/src to build FMS
82110
echo "${SHR_ROOT}/src/shr_kind_mod.F90" >> path_names
83111
echo "${SHR_ROOT}/src/shr_const_mod.F90" >> path_names
84112
${MKMF_ROOT}/mkmf -t ${TEMPLATE} -p libfms.a -c "-Duse_libMPI -Duse_netCDF -DSPMD" path_names
85-
make -j${JOBS} NETCDF=3 REPRO=1 libfms.a
113+
make -j${JOBS} DEBUG=${DEBUG} libfms.a
86114

87115
# 2) Build MOM6
88116
cd ${INTERFACE_ROOT}/standalone/build
89117
mkdir -p ${BLD_ROOT}/MOM6
90118
cd ${BLD_ROOT}/MOM6
91119
${MKMF_ROOT}/list_paths -l ${MOM_ROOT}/{config_src/infra/FMS2,config_src/memory/dynamic_symmetric,config_src/drivers/solo_driver,../externals/MARBL/src,config_src/external,src/{*,*/*}}/
92120
${MKMF_ROOT}/mkmf -t ${TEMPLATE} -o '-I../FMS' -p MOM6 -l '-L../FMS -lfms' -c '-Duse_libMPI -Duse_netCDF -DSPMD' path_names
93-
make -j${JOBS} NETCDF=3 REPRO=1 MOM6
121+
make -j${JOBS} DEBUG=${DEBUG} MOM6
94122

95-
echo "Finished build at `date`"
123+
echo "Finished build at `date`"

0 commit comments

Comments
 (0)