-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: bash scripts for Levante use openmpi compiler wrappers
- Loading branch information
1 parent
d79ef38
commit c28f743
Showing
5 changed files
with
29 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,16 @@ | |
### ---------------------------------------------------- ### | ||
dobuild=$1 # == "build" or otherwise | ||
|
||
module load gcc/11.2.0-gcc-11.2.0 | ||
module load nvhpc/23.9-gcc-11.2.0 | ||
module load gcc/11.2.0-gcc-11.2.0 openmpi/4.1.2-gcc-11.2.0 | ||
# module load gcc/11.2.0-gcc-11.2.0 nvhpc/23.9-gcc-11.2.0 openmpi/4.1.6-nvhpc-23.9 # (CUDA) | ||
spack load [email protected]%gcc | ||
source activate /work/bm1183/m300950/mambaenvs/cleoenv | ||
path2CLEO=${HOME}/CLEO/ | ||
path2build=${HOME}/CLEO/roughpaper/scratch/build/ | ||
gxx="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/g++" | ||
gcc="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/gcc" | ||
gxx="/sw/spack-levante/openmpi-4.1.2-mnmady/bin/mpic++" | ||
gcc="/sw/spack-levante/openmpi-4.1.2-mnmady/bin/mpicc" | ||
# gxx="/sw/spack-levante/openmpi-4.1.6-mjsagq/bin/mpic++" # (CUDA) | ||
# gcc="/sw/spack-levante/openmpi-4.1.6-mjsagq/bin/mpicc" # (CUDA) | ||
### ---------------------------------------------------- ### | ||
|
||
### ---------------------------------------------------- ### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,19 +17,17 @@ | |
### --------- and optionally your environment, path to CLEO and the -------- ### | ||
### ----------------------- desired build directory ----------------------- ### | ||
### ------------------------------------------------------------------------ ### | ||
module load gcc/11.2.0-gcc-11.2.0 | ||
module load nvhpc/23.9-gcc-11.2.0 | ||
module load gcc/11.2.0-gcc-11.2.0 nvhpc/23.9-gcc-11.2.0 openmpi/4.1.6-nvhpc-23.9 | ||
spack load [email protected]%gcc | ||
gxx="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/g++" | ||
gcc="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/gcc" | ||
gxx="/sw/spack-levante/openmpi-4.1.6-mjsagq/bin/mpic++" | ||
gcc="/sw/spack-levante/openmpi-4.1.6-mjsagq/bin/mpicc" | ||
|
||
path2CLEO=$1 # required | ||
path2build=$2 # required | ||
enableyac=$3 # required | ||
yacyaxtroot=$4 # required if enableyac=true | ||
|
||
yac_openmpi=openmpi/4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc) | ||
yac_netcdf=netcdf-c/4.8.1-openmpi-4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc & openmp) | ||
yac_netcdf=netcdf-c/4.8.1-openmpi-4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc & openmpi) | ||
[email protected]%gcc@=11.2.0 # required if enableyac=true (must match gcc) | ||
### ------------------------------------------------------------------------ ### | ||
|
||
|
@@ -80,7 +78,7 @@ then | |
yacflags="-DENABLE_YAC_COUPLING=OFF" | ||
|
||
else | ||
module load ${yac_openmpi} ${yac_netcdf} | ||
module load ${yac_netcdf} | ||
spack load ${yac_openblas} | ||
yacflags="-DENABLE_YAC_COUPLING=ON -DYAXT_ROOT=${yacyaxtroot}/yaxt -DYAC_ROOT=${yacyaxtroot}/yac" | ||
yacmodule="${path2CLEO}/libs/coupldyn_yac/cmake" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,18 +16,17 @@ | |
### --------- and optionally your environment, path to CLEO and the -------- ### | ||
### ----------------------- desired build directory ----------------------- ### | ||
### ------------------------------------------------------------------------ ### | ||
module load gcc/11.2.0-gcc-11.2.0 | ||
module load gcc/11.2.0-gcc-11.2.0 openmpi/4.1.2-gcc-11.2.0 | ||
spack load [email protected]%gcc | ||
gxx="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/g++" | ||
gcc="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/gcc" | ||
gxx="/sw/spack-levante/openmpi-4.1.2-mnmady/bin/mpic++" | ||
gcc="/sw/spack-levante/openmpi-4.1.2-mnmady/bin/mpicc" | ||
|
||
path2CLEO=$1 # required | ||
path2build=$2 # required | ||
enableyac=$3 # required | ||
yacyaxtroot=$4 # required if enableyac=true | ||
|
||
yac_openmpi=openmpi/4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc) | ||
yac_netcdf=netcdf-c/4.8.1-openmpi-4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc & openmp) | ||
yac_netcdf=netcdf-c/4.8.1-openmpi-4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc & openmpi) | ||
[email protected]%gcc@=11.2.0 # required if enableyac=true (must match gcc) | ||
### ------------------------------------------------------------------------ ### | ||
|
||
|
@@ -63,7 +62,7 @@ if ! [ "${enableyac}" == "true" ] | |
then | ||
yacflags="-DENABLE_YAC_COUPLING=OFF" | ||
else | ||
module load ${yac_openmpi} ${yac_netcdf} | ||
module load ${yac_netcdf} | ||
spack load ${yac_openblas} | ||
yacflags="-DENABLE_YAC_COUPLING=ON -DYAXT_ROOT=${yacyaxtroot}/yaxt -DYAC_ROOT=${yacyaxtroot}/yac" | ||
yacmodule="${path2CLEO}/libs/coupldyn_yac/cmake" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,18 +16,17 @@ | |
### --------- and optionally your environment, path to CLEO and the -------- ### | ||
### ----------------------- desired build directory ----------------------- ### | ||
### ------------------------------------------------------------------------ ### | ||
module load gcc/11.2.0-gcc-11.2.0 | ||
module load gcc/11.2.0-gcc-11.2.0 openmpi/4.1.2-gcc-11.2.0 | ||
spack load [email protected]%gcc | ||
gxx="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/g++" | ||
gcc="/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/gcc" | ||
gxx="/sw/spack-levante/openmpi-4.1.2-mnmady/bin/mpic++" | ||
gcc="/sw/spack-levante/openmpi-4.1.2-mnmady/bin/mpicc" | ||
|
||
path2CLEO=$1 # required | ||
path2build=$2 # required | ||
enableyac=$3 # required | ||
yacyaxtroot=$4 # required if enableyac=true | ||
|
||
yac_openmpi=openmpi/4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc) | ||
yac_netcdf=netcdf-c/4.8.1-openmpi-4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc & openmp) | ||
yac_netcdf=netcdf-c/4.8.1-openmpi-4.1.2-gcc-11.2.0 # required if enableyac=true (must match gcc & openmpi) | ||
[email protected]%gcc@=11.2.0 # required if enableyac=true (must match gcc) | ||
### ------------------------------------------------------------------------ ### | ||
|
||
|
@@ -64,7 +63,7 @@ then | |
yacflags="-DENABLE_YAC_COUPLING=OFF" | ||
|
||
else | ||
module load ${yac_openmpi} ${yac_netcdf} | ||
module load ${yac_netcdf} | ||
spack load ${yac_openblas} | ||
yacflags="-DENABLE_YAC_COUPLING=ON -DYAXT_ROOT=${yacyaxtroot}/yaxt -DYAC_ROOT=${yacyaxtroot}/yac" | ||
yacmodule="${path2CLEO}/libs/coupldyn_yac/cmake" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,19 +22,22 @@ cleoenv=$1 # get from command line argument | |
buildtype=$2 # get from command line argument | ||
path2build=$3 # get from command line argument | ||
executables="$4" # get from command line argument | ||
|
||
spack load [email protected]%gcc | ||
module load gcc/11.2.0-gcc-11.2.0 | ||
# source activate ${cleoenv} # TODO(CB): fix best practise | ||
|
||
if [ "${buildtype}" != "serial" ] && [ "${buildtype}" != "openmp" ] && [ "${buildtype}" != "cuda" ]; | ||
then | ||
echo "please specify the build type as 'serial', 'openmp' or 'cuda'" | ||
else | ||
# load nvhpc compilers if compiling cuda build | ||
spack load [email protected]%gcc | ||
module load gcc/11.2.0-gcc-11.2.0 | ||
|
||
# load nvhpc compilers and mpi wrappers if compiling cuda build | ||
if [[ "${buildtype}" == "cuda" ]] | ||
then | ||
module load nvhpc/23.9-gcc-11.2.0 | ||
module load nvhpc/23.9-gcc-11.2.0 openmpi/4.1.6-nvhpc-23.9 | ||
# otherwise use gcc mpi wrappers | ||
else | ||
module load openmpi/4.1.2-gcc-11.2.0 | ||
fi | ||
### ---------------------------------------------------- ### | ||
|
||
|