-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creates NCSA Delta modules and mako templates for batch jobs (#338)
- Loading branch information
1 parent
43f1865
commit 2d0b820
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()} |