Skip to content

Commit 1926064

Browse files
ax3ldpgrote
authored andcommitted
HPC: Rename SRUN_CPUS_PER_TASK to SLURM_... (BLAST-WarpX#5340)
This environment variable was used for Perlmutter when `--cpus-per-task=N` did not work yet. It was copied around to other templates. These days, `--cpus-per-task` should work and the name of the env variable was renamed in SLURM to `SLURM_CPUS_PER_TASK`. https://slurm.schedmd.com/sbatch.html#OPT_SLURM_CPUS_PER_TASK Thanks to NERSC engineers for reporting this update!
1 parent 217ada9 commit 1926064

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Tools/machines/greatlakes-umich/greatlakes_v100.sbatch

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ INPUTS=inputs
2626
# per node are 2x 2.4 GHz Intel Xeon Gold 6148
2727
# note: the system seems to only expose cores (20 per socket),
2828
# not hyperthreads (40 per socket)
29-
export SRUN_CPUS_PER_TASK=20
30-
export OMP_NUM_THREADS=${SRUN_CPUS_PER_TASK}
29+
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
3130

3231
# GPU-aware MPI optimizations
3332
GPU_AWARE_MPI="amrex.use_gpu_aware_mpi=1"

Tools/machines/karolina-it4i/karolina_gpu.sbatch

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
#SBATCH -o stdout_%j
2626
#SBATCH -e stderr_%j
2727

28-
# OpenMP threads per MPI rank
29-
export OMP_NUM_THREADS=16
30-
export SRUN_CPUS_PER_TASK=16
31-
3228
# set user rights to u=rwx;g=r-x;o=---
3329
umask 0027
3430

31+
# OpenMP threads per MPI rank
32+
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
33+
3534
# executable & inputs file or python interpreter & PICMI script here
3635
EXE=./warpx.rz
3736
INPUTS=./inputs_rz

Tools/machines/lonestar6-tacc/lonestar6_a100.sbatch

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#SBATCH -q regular
1515
#SBATCH -C gpu
1616
#SBATCH --exclusive
17+
#SBATCH --cpus-per-task=32
1718
#SBATCH --gpu-bind=none
1819
#SBATCH --gpus-per-node=4
1920
#SBATCH -o WarpX.o%j
@@ -27,7 +28,7 @@ INPUTS=inputs_small
2728
export MPICH_OFI_NIC_POLICY=GPU
2829

2930
# threads for OpenMP and threaded compressors per MPI rank
30-
export SRUN_CPUS_PER_TASK=32
31+
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
3132

3233
# depends on https://github.com/ECP-WarpX/WarpX/issues/2009
3334
#GPU_AWARE_MPI="amrex.the_arena_is_managed=0 amrex.use_gpu_aware_mpi=1"

Tools/machines/perlmutter-nersc/perlmutter_cpu.sbatch

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#SBATCH -A <proj>
1414
#SBATCH -q regular
1515
#SBATCH -C cpu
16+
# 8 cores per chiplet, 2x SMP
17+
#SBATCH --cpus-per-task=16
1618
#SBATCH --ntasks-per-node=16
1719
#SBATCH --exclusive
1820
#SBATCH -o WarpX.o%j
@@ -30,10 +32,9 @@ INPUTS=inputs_small
3032
# This will be our MPI rank assignment (2x8 is 16 ranks/node).
3133

3234
# threads for OpenMP and threaded compressors per MPI rank
33-
export SRUN_CPUS_PER_TASK=16 # 8 cores per chiplet, 2x SMP
3435
export OMP_PLACES=threads
3536
export OMP_PROC_BIND=spread
36-
export OMP_NUM_THREADS=${SRUN_CPUS_PER_TASK}
37+
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
3738

3839
srun --cpu-bind=cores \
3940
${EXE} ${INPUTS} \

Tools/machines/perlmutter-nersc/perlmutter_gpu.sbatch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# A100 80GB (256 nodes)
1818
#S BATCH -C gpu&hbm80g
1919
#SBATCH --exclusive
20+
#SBATCH --cpus-per-task=16
2021
# ideally single:1, but NERSC cgroups issue
2122
#SBATCH --gpu-bind=none
2223
#SBATCH --ntasks-per-node=4
@@ -33,8 +34,7 @@ export MPICH_OFI_NIC_POLICY=GPU
3334

3435
# threads for OpenMP and threaded compressors per MPI rank
3536
# note: 16 avoids hyperthreading (32 virtual cores, 16 physical)
36-
export SRUN_CPUS_PER_TASK=16
37-
export OMP_NUM_THREADS=${SRUN_CPUS_PER_TASK}
37+
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
3838

3939
# GPU-aware MPI optimizations
4040
GPU_AWARE_MPI="amrex.use_gpu_aware_mpi=1"

Tools/machines/tioga-llnl/tioga_mi300a.sbatch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#SBATCH -J WarpX
1313
#S BATCH -A <proj> # project name not needed yet
1414
#SBATCH -p mi300a
15+
#SBATCH --cpus-per-task=16
1516
#SBATCH --gpu-bind=none
1617
#SBATCH --ntasks-per-node=4
1718
#SBATCH --gpus-per-node=4
@@ -27,8 +28,7 @@ export MPICH_OFI_NIC_POLICY=GPU
2728

2829
# threads for OpenMP and threaded compressors per MPI rank
2930
# note: 16 avoids hyperthreading (32 virtual cores, 16 physical)
30-
export SRUN_CPUS_PER_TASK=16
31-
export OMP_NUM_THREADS=${SRUN_CPUS_PER_TASK}
31+
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
3232

3333
# GPU-aware MPI optimizations
3434
GPU_AWARE_MPI="amrex.use_gpu_aware_mpi=1"

0 commit comments

Comments
 (0)