Skip to content

Commit 1e89e25

Browse files
committed
Modification to ICL hpc helper scripts.
1 parent 49abcac commit 1e89e25

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

tools/hpc_execute.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set -e
2222
if (( $# < 1 ))
2323
then
2424
echo "The experiment directory must be set."
25-
echo "usage: FROM THE TOP LEVEL DIRECTORY run: bash ./u-dales/tools/hpc_execute.sh <PATH_TO_CASE>"
25+
echo "usage: FROM THE TOP LEVEL DIRECTORY run: u-dales/tools/hpc_execute.sh <PATH_TO_CASE>"
2626
exit 1
2727
fi
2828

@@ -53,7 +53,7 @@ if [ -z $DA_BUILD ]; then
5353
exit 1
5454
fi;
5555
if [ -z $DA_TOOLSDIR ]; then
56-
echo "Script directory DA_TOOLSDIR must be set inside $outdir/config.sh"
56+
echo "Script directory DA_TOOLSDIR must be set inside $inputdir/config.sh"
5757
exit 1
5858
fi;
5959
if [ -z $NNODE ]; then
@@ -76,26 +76,23 @@ fi;
7676
## set the output directory
7777
outdir=$DA_WORKDIR/$exp
7878

79-
## copy files to execution and output directory
80-
mkdir -p $outdir
81-
cp -r $inputdir/* $outdir
82-
pushd $outdir
83-
8479
echo "writing job.$exp."
8580

8681
## write new job.exp file for HPC
8782
cat <<EOF > job.$exp
8883
#!/bin/bash
8984
#PBS -l walltime=${WALLTIME}
9085
#PBS -l select=${NNODE}:ncpus=${NCPU}:mem=${MEM}
91-
module load intel/2025a netCDF/4.9.2-iimpi-2023a netCDF-Fortran/4.6.1-iimpi-2023a FFTW/3.3.9-intel-2021a CMake/3.29.3-GCCcore-13.3.0 git/2.45.1-GCCcore-13.3.0 NCO/5.2.9-foss-2024a GSL/2.8-GCC-13.3.0
86+
module load intel/2025a netCDF/4.9.2-iimpi-2023a netCDF-Fortran/4.6.1-iimpi-2023a FFTW/3.3.9-intel-2021a CMake/3.29.3-GCCcore-13.3.0 git/2.45.1-GCCcore-13.3.0
87+
mkdir -p $outdir
88+
cp -r $inputdir/* $outdir
89+
pushd $outdir
9290
mpiexec -n $(( $NCPU * $NNODE )) $DA_BUILD $outdir/namoptions.$exp > $outdir/output.$exp 2>&1
91+
module load NCO/5.2.9-foss-2024a GSL/2.8-GCC-13.3.0
9392
$DA_TOOLSDIR/gather_outputs.sh $outdir
9493
EOF
9594

9695
## submit job.exp file to queue
9796
qsub job.$exp
9897

9998
echo "job.$exp submitted."
100-
101-
popd

tools/hpc_gather.sh

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,62 +21,69 @@ set -e
2121

2222
if (( $# < 1 ))
2323
then
24-
echo "The output case directory must be set."
25-
echo "usage: FROM THE TOP LEVEL DIRECTORY run: bash ./u-dales/tools/hpc_gather.sh <PATH_TO_OUTPUT_CASE>"
24+
echo "The experiment directory must be set."
25+
echo "usage: FROM THE TOP LEVEL DIRECTORY run: u-dales/tools/hpc_gather.sh <PATH_TO_CASE>"
2626
exit 1
2727
fi
2828

29-
## go to output case directory
29+
## go to experiment directory
3030
pushd $1
31-
outdir=$(pwd)
31+
inputdir=$(pwd)
3232

3333
## set experiment number via path
34-
exp="${outdir: -3}"
34+
exp="${inputdir: -3}"
3535

3636
echo "experiment number: $exp"
3737

3838
## read in additional variables
3939
if [ -f config.sh ]; then
4040
source config.sh
4141
else
42-
echo "config.sh must be there inside $outdir"
42+
echo "config.sh must be there inside $inputdir"
4343
exit 1
4444
fi
4545

4646
## check if required variables are set
47+
if [ -z $DA_WORKDIR ]; then
48+
echo "Script directory DA_WORKDIR must be set inside $inputdir/config.sh"
49+
exit 1
50+
fi;
4751
if [ -z $DA_TOOLSDIR ]; then
48-
echo "Script directory DA_TOOLSDIR must be set inside $outdir/config.sh"
52+
echo "Script directory DA_TOOLSDIR must be set inside $inputdir/config.sh"
4953
exit 1
5054
fi;
5155
if [ -z $NNODE ]; then
52-
echo "Script directory NNODE must be set inside $outdir/config.sh"
56+
echo "Script directory NNODE must be set inside $inputdir/config.sh"
5357
exit 1
5458
fi;
5559
if [ -z $NCPU ]; then
56-
echo "Script directory NCPU must be set inside $outdir/config.sh"
60+
echo "Script directory NCPU must be set inside $inputdir/config.sh"
5761
exit 1
5862
fi;
5963
if [ -z $WALLTIME ]; then
60-
echo "Script directory WALLTIME must be set inside $outdir/config.sh"
64+
echo "Script directory WALLTIME must be set inside $inputdir/config.sh"
6165
exit 1
6266
fi;
6367
if [ -z $MEM ]; then
64-
echo "Script directory MEM must be set inside $outdir/config.sh"
68+
echo "Script directory MEM must be set inside $inputdir/config.sh"
6569
exit 1
6670
fi;
6771

72+
## set the output directory
73+
outdir=$DA_WORKDIR/$exp
74+
75+
echo "writing post-job.$exp."
76+
6877
## write post-job.exp file for HPC
6978
cat <<EOF > post-job.$exp
7079
#!/bin/bash
7180
#PBS -l walltime=${WALLTIME}
7281
#PBS -l select=${NNODE}:ncpus=${NCPU}:mem=${MEM}
73-
module load intel/2024a netCDF/4.9.2-iimpi-2023a netCDF-Fortran/4.6.1-iimpi-2023a NCO/5.2.9-foss-2024a GSL/2.8-GCC-13.3.0
82+
module load NCO/5.2.9-foss-2024a GSL/2.8-GCC-13.3.0
7483
$DA_TOOLSDIR/gather_outputs.sh $outdir
7584
EOF
7685

7786
## submit post-job.exp file to queue
7887
qsub post-job.$exp
7988

8089
echo "post-job.$exp submitted."
81-
82-
popd

0 commit comments

Comments
 (0)