-
Notifications
You must be signed in to change notification settings - Fork 0
/
exp.sh
29 lines (23 loc) · 895 Bytes
/
exp.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
#!/bin/bash
## job submission script for different experiments
#SBATCH --job-name=test
#SBATCH --time=00:10:00
#SBATCH --account=nstaff
#SBATCH --constraint=gpu
#SBATCH --qos=debug
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=4
#SBATCH --gpus-per-node=4
#SBATCH --gpu-bind=none
#SBATCH --cpus-per-task=32
export MPICH_OFI_NIC_POLICY=GPU
export SLURM_CPU_BIND=cores
echo "Fortran allreduce test" > mpi.log
### for cuda test ###
#module load PrgEnv-nvidia
#ftn -o cuda_gpu_allreduce.x -Mcuda cuda_gpu_allreduce.f90
#srun -N 1 -n 2 bash -c "export CUDA_VISIBLE_DEVICES=\$((3-SLURM_LOCALID)); ./cuda_gpu_allreduce.x" >> mpi.log
### for cuda test with openmpi ###
module load PrgEnv-nvidia nvidia/23.1 openmpi
mpifort -Mcuda -o cuda_gpu_allreduce.x cuda_gpu_allreduce.f90
srun --mpi=pmix -N 1 -n 2 bash -c "export CUDA_VISIBLE_DEVICES=\$((3-SLURM_LOCALID)); ./cuda_gpu_allreduce.x" >> mpi.log