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

Move files to master, add new standard files (README, compile, copy)

parent 42be16a6
No related branches found
No related tags found
No related merge requests found
# MSA GPU Hello World
Building up on the previous exercise, in this exercise the GPU-side `printf()` function is used to print from a kernel a "hello world!", where the second word is received directly from the CPU process.
TODOs are included in `hello-world.c` and `hello-world.cu`, indicating how to implement the `MPI_Send()` / `MPI_Recv()` structure.
Once the function calls are implemented,e xecute the following on JUWELS Booster
```bash
bash compile.sh
```
(Which is equivalent to calling the `make` for the GPU part of the application, including the right modules.)
Also, execute the following on JUWELS Cluster
```bash
bash compile.sh
sbatch job_msa_juwels.sh
```
(Which compiles the CPU part of the application and then submits a heterogeneous job to the batch queue.)
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 for $SYSTEMNAME"
ml GCC CUDA ParaStationMPI
make hello.gpu.out
elif [[ "$SYSTEMNAME" == "juwels" ]]; then
echo "Building for $SYSTEMNAME"
ml GCC ParaStationMPI
make hello.cpu.out
else
echo "The system $SYSTEMNAME is not supported!"
echo "Please load manually load environment modules for compiler and MPI and compile with the Makefile"
fi
\ No newline at end of file
#!/usr/bin/make -f
TASKDIR = ../tasks
SOLUTIONDIR = ../solutions
PROCESSFILES = hello-world.c hello-world.cu
COPYFILES = Makefile README.md job_msa_juwels.sh compile.sh
TASKPROCCESFILES = $(addprefix $(TASKDIR)/,$(PROCESSFILES))
TASKCOPYFILES = $(addprefix $(TASKDIR)/,$(COPYFILES))
SOLUTIONPROCCESFILES = $(addprefix $(SOLUTIONDIR)/,$(PROCESSFILES))
SOLUTIONCOPYFILES = $(addprefix $(SOLUTIONDIR)/,$(COPYFILES))
.PHONY: all task
all: task
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES}
${TASKPROCCESFILES}: $(PROCESSFILES)
mkdir -p $(TASKDIR)/
cppp -USOLUTION $(notdir $@) $@
${SOLUTIONPROCCESFILES}: $(PROCESSFILES)
mkdir -p $(SOLUTIONDIR)/
cppp -DSOLUTION $(notdir $@) $@
${TASKCOPYFILES}: $(COPYFILES)
mkdir -p $(TASKDIR)/
cp $(notdir $@) $@
${SOLUTIONCOPYFILES}: $(COPYFILES)
mkdir -p $(SOLUTIONDIR)/
cp $(notdir $@) $@
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment