Skip to content

Commit 7acf743

Browse files
committed
add frontier batch script
1 parent 881b010 commit 7acf743

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash --login
2+
#SBATCH -A ast236
3+
#SBATCH -J dtypefront_frontier
4+
#SBATCH -o %x-%j.out
5+
#SBATCH -e %x-%j.err
6+
#SBATCH -t 00:30:00
7+
#SBATCH -p batch
8+
#SBATCH -N 1
9+
#SBATCH --ntasks=1
10+
#SBATCH --cpus-per-task=7
11+
#SBATCH --gpus-per-task=1
12+
#SBATCH --gpu-bind=closest
13+
14+
set -euo pipefail
15+
16+
ROOT_DIR="${SLURM_SUBMIT_DIR:-$(pwd)}"
17+
INPUT_FILE="${ROOT_DIR}/inputs/DTypeFront.toml"
18+
LOG_DIR="${ROOT_DIR}/logs/dtypefront-frontier-${SLURM_JOB_ID:-manual}"
19+
ROS_BUILD_DIR="${ROOT_DIR}/build/slurm-dtypefront-frontier-rosenbrock"
20+
VODE_BUILD_DIR="${ROOT_DIR}/build/slurm-dtypefront-frontier-vode"
21+
BUILD_JOBS="${SLURM_CPUS_PER_TASK:-7}"
22+
23+
. "${ROOT_DIR}/scripts/hpc_profiles/frontier.profile"
24+
25+
GPU_ARCH="${AMREX_AMD_ARCH:-gfx90a}"
26+
27+
mkdir -p "${LOG_DIR}"
28+
29+
run_case() {
30+
local exe="$1"
31+
local tag="$2"
32+
shift 2
33+
34+
echo "=== $(date -Is) ${tag} ==="
35+
echo "ROCR_VISIBLE_DEVICES=${ROCR_VISIBLE_DEVICES:-unset}"
36+
echo "HIP_VISIBLE_DEVICES=${HIP_VISIBLE_DEVICES:-unset}"
37+
/usr/bin/time -p srun -N 1 -n 1 --gpus-per-task=1 --gpu-bind=closest "${exe}" "${INPUT_FILE}" "$@" \
38+
> "${LOG_DIR}/${tag}.log" 2>&1
39+
}
40+
41+
configure_build() {
42+
local build_dir="$1"
43+
local integrator="$2"
44+
45+
cmake -S "${ROOT_DIR}" -B "${build_dir}" \
46+
-DCMAKE_BUILD_TYPE=Release \
47+
-DDTypeFront_INTEGRATOR="${integrator}" \
48+
-DAMReX_GPU_BACKEND=HIP \
49+
-DAMReX_AMD_ARCH="${GPU_ARCH}" \
50+
-DAMReX_SPACEDIM=3
51+
cmake --build "${build_dir}" --target DTypeFront -j "${BUILD_JOBS}"
52+
}
53+
54+
echo "Running on ${HOSTNAME}"
55+
echo "Submit dir: ${ROOT_DIR}"
56+
echo "Log dir: ${LOG_DIR}"
57+
echo "Build jobs: ${BUILD_JOBS}"
58+
echo "AMReX AMD arch: ${GPU_ARCH}"
59+
60+
configure_build "${ROS_BUILD_DIR}" Rosenbrock
61+
run_case "${ROS_BUILD_DIR}/src/problems/DTypeFront/DTypeFront" ros2s integrator.rosenbrock_tableau=3
62+
run_case "${ROS_BUILD_DIR}/src/problems/DTypeFront/DTypeFront" rodas3p integrator.rosenbrock_tableau=2
63+
run_case "${ROS_BUILD_DIR}/src/problems/DTypeFront/DTypeFront" rodas4p integrator.rosenbrock_tableau=1
64+
run_case "${ROS_BUILD_DIR}/src/problems/DTypeFront/DTypeFront" rodas5p integrator.rosenbrock_tableau=0
65+
66+
configure_build "${VODE_BUILD_DIR}" VODE
67+
run_case "${VODE_BUILD_DIR}/src/problems/DTypeFront/DTypeFront" vode
68+
69+
echo "Done."

0 commit comments

Comments
 (0)