Skip to content

Commit

Permalink
Updated Makefile for timer_add
Browse files Browse the repository at this point in the history
  • Loading branch information
milfeld committed Oct 12, 2023
1 parent 679e085 commit 6d28bba
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 13 deletions.
7 changes: 7 additions & 0 deletions OpenMP_gpu/adv/multi_gpu/README_multi_gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
On multi-device nodes, you can specify a device to
perform the offload to, with the device clause.

LUMI:
IT IS IMPORTANT to allow use of 4 GPUs in the job scripts
(or interacctive usage with:
```
--gres=gpu:mi250:1
```

## Exercises

1.) Look over the code.
Expand Down
32 changes: 22 additions & 10 deletions OpenMP_gpu/adv/time_add/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
#NVCC = nvcc
#CFLAGS = -O2

CPP=clang++
OMP_FLAG=-fopenmp
OMP_OFF=-fopenmp-targets=nvptx64
CCFLAGS=-O2
#TACC LS6 (clang++ 16)
ifneq ("$(TACC_SYSTEM)","")
ifeq ($(TACC_SYSTEM),ls6)
ifeq ($(shell clang++ -v 2>&1 | grep -c "clang version"), 1)
CC = clang++
CCFLAGS = -O2
OMP_FLAG = -fopenmp
OMP_OFF = -fopenmp-targets=nvptx64
endif
endif
endif

#CPP=clang++
#OMP_FLAG=-fopenmp
# OMP_OFF=
# CCFLAGS=-O2
#LUMI
ifneq ("$(LUMI_LMOD_FAMILY_PRGENV)","")
CC = CC
CCFLAGS = -O2
OMP_FLAG = -fopenmp
OMP_OFF =
endif


add_c: add.o
$(CPP) -o $@ $(OMP_FLAG) $(OMP_OFF) add.o
$(CC) -o $@ $(OMP_FLAG) $(OMP_OFF) add.o $(PIE)
add.o: add.cpp
$(CPP) -c -o $@ $(OMP_FLAG) $(OMP_OFF) $? $(CCFLAGS)
$(CC) -c -o $@ $(OMP_FLAG) $(OMP_OFF) $? $(CCFLAGS) $(PIE)

clean:
rm -f add_c *.o
#https://www.gnu.org/software/make/manual/html_node/index.html#SEC_Contents
#https://stackoverflow.com/questions/5188267/checking-the-gcc-version-in-a-makefile
2 changes: 1 addition & 1 deletion OpenMP_gpu/job_cpu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -l
#SBATCH -J basic_c # Job name
#SBATCH -J omp_cpu # Job name
#SBATCH -o %x.o%j # Name of stdout & stderr file
#SBATCH -p debug # Partition (queue) name
#SBATCH -N 1 # one node
Expand Down
4 changes: 2 additions & 2 deletions OpenMP_gpu/job_gpu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -l
#SBATCH -J basic_g # Job name
#SBATCH -o %x.out%j # Name of stdout & stderr file
#SBATCH -J omp_gpu # Job name
#SBATCH -o %x.out%j # Name of stdout & stderr file
#SBATCH -p dev-g # Partition (queue) name
#SBATCH -N 1 # one node
#SBATCH -n 1 # tasks
Expand Down

0 comments on commit 6d28bba

Please sign in to comment.