Skip to content

Commit

Permalink
Basic scripts for building and running GEOS on Discover
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianDeconinck committed Aug 27, 2024
1 parent 2f2d7c2 commit 4633320
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 0 deletions.
1 change: 1 addition & 0 deletions geos_build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adapat the `basics.sh` to your local needs. It has been written for Discover and a specific user.
20 changes: 20 additions & 0 deletions geos_build/serialize/basics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Setup tech stack
module use -a /discover/nobackup/projects/geosongpu/sw_sles15/live/modulefiles
module load SMTStack/2024.04.00
# < load virtual environment to get local NDSL/GT4Py/DaCe >

# GEOS Build directory
export GEOS_BASEDIR="/discover/nobackup/fgdeconi/work/git/fp"
export GEOS_BUILDIR="$GEOS_BASEDIR/geos/build_SERIALIZE"
export GEOS_INSTALLDIR="$GEOS_BASEDIR/geos/install_SERIALIZE"

# Experiments
export XP_BASEDIR="/discover/nobackup/fgdeconi/work/git/fp/experiments"
export XP_C24_NAME="TBC_C24_L72"
export XP_C24="$XP_BASEDIR/$XP_C24_NAME"
export TBC_SCRIPTS ="/home/mad/work/TinyBCs-GitV10/scripts/"

# Build details
$BUILD_CORES=48 #how many cores to build
25 changes: 25 additions & 0 deletions geos_build/serialize/cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

source ./basics.sh

rm -rf $GEOS_BUILDIR
mkdir -p $GEOS_BUILDIR
cd $GEOS_BUILDIR
export TMP="$GEOS_BUILDIR/tmp"
export TMPDIR=$TMP
export TEMP=$TMP
mkdir -p $TMP

export FC=mpif90
export CC=mpicc
export CXX=mpic++

cmake .. -DBASEDIR=$BASEDIR/Linux \
-DCMAKE_Fortran_COMPILER=mpif90 \
-DBUILD_PYFV3_INTERFACE=OFF \
-DBUILD_PYMOIST_INTERFACE=OFF \
-DCMAKE_INSTALL_PREFIX=$GEOS_INSTALLDIR \
-DPython3_EXECUTABLE=`which python3` \
-DBUILD_SERIALBOX_SER=ON \
-DSERIALBOX_ROOT=$SERIALBOX_ROOT \
-DCMAKE_BUILD_TYPE=Debug
12 changes: 12 additions & 0 deletions geos_build/serialize/make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

source ./basics.sh


cd $GEOS_BUILDIR

export TMP="$GEOS_BUILDIR/tmp"
export TMPDIR=$TMP
export TEMP=$TMP

make -j$BUILD_CORES install
6 changes: 6 additions & 0 deletions geos_build/serialize/serialize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

source ./basics.sh

./make.sh
./xp_C24_run.sh
27 changes: 27 additions & 0 deletions geos_build/serialize/xp_C24_make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

source ./basics.sh

rm -rf $XP_C24
mkdir -p $XP_C24

cd $GEOS_INSTALLDIR/bin
$TBC_SCRIPTS/create_expt.py \
--horz c24 --vert 72 \
--nonhydro --nooserver \
--moist GFDL \
--link \
--expdir $XP_BASEDIR \
$XP_C24_NAME

# Make one day - pre-written script -
cd $XP_C24
$TBC_SCRIPTS/makeoneday.bash

# Make 1x1 layout
sed -e "/^ *NX:/ s/\([0-9]\+\)/1/" AGCM.rc
sed -e "/^ *NY:/ s/\([0-9][0-9]\+\)/6/" AGCM.rc

# Make 1ts for serialization
sed -e '/^JOB_SGMT:/s/000000[0-9][0-9] 000000/00000000 003001/' CAP.rc

8 changes: 8 additions & 0 deletions geos_build/serialize/xp_C24_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# On discover `salloc` first wih ntasks=6

source ./basics.sh

cd $XP_C24
./gcm_run.j

0 comments on commit 4633320

Please sign in to comment.