|
| 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 --job-name="${name}" |
| 9 | +#SBATCH --output="${name}.out" |
| 10 | +#SBATCH --time=${walltime} |
| 11 | +#SBATCH --cpus-per-task=7 |
| 12 | +% if gpu: |
| 13 | +#SBATCH --gpus-per-task=1 |
| 14 | +#SBATCH --gpu-bind=closest |
| 15 | +% endif |
| 16 | +% if account: |
| 17 | +#SBATCH --account=${account} |
| 18 | +% endif |
| 19 | +% if partition: |
| 20 | +#SBATCH --partition=${partition} |
| 21 | +% endif |
| 22 | +% if quality_of_service: |
| 23 | +#SBATCH --qos=${quality_of_service} |
| 24 | +% endif |
| 25 | +% if email: |
| 26 | +#SBATCH --mail-user=${email} |
| 27 | +#SBATCH --mail-type="BEGIN, END, FAIL" |
| 28 | +% endif |
| 29 | +% endif |
| 30 | + |
| 31 | +${helpers.template_prologue()} |
| 32 | + |
| 33 | +ok ":) Loading modules:\n" |
| 34 | +cd "${MFC_ROOT_DIR}" |
| 35 | +% if engine == 'batch': |
| 36 | +. ./mfc.sh load -c f -m ${'g' if gpu else 'c'} |
| 37 | +% endif |
| 38 | +cd - > /dev/null |
| 39 | +echo |
| 40 | + |
| 41 | +export MPICH_GPU_SUPPORT_ENABLED=1 |
| 42 | + |
| 43 | +% for target in targets: |
| 44 | + ${helpers.run_prologue(target)} |
| 45 | + |
| 46 | + % if not mpi: |
| 47 | + (set -x; \ |
| 48 | + % target == 'simulation': |
| 49 | + ${profiler} \ |
| 50 | + % endif |
| 51 | + "${target.get_install_binpath(case)}") |
| 52 | + % else: |
| 53 | + (set -x; srun \ |
| 54 | + % if engine == 'interactive': |
| 55 | + --nodes ${nodes} --ntasks-per-node ${tasks_per_node} \ |
| 56 | + --cpus-per-task 7 \ |
| 57 | + % if gpu: |
| 58 | + --gpus-per-task 1 --gpu-bind closest \ |
| 59 | + % endif |
| 60 | + % endif |
| 61 | + % if target == 'simulation': |
| 62 | + ${profiler} \ |
| 63 | + % endif |
| 64 | + "${target.get_install_binpath(case)}") |
| 65 | + % endif |
| 66 | + |
| 67 | + ${helpers.run_epilogue(target)} |
| 68 | + |
| 69 | + echo |
| 70 | +% endfor |
| 71 | + |
| 72 | +${helpers.template_epilogue()} |
0 commit comments