Skip to content

Commit 9abe716

Browse files
authored
Merge pull request #35 from FZJ-JSC/mh/sc24_fixes
Makefiles: add OUTPUT_NAME and THIS_TASK, minor updates
2 parents 58d7ddd + 1b4d29a commit 9abe716

31 files changed

Lines changed: 165 additions & 86 deletions

File tree

03-H_Multi_GPU_Parallelization/.master/Makefile renamed to 03-H_Multi_GPU_Parallelization/.master/Makefile.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
2+
THIS_TASK := 03H-@@TASKSOL@@
3+
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
24
NP ?= 4
35
NVCC=nvcc
46
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
@@ -33,10 +35,10 @@ clean:
3335
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log
3436

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

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

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

03-H_Multi_GPU_Parallelization/.master/copy.mk

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/make -f
2-
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021-2024, NVIDIA CORPORATION. All rights reserved.
33
TASKDIR = ../tasks/
44
SOLUTIONDIR = ../solutions/
5-
OPT_SOLUTIONDIR = ../solutions/advanced
5+
OPT_SOLUTIONDIR = ../solutions/advanced/
66

77
IYPNB_TEMPLATE = ../../.template.json
88

99
PROCESSFILES = jacobi.cu
10-
COPYFILES = Makefile Instructions.ipynb Instructions.md
10+
COPYFILES = Instructions.ipynb Instructions.md
1111

1212

1313
TASKPROCCESFILES = $(addprefix $(TASKDIR)/,$(PROCESSFILES))
@@ -16,12 +16,19 @@ SOLUTIONPROCCESFILES = $(addprefix $(SOLUTIONDIR)/,$(PROCESSFILES))
1616
OPT_SOLUTIONPROCCESFILES = $(addprefix $(OPT_SOLUTIONDIR)/,$(PROCESSFILES))
1717
SOLUTIONCOPYFILES = $(addprefix $(SOLUTIONDIR)/,$(COPYFILES))
1818
OPT_SOLUTIONCOPYFILES = $(addprefix $(OPT_SOLUTIONDIR)/,$(COPYFILES))
19+
MAKEFILES = $(addsuffix /Makefile,$(TASKDIR) $(SOLUTIONDIR) $(OPT_SOLUTIONDIR))
1920

2021

2122
.PHONY: all task
2223
all: task
23-
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES} ${OPT_SOLUTIONPROCCESFILES} ${OPT_SOLUTIONCOPYFILES}
24-
24+
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES} ${OPT_SOLUTIONPROCCESFILES} ${OPT_SOLUTIONCOPYFILES} ${MAKEFILES}
25+
26+
$(TASKDIR)/Makefile: Makefile.in
27+
sed -e 's/@@TASKSOL@@/task/' $< > $@
28+
$(SOLUTIONDIR)/Makefile: Makefile.in
29+
sed -e 's/@@TASKSOL@@/sol/' $< > $@
30+
$(OPT_SOLUTIONDIR)/Makefile: Makefile.in
31+
sed -e 's/@@TASKSOL@@/solopt/' $< > $@
2532

2633
${TASKPROCCESFILES}: $(PROCESSFILES)
2734
mkdir -p $(TASKDIR)/

03-H_Multi_GPU_Parallelization/solutions/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
2+
THIS_TASK := 03H-sol
3+
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
24
NP ?= 4
35
NVCC=nvcc
46
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
@@ -33,10 +35,10 @@ clean:
3335
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log
3436

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

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

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

03-H_Multi_GPU_Parallelization/solutions/advanced/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
2+
THIS_TASK := 03H-solopt
3+
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
24
NP ?= 4
35
NVCC=nvcc
46
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
@@ -33,10 +35,10 @@ clean:
3335
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log
3436

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

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

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

03-H_Multi_GPU_Parallelization/tasks/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
2+
THIS_TASK := 03H-task
3+
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
24
NP ?= 4
35
NVCC=nvcc
46
JSC_SUBMIT_CMD ?= srun --gres=gpu:4 --ntasks-per-node 4
@@ -33,10 +35,10 @@ clean:
3335
rm -f jacobi jacobi.o *.nsys-rep jacobi.*.compute-sanitizer.log
3436

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

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

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

06-H_Overlap_Communication_and_Computation_MPI/.master/Instructions.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
" target (`make profile`)\n",
4545
"3. Open the recorded profile in the GUI\n",
4646
" - Either: Install Nsight Systems locally, and transfer the\n",
47-
" .qdrep/.nsys-rep file\n",
47+
" .nsys-rep file.\n",
48+
" - *Note*: Right-click in file-browser, choose “Download” from\n",
49+
" context menu\n",
4850
" - Or: By running Xpra in your browser: In Jupyter, select “File \\>\n",
4951
" New Launcher” and “Xpra Desktop”, which will open in a new tab.\n",
5052
" Don’t forget to source the environment in your `xterm`.\n",
@@ -84,7 +86,7 @@
8486
"- Destroy the additional cuda streams and events before ending the\n",
8587
" application"
8688
],
87-
"id": "7563d35d-a670-47af-acef-44cee0450930"
89+
"id": "21f77d33-b675-4746-9241-24837f172b29"
8890
}
8991
],
9092
"nbformat": 4,

