-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob_cpu.sh
32 lines (27 loc) · 894 Bytes
/
job_cpu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
#SBATCH --job-name=out_heat
#SBATCH --output=%x.o%j
#SBATCH --time=00:00:30
#SBATCH --ntasks=4
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --cpus-per-task=1
#SBATCH --partition=cpu_short # (see available partitions)
# To clean and to load the same modules at the compilation phases
module purge
module load gcc/11.2.0/gcc-4.8.5 hdf5/1.10.7/gcc-11.2.0-openmpi openmpi/4.1.1/gcc-11.2.0 cmake/3.21.4/gcc-11.2.0
. path_to_pdi_install/share/pdi/env.bash
# echo of commands
set -x
# To compute in the submission directory
cd ${SLURM_SUBMIT_DIR}
# number of OpenMP threads
export OMP_NUM_THREADS=${SLURM_CPUS_PER_TASK}
# Binding OpenMP Threads of each MPI process on cores
export OMP_PLACES=cores
export OMP_PROC_BIND=spread
export OMP_PLACES=threads
# execution
# with 'ntasks' MPI processes
# with 'cpus-per-task' OpenMP threads per MPI process
pdirun srun ./my_app