Skip to content

Commit b31d8b5

Browse files
authored
Merge pull request #286 from GEOS-ESM/develop
GitFlow: Merge develop into main for release (2024-08-26)
2 parents cc9e8fd + c704254 commit b31d8b5

File tree

3 files changed

+62
-27
lines changed

3 files changed

+62
-27
lines changed

.circleci/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ workflows:
3434
requires:
3535
- build-GEOSgcm-on-<< matrix.compiler >>
3636
repo: GEOSgcm
37+
# Run AMIP GCM (1 hour, no ExtData)
38+
- ci/run_gcm:
39+
name: run-GCM-on-<< matrix.compiler >>
40+
context:
41+
- docker-hub-creds
42+
matrix:
43+
parameters:
44+
compiler: [gfortran, ifort]
45+
requires:
46+
- build-GEOSgcm-on-<< matrix.compiler >>
47+
repo: GEOSgcm
48+
#baselibs_version: *baselibs_version
49+
#bcs_version: *bcs_version
3750
- ci/build:
3851
name: build-GEOSfvdycore-as-<< matrix.fv_precision >>-on-<< matrix.compiler >>
3952
context:

scripts/fv3.j

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ set RUN_CMD = "$GEOSBIN/esma_mpirun -np "
132132

133133
setenv ARCH `uname`
134134
source $GEOSBIN/g5_modules
135-
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${BASEDIR}/${ARCH}/lib:${GEOSDIR}/lib
135+
setenv @LD_LIBRARY_PATH_CMD ${LD_LIBRARY_PATH}:${GEOSDIR}/lib
136+
# We only add BASEDIR to the @LD_LIBRARY_PATH_CMD if BASEDIR is defined (i.e., not running with Spack)
137+
if ( $?BASEDIR ) then
138+
setenv @LD_LIBRARY_PATH_CMD ${@LD_LIBRARY_PATH_CMD}:${BASEDIR}/${ARCH}/lib
139+
endif
136140
module list
137141

138142
#########################################

scripts/fv3_setup

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,16 @@ setenv NODE `uname -n`
3838

3939
if ($ARCH == Darwin) then
4040
set FINDPATH = realpath
41+
set PRELOAD_COMMAND = 'DYLD_INSERT_LIBRARIES'
42+
set LD_LIBRARY_PATH_CMD = 'DYLD_LIBRARY_PATH'
43+
# On macOS we seem to need to call mpirun directly and not use esma_mpirun
44+
# For some reason SIP does not let the libraries be preloaded
45+
set RUN_CMD = 'mpirun -np '
4146
else
4247
set FINDPATH = 'readlink -f'
48+
set PRELOAD_COMMAND = 'LD_PRELOAD'
49+
set LD_LIBRARY_PATH_CMD = 'LD_LIBRARY_PATH'
50+
set RUN_CMD = '$GEOSBIN/esma_mpirun -np '
4351
endif
4452
set FV3SETUP = `$FINDPATH $0`
4553
set BINDIR = `dirname $FV3SETUP`
@@ -64,9 +72,11 @@ endif
6472
# path to the sandbox. If we are not, then we set it to an empty
6573
# string.
6674
#
67-
# We also set the REAL_BIND_PATH environment variable. This is used
68-
# to set the bind paths for Singularity runs. REAL_BIND_PATH is the
69-
# physical path to the NOBACKUP directory
75+
# We also set the REAL_BIND_PATH and BASE_BIND_PATH environment
76+
# variables. These are used to set the bind paths for Singularity
77+
# runs. REAL_BIND_PATH is the physical path to the NOBACKUP directory
78+
# and BASE_BIND_PATH is the physical path to the /gpfsm directory
79+
# (needed for boundary conditions)
7080

7181
setenv KEYFILE ".singularity.d"
7282
setenv singstat 0
@@ -85,34 +95,24 @@ while ($singstat == 0)
8595
endif
8696
endif
8797
end
88-
8998
if ($singstat == 1) then
9099
setenv SINGULARITY_SANDBOX $SINGPATH
91100
setenv REAL_BIND_PATH `realpath $NOBACKUP`
92-
93-
set USING_SINGULARITY = TRUE
94-
set SINGULARITY_BUILD = ""
95-
set NATIVE_BUILD = "#DELETE"
101+
setenv BASE_BIND_PATH "/gpfsm"
96102
else
97103
setenv SINGULARITY_SANDBOX ""
98104
setenv REAL_BIND_PATH ""
99-
100-
set USING_SINGULARITY = FALSE
101-
set SINGULARITY_BUILD = "#DELETE"
102-
set NATIVE_BUILD = ""
105+
setenv BASE_BIND_PATH ""
103106
endif
104107

105108
cd $ORIGPATH
106109

107-
# Set TMPDIR to /tmp due to issues with heredocs in Singularity sandboxes
108-
# -----------------------------------------------------------------------
109-
110-
setenv TMPDIR /tmp
111-
112110
#######################################################################
113111
# Test for Command Line Flags
114112
#######################################################################
115113

