Skip to content

Commit

Permalink
Merge pull request #35 from FZJ-JSC/mh/sc24_fixes
Browse files Browse the repository at this point in the history
Makefiles: add OUTPUT_NAME and THIS_TASK, minor updates
  • Loading branch information
AndiH authored Nov 15, 2024
2 parents 58d7ddd + 1b4d29a commit 9abe716
Show file tree
Hide file tree
Showing 31 changed files with 165 additions and 86 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 03H-@@TASKSOL@@
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 4
NVCC=nvcc
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
Expand Down Expand Up @@ -33,10 +35,10 @@ clean:
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
17 changes: 12 additions & 5 deletions 03-H_Multi_GPU_Parallelization/.master/copy.mk
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/make -f
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021-2024, NVIDIA CORPORATION. All rights reserved.
TASKDIR = ../tasks/
SOLUTIONDIR = ../solutions/
OPT_SOLUTIONDIR = ../solutions/advanced
OPT_SOLUTIONDIR = ../solutions/advanced/

IYPNB_TEMPLATE = ../../.template.json

PROCESSFILES = jacobi.cu
COPYFILES = Makefile Instructions.ipynb Instructions.md
COPYFILES = Instructions.ipynb Instructions.md


TASKPROCCESFILES = $(addprefix $(TASKDIR)/,$(PROCESSFILES))
Expand All @@ -16,12 +16,19 @@ SOLUTIONPROCCESFILES = $(addprefix $(SOLUTIONDIR)/,$(PROCESSFILES))
OPT_SOLUTIONPROCCESFILES = $(addprefix $(OPT_SOLUTIONDIR)/,$(PROCESSFILES))
SOLUTIONCOPYFILES = $(addprefix $(SOLUTIONDIR)/,$(COPYFILES))
OPT_SOLUTIONCOPYFILES = $(addprefix $(OPT_SOLUTIONDIR)/,$(COPYFILES))
MAKEFILES = $(addsuffix /Makefile,$(TASKDIR) $(SOLUTIONDIR) $(OPT_SOLUTIONDIR))


.PHONY: all task
all: task
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES} ${OPT_SOLUTIONPROCCESFILES} ${OPT_SOLUTIONCOPYFILES}

task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES} ${OPT_SOLUTIONPROCCESFILES} ${OPT_SOLUTIONCOPYFILES} ${MAKEFILES}

$(TASKDIR)/Makefile: Makefile.in
sed -e 's/@@TASKSOL@@/task/' $< > $@
$(SOLUTIONDIR)/Makefile: Makefile.in
sed -e 's/@@TASKSOL@@/sol/' $< > $@
$(OPT_SOLUTIONDIR)/Makefile: Makefile.in
sed -e 's/@@TASKSOL@@/solopt/' $< > $@

${TASKPROCCESFILES}: $(PROCESSFILES)
mkdir -p $(TASKDIR)/
Expand Down
8 changes: 5 additions & 3 deletions 03-H_Multi_GPU_Parallelization/solutions/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 03H-sol
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 4
NVCC=nvcc
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
Expand Down Expand Up @@ -33,10 +35,10 @@ clean:
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
8 changes: 5 additions & 3 deletions 03-H_Multi_GPU_Parallelization/solutions/advanced/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 03H-solopt
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 4
NVCC=nvcc
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
Expand Down Expand Up @@ -33,10 +35,10 @@ clean:
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
8 changes: 5 additions & 3 deletions 03-H_Multi_GPU_Parallelization/tasks/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 03H-task
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 4
NVCC=nvcc
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
Expand Down Expand Up @@ -33,10 +35,10 @@ clean:
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
" target (`make profile`)\n",
"3. Open the recorded profile in the GUI\n",
" - Either: Install Nsight Systems locally, and transfer the\n",
" .qdrep/.nsys-rep file\n",
" .nsys-rep file.\n",
" - *Note*: Right-click in file-browser, choose “Download” from\n",
" context menu\n",
" - Or: By running Xpra in your browser: In Jupyter, select “File \\>\n",
" New Launcher” and “Xpra Desktop”, which will open in a new tab.\n",
" Don’t forget to source the environment in your `xterm`.\n",
Expand Down Expand Up @@ -84,7 +86,7 @@
"- Destroy the additional cuda streams and events before ending the\n",
" application"
],
"id": "7563d35d-a670-47af-acef-44cee0450930"
"id": "21f77d33-b675-4746-9241-24837f172b29"
}
],
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Use the Nsight System profiler to profile the starting point version non-Overlap
1. Start by compiling and running the application with `make run`
1. Record an Nsight Systems profile, using the appropriate Makefile target (`make profile`)
1. Open the recorded profile in the GUI
- Either: Install Nsight Systems locally, and transfer the .qdrep/.nsys-rep file
- Either: Install Nsight Systems locally, and transfer the .nsys-rep file.
- *Note*: Right-click in file-browser, choose "Download" from context menu
- Or: By running Xpra in your browser: In Jupyter, select "File > New Launcher" and "Xpra Desktop", which will open in a new tab. Don't forget to source the environment in your `xterm`.
1. Familiarize yourself with the different rows and the traces they represent.
- See if you can correlate a CUDA API kernel launch call and the resulting kernel execution on the device
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 06H-@@TASKSOL@@
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 1
NVCC=nvcc
MPICXX=mpicxx
Expand Down Expand Up @@ -34,10 +36,10 @@ clean:
rm -f jacobi jacobi_kernels.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
11 changes: 8 additions & 3 deletions 06-H_Overlap_Communication_and_Computation_MPI/.master/copy.mk
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#!/usr/bin/make -f
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021-2024, NVIDIA CORPORATION. All rights reserved.
TASKDIR = ../tasks/
SOLUTIONDIR = ../solutions/

