Skip to content
Snippets Groups Projects
Commit ecd80d44 authored by Andreas Herten's avatar Andreas Herten
Browse files

Minor tweaks and renamings

And also use the structure from Task 1
parent f5974133
No related branches found
No related tags found
1 merge request!3add 02 MSA Ping-Pong
CUCOMP = nvcc
CUFLAGS = -arch=sm_80
INCLUDES = -I$(EBROOTOPENMPI)/include
LIBRARIES = -L$(EBROOTOPENMPI)/lib -lmpi
ifdef EBROOTOPENMPI
MPI_HOME+=$(EBROOTOPENMPI)
endif
ifdef EBROOTPSMPI
MPI_HOME+=$(EBROOTPSMPI)
endif
all: pp_cpu.out pp_cuda_aware.out
INCLUDES = -I$(MPI_HOME)/include
LIBRARIES = -L$(MPI_HOME)/lib -lmpi
pp_cpu.out: ping-pong.c
mpicc ping-pong.c -o pp_cpu.out
all: ping-pong.cpu.out ping-pong.gpu.out
pp_cuda_aware.out: ping-pong.o
$(CUCOMP) $(CUFLAGS) $(LIBRARIES) ping-pong.o -o pp_cuda_aware.out
ping-pong.cpu.out: ping-pong.c
mpicc $< -o $@
ping-pong.o: ping-pong.cu
$(CUCOMP) $(CUFLAGS) $(INCLUDES) -c ping-pong.cu
ping-pong.gpu.out: ping-pong.gpu.o
$(CUCOMP) $(CUFLAGS) $(LIBRARIES) $< -o $@
ping-pong.gpu.o: ping-pong.cu
$(CUCOMP) $(CUFLAGS) $(INCLUDES) -c $< -o $@
.PHONY: clean
clean:
rm -f pp_cpu.out pp_cuda_aware.out *.o
rm -f ping-pong.cpu.out ping-pong.gpu.out *.o
# MSA CPU-GPU Ping Pong
We extend the simple previous example to now use a heterogeneous job on a CPU and GPU with dedicated partitions. The two job components of the heterogeneous job send _ping pong_ messages to each other of increasing size.
Execute the following on JUWELS Booster
```bash
bash compile.sh
```
Execute the following on JUWELS Cluster
```bash
bash compile.sh
sbatch job_msa_juwels.sh
```
Monitor your job with `squeue --me`. When it ran through successfully, have a look at the output in `slurm-out.N`, with `N` being your job number.
\ No newline at end of file
if [[ "$SYSTEMNAME" == "juwelsbooster" ]]; then
echo "Building GPU-aware version for $SYSTEMNAME"
ml GCC ParaStationMPI MPI-settings/CUDA
make ping-pong.gpu.out
elif [[ "$SYSTEMNAME" == "juwels" ]]; then
echo "Building CPU version for $SYSTEMNAME"
ml GCC ParaStationMPI
make ping-pong.cpu.out
else
echo "The system $SYSTEMNAME is not supported!"
fi
\ No newline at end of file
ml GCC OpenMPI MPI-settings/CUDA
make all
#!/bin/bash -x
#SBATCH --account=exalab
#SBATCH --account=training2317
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --output=slurm-out.%j
......@@ -11,4 +11,4 @@
#SBATCH --ntasks-per-node=1
#SBATCH --partition=develbooster
srun xenv -P -L GCC -L OpenMPI -L MPI-settings/CUDA ./pp_cpu.out : xenv -P -L GCC -L OpenMPI -L MPI-settings/CUDA ./pp_cuda_aware.out
srun xenv -P -L GCC -L ParaStationMPI ./ping-pong.cpu.out : xenv -P -L GCC -L ParaStationMPI -L MPI-settings/CUDA ./ping-pong.gpu.out
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment