Skip to content

Commit

Permalink
bash scripts for runing Dales on JUWELS and yamo
Browse files Browse the repository at this point in the history
  • Loading branch information
jchylik committed Mar 21, 2024
1 parent c81659f commit 7c932b4
Show file tree
Hide file tree
Showing 23 changed files with 1,028 additions and 0 deletions.
82 changes: 82 additions & 0 deletions rundales/runDALES_bind4proc_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash
#
# on which CPU to run
export ICPU="2,3,4,5" # as tested by Niklas
#----------------------------------------------------------------------
# Script for running DALES#
#----------------------------------------------------------------------
#
# - requires following variables:
# $USERN :: username
# $DAYC :: current day of model of code adjustment/compilation
#
# ----------------------------------------
# based on tcshell scritps from prof Roel Neggers
# scripted and checked by Jan Chylik, August 2016
# inquiries and error reports: [email protected]
#
# last update: 21 September 2016, 11 January 2017

# === setting ================================================
# if the script is run from dales_prepare.sh, the setting does not require any changes

# ---- directory setting ---------------------------------
# directroy in which to run
export rundir=./
# # export rundir=/work/${USERN}/dales/dales4/experiments/Juelich/juelich20130605_imicro2_16x16
# busy file
export busyfile="runDALES_busy.txt"
# runlog
export RUNLOG="runlog.txt"
# setting
export N_MPI=4
# 1
export DALES="dales4"
# === script ==============================================

#------------- important directories ----------------------



# -------- run itself ------------------------------------

if [ ! -e $busyfile ]; then

#--- create file indicating that job is ongoing ---
echo "runDALES job is busy ... don't interfere!" > $busyfile

cd ${rundir}

#echo "test" > test.txt

# running dales
echo "Starting dales run, you can view the run log ${rundir}$RUNLOG "
echo "You can view it in other terminal."
echo "Do not close this terminal until the job is finished."
#./dales_roel4_20140423
# mpirun -np $N_MPI ./${DALES_VERSION}_${USERN}_${DAYC}_${MACHINE_TYPE}>$RUNLOG
mpirun -np $N_MPI --report-bindings --cpu-list ${ICPU} ${DALES}>$RUNLOG
# mpirun -np $N_MPI ${DALES}>$RUNLOG
# note: it keeps the name of the original executable so we can have more different dales executables possibly used alongside each other if needed

#--- cleanup ---
rm $busyfile

echo " "
echo "Dales run has ended."
exit 0

else

echo " "
echo "A runDALES job is already in progress ... aborting"
echo "Exitting with exit status 3"
exit 3

fi



# ===========================================================


82 changes: 82 additions & 0 deletions rundales/runDALES_bind4proc_yamo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash
#
# on which CPU to run
export ICPU="17,18,19,20" # as tested by Niklas
#----------------------------------------------------------------------
# Script for running DALES#
#----------------------------------------------------------------------
#
# - requires following variables:
# $USERN :: username
# $DAYC :: current day of model of code adjustment/compilation
#
# ----------------------------------------
# based on tcshell scritps from prof Roel Neggers
# scripted and checked by Jan Chylik, August 2016
# inquiries and error reports: [email protected]
#
# last update: 21 September 2016, 11 January 2017

# === setting ================================================
# if the script is run from dales_prepare.sh, the setting does not require any changes

# ---- directory setting ---------------------------------
# directroy in which to run
export rundir=./
# # export rundir=/work/${USERN}/dales/dales4/experiments/Juelich/juelich20130605_imicro2_16x16
# busy file
export busyfile="runDALES_busy.txt"
# runlog
export RUNLOG="runlog.txt"
# setting
export N_MPI=4
# 1
export DALES="dales4"
# === script ==============================================

#------------- important directories ----------------------



# -------- run itself ------------------------------------

if [ ! -e $busyfile ]; then

#--- create file indicating that job is ongoing ---
echo "runDALES job is busy ... don't interfere!" > $busyfile

cd ${rundir}

#echo "test" > test.txt

# running dales
echo "Starting dales run, you can view the run log ${rundir}$RUNLOG "
echo "You can view it in other terminal."
echo "Do not close this terminal until the job is finished."
#./dales_roel4_20140423
# mpirun -np $N_MPI ./${DALES_VERSION}_${USERN}_${DAYC}_${MACHINE_TYPE}>$RUNLOG
mpirun -np $N_MPI --report-bindings --cpu-list ${ICPU} --bind-to cpu-list:ordered ${DALES}>$RUNLOG
# mpirun -np $N_MPI ${DALES}>$RUNLOG
# note: it keeps the name of the original executable so we can have more different dales executables possibly used alongside each other if needed

#--- cleanup ---
rm $busyfile

echo " "
echo "Dales run has ended."
exit 0

else

echo " "
echo "A runDALES job is already in progress ... aborting"
echo "Exitting with exit status 3"
exit 3

fi



# ===========================================================


1 change: 1 addition & 0 deletions rundales/runDALES_cheops
29 changes: 29 additions & 0 deletions rundales/runDALES_debug_n8nod2_cheops2023_gcc_openmpi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash -l
#SBATCH --partition=devel-rh7
#SBATCH --ntasks=8
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=4
#SBATCH --mem=40gb # --mem-per-cpu=20gb
#SBATCH --time=1:00:00
#SBATCH --account=UniKoeln

# number of nodes in $SLURM_NNODES (default: 1)
# number of tasks in $SLURM_NTASKS (default: 1)
# number of tasks per node in $SLURM_NTASKS_PER_NODE (default: 1)
# number of threads per task in $SLURM_CPUS_PER_TASK (default: 1)


# load modules
module load netcdf/4.9.0_gnu gnu/7.4.0 # !! these versions agree (2023)
module load openmpi
module load cmake