IYPNB_TEMPLATE = ../../.template.json

PROCESSFILES = jacobi.cpp
COPYFILES = Makefile Instructions.ipynb Instructions.md jacobi_kernels.cu
COPYFILES = Instructions.ipynb Instructions.md jacobi_kernels.cu


TASKPROCCESFILES = $(addprefix $(TASKDIR)/,$(PROCESSFILES))
TASKCOPYFILES = $(addprefix $(TASKDIR)/,$(COPYFILES))
SOLUTIONPROCCESFILES = $(addprefix $(SOLUTIONDIR)/,$(PROCESSFILES))
SOLUTIONCOPYFILES = $(addprefix $(SOLUTIONDIR)/,$(COPYFILES))
MAKEFILES = $(addsuffix /Makefile,$(TASKDIR) $(SOLUTIONDIR))

.PHONY: all task clean
all: task
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES}
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES} ${MAKEFILES}

$(TASKDIR)/Makefile: Makefile.in
sed -e 's/@@TASKSOL@@/task/' $< > $@
$(SOLUTIONDIR)/Makefile: Makefile.in
sed -e 's/@@TASKSOL@@/sol/' $< > $@

${TASKPROCCESFILES}: $(PROCESSFILES)
mkdir -p $(TASKDIR)/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
" target (`make profile`)\n",
"3. Open the recorded profile in the GUI\n",
" - Either: Install Nsight Systems locally, and transfer the\n",
" .qdrep/.nsys-rep file\n",
" .nsys-rep file.\n",
" - *Note*: Right-click in file-browser, choose “Download” from\n",
" context menu\n",
" - Or: By running Xpra in your browser: In Jupyter, select “File \\>\n",
" New Launcher” and “Xpra Desktop”, which will open in a new tab.\n",
" Don’t forget to source the environment in your `xterm`.\n",
Expand Down Expand Up @@ -84,7 +86,7 @@
"- Destroy the additional cuda streams and events before ending the\n",
" application"
],
"id": "7563d35d-a670-47af-acef-44cee0450930"
"id": "21f77d33-b675-4746-9241-24837f172b29"
}
],
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Use the Nsight System profiler to profile the starting point version non-Overlap
1. Start by compiling and running the application with `make run`
1. Record an Nsight Systems profile, using the appropriate Makefile target (`make profile`)
1. Open the recorded profile in the GUI
- Either: Install Nsight Systems locally, and transfer the .qdrep/.nsys-rep file
- Either: Install Nsight Systems locally, and transfer the .nsys-rep file.
- *Note*: Right-click in file-browser, choose "Download" from context menu
- Or: By running Xpra in your browser: In Jupyter, select "File > New Launcher" and "Xpra Desktop", which will open in a new tab. Don't forget to source the environment in your `xterm`.
1. Familiarize yourself with the different rows and the traces they represent.
- See if you can correlate a CUDA API kernel launch call and the resulting kernel execution on the device
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 06H-sol
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 1
NVCC=nvcc
MPICXX=mpicxx
Expand Down Expand Up @@ -34,10 +36,10 @@ clean:
rm -f jacobi jacobi_kernels.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
" target (`make profile`)\n",
"3. Open the recorded profile in the GUI\n",
" - Either: Install Nsight Systems locally, and transfer the\n",
" .qdrep/.nsys-rep file\n",
" .nsys-rep file.\n",
" - *Note*: Right-click in file-browser, choose “Download” from\n",
" context menu\n",
" - Or: By running Xpra in your browser: In Jupyter, select “File \\>\n",
" New Launcher” and “Xpra Desktop”, which will open in a new tab.\n",
" Don’t forget to source the environment in your `xterm`.\n",
Expand Down Expand Up @@ -84,7 +86,7 @@
"- Destroy the additional cuda streams and events before ending the\n",
" application"
],
"id": "7563d35d-a670-47af-acef-44cee0450930"
"id": "21f77d33-b675-4746-9241-24837f172b29"
}
],
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Use the Nsight System profiler to profile the starting point version non-Overlap
1. Start by compiling and running the application with `make run`
1. Record an Nsight Systems profile, using the appropriate Makefile target (`make profile`)
1. Open the recorded profile in the GUI
- Either: Install Nsight Systems locally, and transfer the .qdrep/.nsys-rep file
- Either: Install Nsight Systems locally, and transfer the .nsys-rep file.
- *Note*: Right-click in file-browser, choose "Download" from context menu
- Or: By running Xpra in your browser: In Jupyter, select "File > New Launcher" and "Xpra Desktop", which will open in a new tab. Don't forget to source the environment in your `xterm`.
1. Familiarize yourself with the different rows and the traces they represent.
- See if you can correlate a CUDA API kernel launch call and the resulting kernel execution on the device
Expand Down
8 changes: 5 additions & 3 deletions 06-H_Overlap_Communication_and_Computation_MPI/tasks/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 06H-task
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 1
NVCC=nvcc
MPICXX=mpicxx
Expand Down Expand Up @@ -34,10 +36,10 @@ clean:
rm -f jacobi jacobi_kernels.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2021,2022, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021-2024, NVIDIA CORPORATION. All rights reserved.
THIS_TASK := 08H-NCCL-@@TASKSOL@@
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 1
NVCC=nvcc
JSC_SUBMIT_CMD ?= srun --cpu-bind=socket --gres=gpu:4 --ntasks-per-node 4
Expand Down Expand Up @@ -35,10 +37,10 @@ clean:
rm -f jacobi jacobi_kernels.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx --cuda-graph-trace=node -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
$(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
11 changes: 8 additions & 3 deletions 08-H_NCCL_NVSHMEM/.master/NCCL/copy.mk
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
#!/usr/bin/make -f
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021-2024, NVIDIA CORPORATION. All rights reserved.
TASKDIR = ../../tasks/NCCL
SOLUTIONDIR = ../../solutions/NCCL

IYPNB_TEMPLATE = ../../../.template.json

PROCESSFILES = jacobi.cpp
COPYFILES = Makefile jacobi_kernels.cu Instructions.ipynb Instructions.md
COPYFILES = jacobi_kernels.cu Instructions.ipynb Instructions.md


TASKPROCCESFILES = $(addprefix $(TASKDIR)/,$(PROCESSFILES))
TASKCOPYFILES = $(addprefix $(TASKDIR)/,$(COPYFILES))
SOLUTIONPROCCESFILES = $(addprefix $(SOLUTIONDIR)/,$(PROCESSFILES))
SOLUTIONCOPYFILES = $(addprefix $(SOLUTIONDIR)/,$(COPYFILES))
MAKEFILES = $(addsuffix /Makefile,$(TASKDIR) $(SOLUTIONDIR))

.PHONY: all task
all: task
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES}
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES} ${MAKEFILES}

