Skip to content

Commit

Permalink
Merge pull request #189 from sjsprecious/update_gpu_config
Browse files Browse the repository at this point in the history
Update Derecho setups for new GPU XML variables
  • Loading branch information
jedwards4b authored Oct 7, 2024
2 parents e4ac80e + 4f12095 commit 775e9f7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
6 changes: 3 additions & 3 deletions machines/Depends.nvhpc
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 16 additions & 18 deletions machines/cmake_macros/nvhpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
7 changes: 2 additions & 5 deletions machines/derecho/config_machines.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
<MAX_GPUS_PER_NODE>4</MAX_GPUS_PER_NODE>
<MAX_MPITASKS_PER_NODE>128</MAX_MPITASKS_PER_NODE>
<MAX_CPUTASKS_PER_GPU_NODE>64</MAX_CPUTASKS_PER_GPU_NODE>
<GPU_TYPE>none,a100</GPU_TYPE>
<GPU_OFFLOAD>none,openacc,openmp,combined</GPU_OFFLOAD>
<MPI_GPU_WRAPPER_SCRIPT>set_gpu_rank</MPI_GPU_WRAPPER_SCRIPT>
<PROJECT_REQUIRED>TRUE</PROJECT_REQUIRED>
<mpirun mpilib="default">
<executable>mpibind</executable>
Expand Down Expand Up @@ -75,7 +72,7 @@
<command name="load">cray-mpich/8.1.27</command>
</modules>

<modules mpilib="mpich" compiler="nvhpc" gpu_offload="!none">
<modules mpilib="mpich" compiler="nvhpc" gpu_type="!none">
<command name="load">cuda/12.2.1</command>
</modules>

Expand Down Expand Up @@ -121,7 +118,7 @@
<env name="ESMF_RUNTIME_PROFILE">ON</env>
<env name="ESMF_RUNTIME_PROFILE_OUTPUT">SUMMARY</env>
</environment_variables>
<environment_variables compiler="nvhpc" gpu_offload="!none">
<environment_variables compiler="nvhpc" gpu_type="!none">
<env name="NCAR_LIBS_CUDA">-lcuda -lcudart</env>
</environment_variables>
</machine>
4 changes: 3 additions & 1 deletion machines/derecho/nvhpc_derecho.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

0 comments on commit 775e9f7

Please sign in to comment.