echo "# of nodes, tasks:" $SLURM_NNODES $SLURM_NTASKS

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/rrzk/lib/netcdf/f_4.6.0_gnu_7.4.0/lib/"

srun -n $SLURM_NTASKS dales4



1 change: 1 addition & 0 deletions rundales/runDALES_juwels
1 change: 1 addition & 0 deletions rundales/runDALES_levante
77 changes: 77 additions & 0 deletions rundales/runDALES_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
#----------------------------------------------------------------------
# Script for running DALES#
#----------------------------------------------------------------------
#
# - requires following variables:
# $USERN :: username
# $DAYC :: current day of model of code adjustment/compilation
#
# ----------------------------------------
# based on tcshell scritps from prof Roel Neggers
# scripted and checked by Jan Chylik, August 2016
# inquiries and error reports: [email protected]
#
# last update: 21 September 2016, 11 January 2017

# === setting ================================================
# if the script is run from dales_prepare.sh, the setting does not require any changes

# ---- directory setting ---------------------------------
# directroy in which to run
export rundir=./
# # export rundir=/work/${USERN}/dales/dales4/experiments/Juelich/juelich20130605_imicro2_16x16
# busy file
export busyfile="runDALES_busy.txt"
# runlog
export RUNLOG="runlog.txt"
# setting
export N_MPI=1
export DALES="dales4"
# === script ==============================================

#------------- important directories ----------------------



# -------- run itself ------------------------------------

if [ ! -e $busyfile ]; then

#--- create file indicating that job is ongoing ---
echo "runDALES job is busy ... don't interfere!" > $busyfile

cd ${rundir}

#echo "test" > test.txt

# running dales
echo "Starting dales run, you can view the run log ${rundir}$RUNLOG "
echo "You can view it in other terminal."
echo "Do not close this terminal until the job is finished."
#./dales_roel4_20140423
# mpirun -np $N_MPI ./${DALES_VERSION}_${USERN}_${DAYC}_${MACHINE_TYPE}>$RUNLOG
mpirun -np $N_MPI ${DALES}>$RUNLOG
# note: it keeps the name of the original executable so we can have more different dales executables possibly used alongside each other if needed

#--- cleanup ---
rm $busyfile

echo " "
echo "Dales run has ended."
exit 0

else

echo " "
echo "A runDALES job is already in progress ... aborting"
echo "Exitting with exit status 3"
exit 3

fi



# ===========================================================


81 changes: 81 additions & 0 deletions rundales/runDALES_local_mosaic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/bin/bash
#----------------------------------------------------------------------
# Script for running DALES#
#----------------------------------------------------------------------
#
# - requires following variables:
# $USERN :: username
# $DAYC :: current day of model of code adjustment/compilation
#
# ----------------------------------------
# based on tcshell scritps from prof Roel Neggers
# scripted and checked by Jan Chylik, August 2016
# inquiries and error reports: [email protected]
#
# last update: 21 September 2016, 11 January 2017

# === setting ================================================
# if the script is run from dales_prepare.sh, the setting does not require any changes

# ---- directory setting ---------------------------------
# directroy in which to run
export rundir=./
# # export rundir=/work/${USERN}/dales/dales4/experiments/Juelich/juelich20130605_imicro2_16x16
# busy file
export busyfile='runDALES_busy.txt'
# runlog
export RUNLOG='runlog.txt'
# message file
export MSGFILE='dales_mosaic_ayil.txt'
# setting
export N_MPI=1
export DALES='dales4'
# === script ==============================================

#------------- important directories ----------------------



# -------- run itself ------------------------------------

if [ ! -e $busyfile ]; then

#--- create file indicating that job is ongoing ---
echo "runDALES job is busy ... don't interfere!" > $busyfile

cd ${rundir}

#echo "test" > test.txt

# running dales
echo "Starting dales run, you can view the run log ${rundir}$RUNLOG "
echo "You can view it in other terminal."
echo "Do not close this terminal until the job is finished."
#./dales_roel4_20140423
# mpirun -np $N_MPI ./${DALES_VERSION}_${USERN}_${DAYC}_${MACHINE_TYPE}>$RUNLOG
mpirun -np $N_MPI ${DALES}>$RUNLOG
# note: it keeps the name of the original executable so we can have more different dales executables possibly used alongside each other if needed

echo "finished local job" > $MSGFILE

#--- cleanup ---
rm $busyfile

echo " "
echo "Dales run has ended."
exit 0

else

echo " "
echo "A runDALES job is already in progress ... aborting"
echo "Exitting with exit status 3"
exit 3

fi



# ===========================================================


30 changes: 30 additions & 0 deletions rundales/runDALES_n128nod4bind_juwels2024_gcc_parastation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash -x
#SBATCH --account=rcongm
#SBATCH --nodes=4
#SBATCH --ntasks=128
#SBATCH --ntasks-per-node=32
#SBATCH --cpus-per-task=1
#SBATCH --threads-per-core=1
#SBATCH --time=24:00:00
#SBATCH --partition=batch
#SBATCH --output=./slurm_dales-%j.out
#SBATCH --error=./slurm_error-%j.out

# *** start of job script ***
# Note: The current working directory at this point is
# the directory where sbatch was executed.

module load Stages/2024
module load GCC/12.3.0 ParaStationMPI/5.9.2-1
module load netCDF-Fortran/4.6.1
# module load CMake # not needed in rundales
# module load HDF5/1.14.2 # implicitly loaded
# module load netCDF/4.9.2 # implicitly loaded



export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}

srun --cpu-bind=map_cpu:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39 ./dales4 > runlog.txt
###srun ./dales4 > stdlog.txt
###python3 ./change_nml.py
Loading

0 comments on commit 7c932b4

Please sign in to comment.