From 5952720dd3998f7f9b07c67421586493eec10f4d Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 27 Jun 2023 12:46:01 -0400 Subject: [PATCH 1/3] Updates for Singularity --- gcm_setup | 23 ++++++++++++++++++++++- geoschemchem_setup | 23 ++++++++++++++++++++++- gmichem_setup | 23 ++++++++++++++++++++++- stratchem_setup | 23 ++++++++++++++++++++++- 4 files changed, 88 insertions(+), 4 deletions(-) diff --git a/gcm_setup b/gcm_setup index f306d542..129bb764 100755 --- a/gcm_setup +++ b/gcm_setup @@ -60,6 +60,7 @@ endif set LINKX = FALSE set EXE_VERB = "copied" set USING_SINGULARITY = FALSE +set USER_SITE = "" while ( $#argv > 0 ) set arg = $argv[1] @@ -70,6 +71,22 @@ while ( $#argv > 0 ) case --[Cc][Oo][Ll][Oo][Rr]: goto SETCOLOR + # Testing with singularity found we need the ability to override + # the SITE variable below because images might be built on, say, + # AWS and thus "block" us from running at NCCS. + # + # So, we make a --site flag that allows us to override the SITE + # variable + case --site: + set USER_SITE = $1 + # if USER_SITE is empty, then we error out + if ( "$USER_SITE" == "" ) then + echo "ERROR: --site flag requires a site name" + exit 1 + endif + shift argv + breaksw + # Symlink GEOSgcm.x case --link: set LINKX = TRUE @@ -100,7 +117,11 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +if ($USER_SITE = "") then + setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +else + setenv SITE $USER_SITE +endif ####################################################################### # Test for Compiler and MPI Setup diff --git a/geoschemchem_setup b/geoschemchem_setup index 105eca28..fe417085 100755 --- a/geoschemchem_setup +++ b/geoschemchem_setup @@ -60,6 +60,7 @@ endif set LINKX = FALSE set EXE_VERB = "copied" set USING_SINGULARITY = FALSE +set USER_SITE = "" while ( $#argv > 0 ) set arg = $argv[1] @@ -70,6 +71,22 @@ while ( $#argv > 0 ) case --[Cc][Oo][Ll][Oo][Rr]: goto SETCOLOR + # Testing with singularity found we need the ability to override + # the SITE variable below because images might be built on, say, + # AWS and thus "block" us from running at NCCS. + # + # So, we make a --site flag that allows us to override the SITE + # variable + case --site: + set USER_SITE = $1 + # if USER_SITE is empty, then we error out + if ( "$USER_SITE" == "" ) then + echo "ERROR: --site flag requires a site name" + exit 1 + endif + shift argv + breaksw + # Symlink GEOSgcm.x case --link: set LINKX = TRUE @@ -100,7 +117,11 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +if ($USER_SITE = "") then + setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +else + setenv SITE $USER_SITE +endif ####################################################################### # Test for Compiler and MPI Setup diff --git a/gmichem_setup b/gmichem_setup index a02b8371..ca513c64 100755 --- a/gmichem_setup +++ b/gmichem_setup @@ -60,6 +60,7 @@ endif set LINKX = FALSE set EXE_VERB = "copied" set USING_SINGULARITY = FALSE +set USER_SITE = "" while ( $#argv > 0 ) set arg = $argv[1] @@ -70,6 +71,22 @@ while ( $#argv > 0 ) case --[Cc][Oo][Ll][Oo][Rr]: goto SETCOLOR + # Testing with singularity found we need the ability to override + # the SITE variable below because images might be built on, say, + # AWS and thus "block" us from running at NCCS. + # + # So, we make a --site flag that allows us to override the SITE + # variable + case --site: + set USER_SITE = $1 + # if USER_SITE is empty, then we error out + if ( "$USER_SITE" == "" ) then + echo "ERROR: --site flag requires a site name" + exit 1 + endif + shift argv + breaksw + # Symlink GEOSgcm.x case --link: set LINKX = TRUE @@ -100,7 +117,11 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +if ($USER_SITE = "") then + setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +else + setenv SITE $USER_SITE +endif ####################################################################### # Test for Compiler and MPI Setup diff --git a/stratchem_setup b/stratchem_setup index ca40903b..cb46a8b1 100755 --- a/stratchem_setup +++ b/stratchem_setup @@ -60,6 +60,7 @@ endif set LINKX = FALSE set EXE_VERB = "copied" set USING_SINGULARITY = FALSE +set USER_SITE = "" while ( $#argv > 0 ) set arg = $argv[1] @@ -70,6 +71,22 @@ while ( $#argv > 0 ) case --[Cc][Oo][Ll][Oo][Rr]: goto SETCOLOR + # Testing with singularity found we need the ability to override + # the SITE variable below because images might be built on, say, + # AWS and thus "block" us from running at NCCS. + # + # So, we make a --site flag that allows us to override the SITE + # variable + case --site: + set USER_SITE = $1 + # if USER_SITE is empty, then we error out + if ( "$USER_SITE" == "" ) then + echo "ERROR: --site flag requires a site name" + exit 1 + endif + shift argv + breaksw + # Symlink GEOSgcm.x case --link: set LINKX = TRUE @@ -100,7 +117,11 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +if ($USER_SITE = "") then + setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` +else + setenv SITE $USER_SITE +endif ####################################################################### # Test for Compiler and MPI Setup From a07e493cdac87775e01718e7999764cfe96e05d0 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 27 Jun 2023 13:01:35 -0400 Subject: [PATCH 2/3] load g5_modules --- gcm_run.j | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcm_run.j b/gcm_run.j index 940a31fd..19c812ab 100755 --- a/gcm_run.j +++ b/gcm_run.j @@ -32,8 +32,8 @@ setenv GEOSBIN @GEOSBIN setenv GEOSETC @GEOSETC setenv GEOSUTIL @GEOSSRC -@NATIVE_BUILD source $GEOSBIN/g5_modules -@NATIVE_BUILD setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${BASEDIR}/${ARCH}/lib:${GEOSDIR}/lib +source $GEOSBIN/g5_modules +setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${BASEDIR}/${ARCH}/lib:${GEOSDIR}/lib setenv RUN_CMD "$GEOSBIN/esma_mpirun -np " From 55dbc939f1a34bf24f02d27bf91e2123561398ad Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Tue, 27 Jun 2023 14:13:29 -0400 Subject: [PATCH 3/3] Use correct tcsh --- gcm_setup | 2 +- geoschemchem_setup | 2 +- gmichem_setup | 2 +- stratchem_setup | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcm_setup b/gcm_setup index 129bb764..0ce0f192 100755 --- a/gcm_setup +++ b/gcm_setup @@ -117,7 +117,7 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -if ($USER_SITE = "") then +if ($USER_SITE == "") then setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` else setenv SITE $USER_SITE diff --git a/geoschemchem_setup b/geoschemchem_setup index fe417085..aa67e300 100755 --- a/geoschemchem_setup +++ b/geoschemchem_setup @@ -117,7 +117,7 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -if ($USER_SITE = "") then +if ($USER_SITE == "") then setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` else setenv SITE $USER_SITE diff --git a/gmichem_setup b/gmichem_setup index ca513c64..bae48328 100755 --- a/gmichem_setup +++ b/gmichem_setup @@ -117,7 +117,7 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -if ($USER_SITE = "") then +if ($USER_SITE == "") then setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` else setenv SITE $USER_SITE diff --git a/stratchem_setup b/stratchem_setup index cb46a8b1..659fa195 100755 --- a/stratchem_setup +++ b/stratchem_setup @@ -117,7 +117,7 @@ end setenv NODE `uname -n` setenv ARCH `uname -s` -if ($USER_SITE = "") then +if ($USER_SITE == "") then setenv SITE `awk '{print $2}' $ETCDIR/SITE.rc` else setenv SITE $USER_SITE