Skip to content

Commit

Permalink
Merge pull request #97 from sjsprecious/add_gpu_gust
Browse files Browse the repository at this point in the history
Add flexible controls of GPU configuration and remove old GPU configuration
  • Loading branch information
jedwards4b authored Aug 9, 2023
2 parents 4b74f76 + 7a12059 commit fe65a9c
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 320 deletions.
12 changes: 3 additions & 9 deletions machines/Depends.nvhpc
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ mo_rte_kind.o\
mo_source_functions.o\
mo_optical_props_kernels.o\
mo_rte_solver_kernels.o\
mo_optical_props_kernels.o\
mo_rte_solver_kernels.o\
rrtmgp_driver.o

RRTMGP_NOOPT=\
rrtmgp_driver.o\
mo_gas_optics_kernels.o

ifeq ($(DEBUG),FALSE)
Expand All @@ -86,9 +82,7 @@ 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 $<
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -O3 -fastsse -Mnofma -Mflushz -Mfprelaxed=sqrt $(GPUFLAGS) $<
$(RRTMGP_OBJS): %.o: %.F90
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -Mnoopenmp $<
$(RRTMGP_NOOPT): %.o: %.F90
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) -O0 $<
$(FC) -c $(INCLDIR) $(INCS) $(FFLAGS) $(FREEFLAGS) $(GPUFLAGS) $<
endif
94 changes: 0 additions & 94 deletions machines/Depends.nvhpc-gpu

This file was deleted.

16 changes: 0 additions & 16 deletions machines/Depends.pgi-gpu

This file was deleted.

46 changes: 0 additions & 46 deletions machines/cmake_macros/nvhpc-gpu.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions machines/cmake_macros/nvhpc-gpu_casper.cmake

This file was deleted.

18 changes: 18 additions & 0 deletions machines/cmake_macros/nvhpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,21 @@ 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()
1 change: 1 addition & 0 deletions machines/cmake_macros/nvhpc_casper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ if (MPILIB STREQUAL mpi-serial)
string(APPEND SLIBS " -ldl")
endif()
string(APPEND SLIBS " -L${NETCDF_PATH}/lib -lnetcdf -lnetcdff")
message("GPU_TYPE is ${GPU_TYPE} GPU_OFFLOAD is ${GPU_OFFLOAD}")
1 change: 1 addition & 0 deletions machines/cmake_macros/nvhpc_derecho.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ endif()
if (NOT DEBUG)
string(APPEND FFLAGS " -target=zen3")
endif()
message("GPU_TYPE is ${GPU_TYPE} GPU_OFFLOAD is ${GPU_OFFLOAD}")
46 changes: 0 additions & 46 deletions machines/cmake_macros/pgi-gpu.cmake

This file was deleted.

15 changes: 0 additions & 15 deletions machines/cmake_macros/pgi-gpu_casper.cmake

This file was deleted.

52 changes: 22 additions & 30 deletions machines/config_batch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@
<directive default="n"> -r {{ rerunnable }} </directive>
<!-- <directive> -j oe {{ job_id }} </directive> -->
<directive> -j oe </directive>
<directive> -V </directive>
</directives>
</batch_system>

Expand Down Expand Up @@ -226,34 +225,14 @@
<!-- casper pbs -->
<batch_system MACH="casper" type="pbs">
<batch_submit>qsub</batch_submit>

<directives queue="casper" compiler="pgi-gpu">
<!-- Turn on MPS server manually -->
<!-- This is a temporary solution and should be removed once MPS is integrated into PBS on Casper -->
<directive default="/bin/bash" > -S /glade/u/apps/dav/opt/nvidia-mps/mps_bash </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=700GB:ngpus={{ ngpus_per_node }} </directive>
<directive> -l gpu_type=v100 </directive>
</directives>

<directives queue="casper" compiler="nvhpc-gpu">
<!-- Turn on MPS server manually -->
<!-- This is a temporary solution and should be removed once MPS is integrated into PBS on Casper -->
<directive default="/bin/bash" > -S /glade/u/apps/dav/opt/nvidia-mps/mps_bash </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=700GB:ngpus={{ ngpus_per_node }} </directive>
<directive> -l gpu_type=v100 </directive>
</directives>

<directives queue="casper" compiler="nvhpc">
<directive default="/bin/bash" > -S {{ shell }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=700GB:ngpus={{ ngpus_per_node }} </directive>
</directives>

<directives queue="casper" compiler="pgi">
<submit_args>
<argument> -l gpu_type=$GPU_TYPE </argument>
</submit_args>
<directives queue="casper" compiler="nvhpc" gpu_enabled="true">
<directive default="/bin/bash" > -S {{ shell }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=700GB:ngpus={{ ngpus_per_node }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=700GB:ngpus={{ ngpus_per_node }}:mps=1 </directive>
</directives>

<directives queue="casper" compiler="intel">
<directives queue="casper" gpu_enabled="false">
<directive default="/bin/bash" > -S {{ shell }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=700GB:ngpus={{ ngpus_per_node }} </directive>
</directives>
Expand Down Expand Up @@ -378,9 +357,13 @@

<batch_system MACH="derecho" type="pbs" >
<batch_submit>qsub</batch_submit>
<directives>
<directives gpu_enabled="false">
<directive default="/bin/bash" > -S {{ shell }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}</directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=230GB</directive>
</directives>
<directives gpu_enabled="true">
<directive default="/bin/bash" > -S {{ shell }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_cputasks_per_gpu_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=480GB:ngpus={{ ngpus_per_node }}:mps=1 </directive>
</directives>
<queues>
<queue walltimemax="4:00:00" nodemin="1" nodemax="2488" >main</queue>
Expand Down Expand Up @@ -501,10 +484,19 @@

<batch_system MACH="gust" type="pbs" >
<batch_submit>qsub</batch_submit>
<directives>
<submit_args>
<argument> -l gpu_type=$GPU_TYPE </argument>
</submit_args>
<directives queue="main" gpu_enabled="false">
<directive default="/bin/bash" > -S {{ shell }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_tasks_per_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}</directive>
</directives>
<directives queue="main" gpu_enabled="true">
<directive default="/bin/bash" > -S {{ shell }} </directive>
<directive> -l select={{ num_nodes }}:ncpus={{ max_cputasks_per_gpu_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=430GB:ngpus={{ ngpus_per_node }} </directive>
<!-- Do not use MPS on Gust yet as it conflicts with cray-mpich library -->
<!-- <directive> -l select={{ num_nodes }}:ncpus={{ max_cputasks_per_gpu_node }}:mpiprocs={{ tasks_per_node }}:ompthreads={{ thread_count }}:mem=430GB:ngpus={{ ngpus_per_node }}:mps=1 </directive> -->
</directives>
<queues>
<queue walltimemax="4:00:00" nodemin="1" nodemax="8" >main</queue>
<queue walltimemax="1:00:00" nodemin="9" nodemax="16" >bigcpu</queue>
Expand Down
Loading

0 comments on commit fe65a9c

Please sign in to comment.