Skip to content

Commit

Permalink
Creates NCSA Delta modules and mako templates for batch jobs (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbryngelson authored Feb 14, 2024
1 parent 43f1865 commit 2d0b820
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
5 changes: 5 additions & 0 deletions toolchain/modules
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ c-all cmake/3.23.2 cray-fftw/3.3.10.2 hdf5/1.12.1 cray-python/3.9.13.1
c-all ninja/1.10.2 cray-mpich/8.1.23
c-cpu
c-gpu rocm/5.1.0 craype-accel-amd-gfx90a

d NCSA Delta
d-all python/3.11.6 openmpi
d-cpu gcc/11.4.0
d-gpu nvhpc/22.11
54 changes: 54 additions & 0 deletions toolchain/templates/delta.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/env bash

<%namespace name="helpers" file="helpers.mako"/>

% if engine == 'batch':
#SBATCH --nodes=${nodes}
#SBATCH --ntasks-per-node=${tasks_per_node}
#SBATCH --cpus-per-task=1
#SBATCH --job-name="${name}"
#SBATCH --time=${walltime}
% if partition:
#SBATCH --partition=${partition}
% endif
% if account:
#SBATCH --account="${account}"
% endif
% if gpu:
#SBATCH --gpus-per-node=${tasks_per_node}
% endif
#SBATCH --output="${name}.out"
#SBATCH --error="${name}.err"
#SBATCH --export=ALL
% if email:
#SBATCH --mail-user=${email}
#SBATCH --mail-type="BEGIN, END, FAIL"
% endif
% endif

${helpers.template_prologue()}

ok ":) Loading modules:\n"
cd "${MFC_ROOTDIR}"
. ./mfc.sh load -c d -m ${'g' if gpu else 'c'}
cd - > /dev/null
echo

% for target in targets:
${helpers.run_prologue(target)}

% if not mpi:
${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}"
% else:
${' '.join([f"'{x}'" for x in profiler ])} \
mpirun -np {nodes*tasks_per_node} \
${' '.join([f"'{x}'" for x in ARG('--') ])} \
"${target.get_install_binpath()}"
% endif

${helpers.run_epilogue(target)}

echo
% endfor

${helpers.template_epilogue()}

0 comments on commit 2d0b820

Please sign in to comment.