114+
# Set default behavior of switches
115+
set EXE_VERB = "copied"
116116
set SINGULARITY_RUN_SITE = ""
117117
if ($singstat == 1) then
118118
set USING_SINGULARITY = TRUE
@@ -131,6 +131,7 @@ if ($singstat == 1) then
131131
else
132132
set USING_SINGULARITY = FALSE
133133
endif
134+
134135
while ( $#argv > 0 )
135136
set arg = $argv[1]
136137
shift argv
@@ -342,6 +343,7 @@ else if ( $SITE == 'NAS' ) then
342343
echo " ${C2}sky (Skylake)${CN} (default)"
343344
echo " ${C2}cas (Cascade Lake)${CN}"
344345
echo " ${C2}rom (AMD Rome)${CN}"
346+
echo " ${C2}mil (AMD Milan)${CN}"
345347
echo " "
346348
echo " NOTE Due to how FV3 is compiled by default, Sandy Bridge"
347349
echo " and Ivy Bridge are not supported by current GEOS"
@@ -356,7 +358,8 @@ else if ( $SITE == 'NAS' ) then
356358
$MODEL != 'bro' & \
357359
$MODEL != 'sky' & \
358360
$MODEL != 'cas' & \
359-
$MODEL != 'rom' ) goto ASKPROC
361+
$MODEL != 'rom' & \
362+
$MODEL != 'mil' ) goto ASKPROC
360363

361364
# Some processors have weird names at NAS
362365
# ---------------------------------------
@@ -367,13 +370,11 @@ else if ( $SITE == 'NAS' ) then
367370
set MODEL = 'cas_ait'
368371
else if ($MODEL == rom) then
369372
set MODEL = 'rom_ait'
373+
else if ($MODEL == mil) then
374+
set MODEL = 'mil_ait'
370375
endif
371376

372-
if ( $MODEL == 'san') then
373-
set NCPUS_PER_NODE = 16
374-
else if ($MODEL == 'ivy') then
375-
set NCPUS_PER_NODE = 20
376-
else if ($MODEL == 'has') then
377+
if ($MODEL == 'has') then
377378
set NCPUS_PER_NODE = 24
378379
else if ($MODEL == 'bro') then
379380
set NCPUS_PER_NODE = 28
@@ -383,6 +384,8 @@ else if ( $SITE == 'NAS' ) then
383384
set NCPUS_PER_NODE = 40
384385
else if ($MODEL == 'rom_ait') then
385386
set NCPUS_PER_NODE = 128
387+
else if ($MODEL == 'mil_ait') then
388+
set NCPUS_PER_NODE = 128
386389
endif
387390

388391
else if( $SITE == 'AWS' | $SITE == 'Azure' ) then
@@ -689,6 +692,21 @@ endif
689692
if( -e $HOME/.GROUProot ) /bin/rm $HOME/.GROUProot
690693
echo $GROUP > $HOME/.GROUProot
691694

695+
#######################################################################
696+
# Set some singularity variables
697+
#######################################################################
698+
699+
# Copy or link GEOSgcm.x if USING_SINGULARITY is FALSE
700+
if ( $USING_SINGULARITY == FALSE ) then
701+
# Set a couple variables for sed'ing out bits of the run script
702+
set SINGULARITY_BUILD = "#DELETE"
703+
set NATIVE_BUILD = ""
704+
else
705+
# Set a couple variables for sed'ing out bits of the run script
706+
set SINGULARITY_BUILD = ""
707+
set NATIVE_BUILD = "#DELETE"
708+
endif
709+
692710
#######################################################################
693711
# Set Recommended MPI Stack Settings
694712
#######################################################################
@@ -780,7 +798,6 @@ EOF
780798
else if( $MPI_STACK == intelmpi ) then
781799

782800
cat > $EXPDIR/SETENV.commands << EOF
783-
#setenv MPS_STAT_LEVEL 4
784801
setenv I_MPI_ADJUST_ALLREDUCE 12
785802
setenv I_MPI_ADJUST_GATHERV 3
786803
@@ -798,8 +815,8 @@ setenv I_MPI_SHM_HEAP_VSIZE 512
798815
setenv PSM2_MEMORY large
799816
EOF
800817

801-
#Testing at NCCS showed these caused crash at higher res
802-
#Crashed at restart read
818+
# Testing at NCCS showed these caused a crash at higher resolutions at
819+
# restart read
803820
if ( $USING_SINGULARITY == FALSE ) then
804821

805822
cat >> $EXPDIR/SETENV.commands << EOF
@@ -879,6 +896,7 @@ s?@SINGULARITY_BUILD?$SINGULARITY_BUILD?g
879896
s?@NATIVE_BUILD?$NATIVE_BUILD?g
880897
s?@SINGULARITY_SANDBOX?$SINGULARITY_SANDBOX?g
881898
s?@REAL_BIND_PATH?$REAL_BIND_PATH?g
899+
s?@LD_LIBRARY_PATH_CMD?$LD_LIBRARY_PATH_CMD?g
882900
883901
s^@AGCM_GRIDNAME^$AGCM_GRIDNAME^g
884902

0 commit comments

Comments
 (0)