06-H_Overlap_Communication_and_Computation_MPI/.master/Instructions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Use the Nsight System profiler to profile the starting point version non-Overlap
3131
1. Start by compiling and running the application with `make run`
3232
1. Record an Nsight Systems profile, using the appropriate Makefile target (`make profile`)
3333
1. Open the recorded profile in the GUI
34-
- Either: Install Nsight Systems locally, and transfer the .qdrep/.nsys-rep file
34+
- Either: Install Nsight Systems locally, and transfer the .nsys-rep file.
35+
- *Note*: Right-click in file-browser, choose "Download" from context menu
3536
- 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`.
3637
1. Familiarize yourself with the different rows and the traces they represent.
3738
- See if you can correlate a CUDA API kernel launch call and the resulting kernel execution on the device

06-H_Overlap_Communication_and_Computation_MPI/.master/Makefile renamed to 06-H_Overlap_Communication_and_Computation_MPI/.master/Makefile.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2017-2024, NVIDIA CORPORATION. All rights reserved.
2+
THIS_TASK := 06H-@@TASKSOL@@
3+
OUTPUT_NAME := jacobi.$(THIS_TASK)__$(shell date '+%Y%m%d-%H%M')
24
NP ?= 1
35
NVCC=nvcc
46
MPICXX=mpicxx
@@ -34,10 +36,10 @@ clean:
3436
rm -f jacobi jacobi_kernels.o *.nsys-rep jacobi.*.compute-sanitizer.log
3537

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

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

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

06-H_Overlap_Communication_and_Computation_MPI/.master/copy.mk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
#!/usr/bin/make -f
2-
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
2+
# Copyright (c) 2021-2024, NVIDIA CORPORATION. All rights reserved.
33
TASKDIR = ../tasks/
44
SOLUTIONDIR = ../solutions/
55

66
IYPNB_TEMPLATE = ../../.template.json
77

88
PROCESSFILES = jacobi.cpp
9-
COPYFILES = Makefile Instructions.ipynb Instructions.md jacobi_kernels.cu
9+
COPYFILES = Instructions.ipynb Instructions.md jacobi_kernels.cu
1010

1111

1212
TASKPROCCESFILES = $(addprefix $(TASKDIR)/,$(PROCESSFILES))
1313
TASKCOPYFILES = $(addprefix $(TASKDIR)/,$(COPYFILES))
1414
SOLUTIONPROCCESFILES = $(addprefix $(SOLUTIONDIR)/,$(PROCESSFILES))
1515
SOLUTIONCOPYFILES = $(addprefix $(SOLUTIONDIR)/,$(COPYFILES))
16+
MAKEFILES = $(addsuffix /Makefile,$(TASKDIR) $(SOLUTIONDIR))
1617

1718
.PHONY: all task clean
1819
all: task
19-
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES}
20+
task: ${TASKPROCCESFILES} ${TASKCOPYFILES} ${SOLUTIONPROCCESFILES} ${SOLUTIONCOPYFILES} ${MAKEFILES}
2021

22+
$(TASKDIR)/Makefile: Makefile.in
23+
sed -e 's/@@TASKSOL@@/task/' $< > $@
24+
$(SOLUTIONDIR)/Makefile: Makefile.in
25+
sed -e 's/@@TASKSOL@@/sol/' $< > $@
2126

2227
${TASKPROCCESFILES}: $(PROCESSFILES)
2328
mkdir -p $(TASKDIR)/

06-H_Overlap_Communication_and_Computation_MPI/solutions/Instructions.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
" target (`make profile`)\n",
4545
"3. Open the recorded profile in the GUI\n",
4646
" - Either: Install Nsight Systems locally, and transfer the\n",
47-
" .qdrep/.nsys-rep file\n",
47+
" .nsys-rep file.\n",
48+
" - *Note*: Right-click in file-browser, choose “Download” from\n",
49+
" context menu\n",
4850
" - Or: By running Xpra in your browser: In Jupyter, select “File \\>\n",
4951
" New Launcher” and “Xpra Desktop”, which will open in a new tab.\n",
5052
" Don’t forget to source the environment in your `xterm`.\n",
@@ -84,7 +86,7 @@
8486
"- Destroy the additional cuda streams and events before ending the\n",
8587
" application"
8688
],
87-
"id": "7563d35d-a670-47af-acef-44cee0450930"
89+
"id": "21f77d33-b675-4746-9241-24837f172b29"
8890
}
8991
],
9092
"nbformat": 4,

0 commit comments

Comments
 (0)