Skip to content

Commit 70ef6c6

Browse files
committed
Minor reorganization of hpc_execute script.
1 parent 2608fbe commit 70ef6c6

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

tools/hpc_execute.sh

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,21 @@ if [ -f config.sh ]; then
4040
fi
4141

4242
## set the output directory
43-
outdir=$EPHEMERAL/$exp
43+
outdir=$DA_WORKDIR/$exp
4444

4545
echo "writing job.$exp."
4646

4747
## write new job.exp file for HPC
48-
echo "#PBS -l walltime=${WALLTIME}" > job.$exp
49-
echo "#PBS -l select=${NNODE}:ncpus=${NCPU}:mem=${MEM}" >> job.$exp
50-
51-
## load modules required for the execution
52-
echo "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" >> job.$exp
53-
54-
## copy files to execution and output directory
55-
echo "mkdir -p $outdir" >> job.$exp
56-
echo "cp -r $inputdir/* $outdir" >> job.$exp
57-
58-
## go to execution and output directory
59-
echo "pushd $outdir" >> job.$exp
60-
61-
## execute program with mpi
62-
echo "mpiexec -n $(( $NCPU * $NNODE )) $DA_BUILD $outdir/namoptions.$exp > $outdir/output.$exp 2>&1" >> job.$exp
63-
64-
## gather output files from cores in a single file
65-
echo "$DA_TOOLSDIR/gather_outputs.sh $outdir " >> job.$exp
48+
cat <<EOF > job.$exp
49+
#PBS -l walltime=${WALLTIME}
50+
#PBS -l select=${NNODE}:ncpus=${NCPU}:mem=${MEM}
51+
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
52+
mkdir -p $outdir
53+
cp -r $inputdir/* $outdir
54+
pushd $outdir
55+
mpiexec -n $(( $NCPU * $NNODE )) $DA_BUILD $outdir/namoptions.$exp > $outdir/output.$exp 2>&1
56+
$DA_TOOLSDIR/gather_outputs.sh $outdir
57+
EOF
6658

6759
## submit job.exp file to queue
6860
qsub job.$exp

0 commit comments

Comments
 (0)