diff --git a/machines/Depends.nvhpc b/machines/Depends.nvhpc index 84b6596..f01bdda 100644 --- a/machines/Depends.nvhpc +++ b/machines/Depends.nvhpc @@ -154,9 +154,9 @@ ifeq ($(DEBUG),FALSE) # $(SHR_RANDNUM_C_OBJS): %.o: %.c # $(CC) -c $(INCLDIR) $(INCS) $(CFLAGS) -O3 -fast $< $(PUMAS_OBJS): %.o: %.F90 - $(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -O3 -fastsse -Mnofma -Mflushz -Mfprelaxed=sqrt $(GPUFLAGS) $< + $(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -O3 -fastsse -Mnofma -Mflushz -Mfprelaxed=sqrt $(OPENACC_GPU_FLAGS) $< $(RRTMGP_OBJS): %.o: %.F90 - $(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) $(GPUFLAGS) $< + $(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) $(OPENACC_GPU_FLAGS) $< $(CLUBB_OBJS): %.o: %.F90 - $(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) $(GPUFLAGS) $< + $(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) $(OPENACC_GPU_FLAGS) $< endif diff --git a/machines/cmake_macros/nvhpc.cmake b/machines/cmake_macros/nvhpc.cmake index d541457..39c91fc 100644 --- a/machines/cmake_macros/nvhpc.cmake +++ b/machines/cmake_macros/nvhpc.cmake @@ -51,21 +51,19 @@ set(MPIFC "mpif90") set(SCC "nvc") set(SCXX "nvc++") set(SFC "nvfortran") -if (GPU_TYPE STREQUAL v100 AND GPU_OFFLOAD STREQUAL openacc) - string(APPEND GPUFLAGS " -acc -gpu=cc70,lineinfo,nofma -Minfo=accel ") -endif() -if (GPU_TYPE STREQUAL v100 AND GPU_OFFLOAD STREQUAL openmp) - string(APPEND GPUFLAGS " -mp=gpu -gpu=cc70,lineinfo,nofma -Minfo=accel ") -endif() -if (GPU_TYPE STREQUAL v100 AND GPU_OFFLOAD STREQUAL combined) - string(APPEND GPUFLAGS " -acc -gpu=cc70,lineinfo,nofma -mp=gpu -Minfo=accel ") -endif() -if (GPU_TYPE STREQUAL a100 AND GPU_OFFLOAD STREQUAL openacc) - string(APPEND GPUFLAGS " -acc -gpu=cc80,lineinfo,nofma -Minfo=accel ") -endif() -if (GPU_TYPE STREQUAL a100 AND GPU_OFFLOAD STREQUAL openmp) - string(APPEND GPUFLAGS " -mp=gpu -gpu=cc80,lineinfo,nofma -Minfo=accel ") -endif() -if (GPU_TYPE STREQUAL a100 AND GPU_OFFLOAD STREQUAL combined) - string(APPEND GPUFLAGS " -acc -gpu=cc80,lineinfo,nofma -mp=gpu -Minfo=accel") -endif() +if (GPU_TYPE STREQUAL v100) + if (OPENACC_GPU_OFFLOAD) + string(APPEND OPENACC_GPU_FLAGS " -acc -gpu=cc70,lineinfo,nofma -Minfo=accel ") + endif() + if (OPENMP_GPU_OFFLOAD) + string(APPEND OPENMP_GPU_FLAGS " -mp=gpu -gpu=cc70,lineinfo,nofma -Minfo=accel ") + endif() +endif() +if (GPU_TYPE STREQUAL a100) + if (OPENACC_GPU_OFFLOAD) + string(APPEND OPENACC_GPU_FLAGS " -acc -gpu=cc80,lineinfo,nofma -Minfo=accel ") + endif() + if (OPENMP_GPU_OFFLOAD) + string(APPEND OPENMP_GPU_FLAGS " -mp=gpu -gpu=cc80,lineinfo,nofma -Minfo=accel ") + endif() +endif() \ No newline at end of file diff --git a/machines/derecho/config_machines.xml b/machines/derecho/config_machines.xml index 12446f3..7bda638 100644 --- a/machines/derecho/config_machines.xml +++ b/machines/derecho/config_machines.xml @@ -16,9 +16,6 @@ 4 128 64 - none,a100 - none,openacc,openmp,combined - set_gpu_rank TRUE mpibind @@ -75,7 +72,7 @@ cray-mpich/8.1.27 - + cuda/12.2.1 @@ -121,7 +118,7 @@ ON SUMMARY - + -lcuda -lcudart diff --git a/machines/derecho/nvhpc_derecho.cmake b/machines/derecho/nvhpc_derecho.cmake index f0b3cd8..2c497d0 100644 --- a/machines/derecho/nvhpc_derecho.cmake +++ b/machines/derecho/nvhpc_derecho.cmake @@ -4,4 +4,6 @@ endif() if (NOT DEBUG) string(APPEND FFLAGS " -tp=zen3") endif() -message("GPU_TYPE is ${GPU_TYPE} GPU_OFFLOAD is ${GPU_OFFLOAD}") +message("GPU_TYPE is ${GPU_TYPE}") +message("OPENACC_GPU_OFFLOAD is ${OPENACC_GPU_OFFLOAD}") +message("OPENMP_GPU_OFFLOAD is ${OPENMP_GPU_OFFLOAD}") \ No newline at end of file