$(TASKDIR)/Makefile: Makefile.in
sed -e 's/@@TASKSOL@@/task/' $< > $@
$(SOLUTIONDIR)/Makefile: Makefile.in
sed -e 's/@@TASKSOL@@/sol/' $< > $@

${TASKPROCCESFILES}: $(PROCESSFILES)
mkdir -p $(TASKDIR)/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2017-2024, All rights reserved.
THIS_TASK := 08H-NVSHMEM-@@TASKSOL@@
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
NP ?= 4
NVCC=nvcc
N_D_C_VMM=1 #Enabled to hide warning and errors only found in NVSHMEM/2.5.0 to be fixed in next release
Expand Down Expand Up @@ -38,10 +40,10 @@ clean:
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log

sanitize: jacobi
CUDA_VISIBLE_DEVICES=$(C_V_D) $(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file jacobi.%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10
CUDA_VISIBLE_DEVICES=$(C_V_D) $(JSC_SUBMIT_CMD) -n $(NP) compute-sanitizer --log-file $(OUTPUT_NAME).%q{SLURM_PROCID}.compute-sanitizer.log ./jacobi -niter 10

run: jacobi
CUDA_VISIBLE_DEVICES=$(C_V_D) $(JSC_SUBMIT_CMD) -n $(NP) ./jacobi

profile: jacobi
CUDA_VISIBLE_DEVICES=$(C_V_D) $(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o jacobi.%q{SLURM_PROCID} ./jacobi -niter 10
CUDA_VISIBLE_DEVICES=$(C_V_D) $(JSC_SUBMIT_CMD) -n $(NP) nsys profile --trace=mpi,cuda,nvtx -o $(OUTPUT_NAME).%q{SLURM_PROCID} ./jacobi -niter 10
Loading

0 comments on commit 9abe716

Please sign in to comment.