diff --git a/OpenMP_gpu/adv/multi_gpu/README_multi_gpu.md b/OpenMP_gpu/adv/multi_gpu/README_multi_gpu.md index ff24ac9..f55b8e1 100644 --- a/OpenMP_gpu/adv/multi_gpu/README_multi_gpu.md +++ b/OpenMP_gpu/adv/multi_gpu/README_multi_gpu.md @@ -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. diff --git a/OpenMP_gpu/adv/time_add/Makefile b/OpenMP_gpu/adv/time_add/Makefile index 2e2deee..3da60c4 100644 --- a/OpenMP_gpu/adv/time_add/Makefile +++ b/OpenMP_gpu/adv/time_add/Makefile @@ -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 diff --git a/OpenMP_gpu/job_cpu b/OpenMP_gpu/job_cpu index a1d28ad..03f0d46 100644 --- a/OpenMP_gpu/job_cpu +++ b/OpenMP_gpu/job_cpu @@ -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 diff --git a/OpenMP_gpu/job_gpu b/OpenMP_gpu/job_gpu index c8b53d9..9d069a0 100644 --- a/OpenMP_gpu/job_gpu +++ b/OpenMP_gpu/job_gpu @@ -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