Skip to content

Commit 2d0b820

Browse files
authored
Creates NCSA Delta modules and mako templates for batch jobs (#338)
1 parent 43f1865 commit 2d0b820

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

toolchain/modules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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
4646
c-all ninja/1.10.2 cray-mpich/8.1.23
4747
c-cpu
4848
c-gpu rocm/5.1.0 craype-accel-amd-gfx90a
49+
50+
d NCSA Delta
51+
d-all python/3.11.6 openmpi
52+
d-cpu gcc/11.4.0
53+
d-gpu nvhpc/22.11

toolchain/templates/delta.mako

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
3+
<%namespace name="helpers" file="helpers.mako"/>
4+
5+
% if engine == 'batch':
6+
#SBATCH --nodes=${nodes}
7+
#SBATCH --ntasks-per-node=${tasks_per_node}
8+
#SBATCH --cpus-per-task=1
9+
#SBATCH --job-name="${name}"
10+
#SBATCH --time=${walltime}
11+
% if partition:
12+
#SBATCH --partition=${partition}
13+
% endif
14+
% if account:
15+
#SBATCH --account="${account}"
16+
% endif
17+
% if gpu:
18+
#SBATCH --gpus-per-node=${tasks_per_node}
19+
% endif
20+
#SBATCH --output="${name}.out"
21+
#SBATCH --error="${name}.err"
22+
#SBATCH --export=ALL
23+
% if email:
24+
#SBATCH --mail-user=${email}
25+
#SBATCH --mail-type="BEGIN, END, FAIL"
26+
% endif
27+
% endif
28+
29+
${helpers.template_prologue()}
30+
31+
ok ":) Loading modules:\n"
32+
cd "${MFC_ROOTDIR}"
33+
. ./mfc.sh load -c d -m ${'g' if gpu else 'c'}
34+
cd - > /dev/null
35+
echo
36+
37+
% for target in targets:
38+
${helpers.run_prologue(target)}
39+
40+
% if not mpi:
41+
${' '.join([f"'{x}'" for x in profiler ])} "${target.get_install_binpath()}"
42+
% else:
43+
${' '.join([f"'{x}'" for x in profiler ])} \
44+
mpirun -np {nodes*tasks_per_node} \
45+
${' '.join([f"'{x}'" for x in ARG('--') ])} \
46+
"${target.get_install_binpath()}"
47+
% endif
48+
49+
${helpers.run_epilogue(target)}
50+
51+
echo
52+
% endfor
53+
54+
${helpers.template_epilogue()}

0 commit comments

Comments
 (0)