@@ -38,8 +38,16 @@ setenv NODE `uname -n`
3838
3939if ($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 '
4146else
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 '
4351endif
4452set FV3SETUP = ` $FINDPATH $0 `
4553set BINDIR = ` dirname $FV3SETUP `
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
7181setenv KEYFILE " .singularity.d"
7282setenv singstat 0
@@ -85,34 +95,24 @@ while ($singstat == 0)
8595 endif
8696 endif
8797end
88-
8998if ($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"
96102else
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 " "
103106endif
104107
105108cd $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"
116116set SINGULARITY_RUN_SITE = " "
117117if ($singstat == 1) then
118118 set USING_SINGULARITY = TRUE
@@ -131,6 +131,7 @@ if ($singstat == 1) then
131131else
132132 set USING_SINGULARITY = FALSE
133133endif
134+
134135while ( $# 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
388391else if( $SITE == ' AWS' | $SITE == ' Azure' ) then
@@ -689,6 +692,21 @@ endif
689692if( -e $HOME /.GROUProot ) /bin/rm $HOME /.GROUProot
690693echo $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# ######################################################################
780798else if( $MPI_STACK == intelmpi ) then
781799
782800cat > $EXPDIR /SETENV.commands << EOF
783- #setenv MPS_STAT_LEVEL 4
784801setenv I_MPI_ADJUST_ALLREDUCE 12
785802setenv I_MPI_ADJUST_GATHERV 3
786803
@@ -798,8 +815,8 @@ setenv I_MPI_SHM_HEAP_VSIZE 512
798815setenv PSM2_MEMORY large
799816EOF
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
803820if ( $USING_SINGULARITY == FALSE ) then
804821
805822cat >> $EXPDIR /SETENV.commands << EOF
@@ -879,6 +896,7 @@ s?@SINGULARITY_BUILD?$SINGULARITY_BUILD?g
879896s?@NATIVE_BUILD?$NATIVE_BUILD ?g
880897s?@SINGULARITY_SANDBOX?$SINGULARITY_SANDBOX ?g
881898s?@REAL_BIND_PATH?$REAL_BIND_PATH ?g
899+ s?@LD_LIBRARY_PATH_CMD?$LD_LIBRARY_PATH_CMD ?g
882900
883901s^@AGCM_GRIDNAME^$AGCM_GRIDNAME ^g
884902
0 commit comments