-
Notifications
You must be signed in to change notification settings - Fork 466
homme HIP changes #5039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
homme HIP changes #5039
Changes from all commits
3c1b671
7604fc4
c6422dc
b3e0af2
684c633
24f3dc4
3d3cd6d
dfee17b
3523d5d
0a2d96d
5460f98
ec3308a
9093346
ad20860
2f173cf
b97eb94
bf6f042
6689abd
cfb8dfd
cced5d9
53d3e71
41f0c42
62db3fc
1c042ab
076805f
d1cc873
ecf447f
ba358e3
f6e28c8
91b396a
026a9f1
f26c0f4
5f41bba
b4a1e39
babc296
811933a
ccb4f03
90ea3f2
24ca04c
3a4b951
0b01499
cc33ef0
a4ab895
f0bf95e
1deaa79
632c46a
8105e7a
6c4cf89
44dade3
62fc2e3
b304124
a0af755
d3adb96
406a01e
28711ac
885b3bc
e7b7eb5
d0cef39
0c0bc40
e3bd20a
eff19f5
055872c
4802901
b3f04b5
9522305
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -156,7 +156,7 @@ macro(createTestExec execName execType macroNP macroNC | |
| ENDIF () | ||
|
|
||
| IF (HOMME_USE_KOKKOS) | ||
| TARGET_LINK_LIBRARIES(${execName} kokkos) | ||
| link_to_kokkos(${execName}) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to other reviewers: I reorganized things a bit so that |
||
| ENDIF () | ||
|
|
||
| # Move the module files out of the way so the parallel build | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #interactive job | ||
| #bsub -W 2:00 -nnodes 1 -P cli115 -Is /bin/bash | ||
|
|
||
|
|
||
| #cmake -C ~/acme-fork-lb/components/homme/cmake/machineFiles/summit.cmake -DHOMMEXX_MPI_ON_DEVICE=FALSE ~/acme-fork-lb/components/homme/ | ||
|
|
||
| #cmake -C ~/acme-MASTER-GB/components/homme/cmake/machineFiles/crusher-gpumpi.cmake -DE3SM_KOKKOS_PATH=/ccs/home/onguba/kokkos-crusher-june2022/bld-hipcc ~/acme-MASTER-GB/components/homme/ | ||
|
|
||
| #SET (HOMMEXX_MPI_ON_DEVICE FALSE CACHE BOOL "") | ||
| SET (HOMMEXX_CUDA_MAX_WARP_PER_TEAM "16" CACHE STRING "") | ||
|
|
||
| SET (NETCDF_DIR $ENV{OLCF_NETCDF_FORTRAN_ROOT} CACHE FILEPATH "") | ||
| SET (HDF5_DIR $ENV{OLCF_HDF5_ROOT} CACHE FILEPATH "") | ||
|
|
||
| SET(BUILD_HOMME_WITHOUT_PIOLIBRARY TRUE CACHE BOOL "") | ||
|
|
||
| SET(HOMME_FIND_BLASLAPACK TRUE CACHE BOOL "") | ||
|
|
||
| SET(WITH_PNETCDF FALSE CACHE FILEPATH "") | ||
|
|
||
| SET(USE_QUEUING FALSE CACHE BOOL "") | ||
|
|
||
| SET(BUILD_HOMME_PREQX_KOKKOS TRUE CACHE BOOL "") | ||
| SET(BUILD_HOMME_THETA_KOKKOS TRUE CACHE BOOL "") | ||
|
|
||
| #SET (HOMMEXX_BFB_TESTING TRUE CACHE BOOL "") | ||
|
|
||
| SET(USE_TRILINOS OFF CACHE BOOL "") | ||
|
|
||
| #CUDA_BUILD is set in SetCompilersFlags, after findPackage(Cuda) | ||
| #i haven't extend it to hip, set it here instead | ||
| SET(HIP_BUILD TRUE CACHE BOOL "") | ||
|
|
||
| #uncomment this if using internal kokkos build | ||
| #SET(Kokkos_ENABLE_SERIAL ON CACHE BOOL "") | ||
| ####SET(CMAKE_CXX_STANDARD "14" CACHE STRING "") | ||
| #SET(Kokkos_ENABLE_DEBUG OFF CACHE BOOL "") | ||
| #SET(Kokkos_ARCH_VEGA90A ON CACHE BOOL "") | ||
| #SET(Kokkos_ENABLE_OPENMP OFF CACHE BOOL "") | ||
| #SET(Kokkos_ENABLE_HIP ON CACHE BOOL "") | ||
| ####SET(Kokkos_ENABLE_CUDA_LAMBDA OFF CACHE BOOL "") | ||
| #SET(Kokkos_ENABLE_EXPLICIT_INSTANTIATION OFF CACHE BOOL "") | ||
|
|
||
| SET(CMAKE_C_COMPILER "cc" CACHE STRING "") | ||
| SET(CMAKE_Fortran_COMPILER "ftn" CACHE STRING "") | ||
| SET(CMAKE_CXX_COMPILER "hipcc" CACHE STRING "") | ||
|
|
||
| #not the proper way!!! | ||
| SET(MPICH_DIR "/opt/cray/pe/mpich/8.1.12/ofi/crayclang/10.0" CACHE STRING "") | ||
|
|
||
| SET(Extrae_LIBRARY "-I${MPICH_DIR}/include -L${MPICH_DIR}/lib -lmpi -L/opt/cray/pe/mpich/8.1.12/gtl/lib -lmpi_gtl_hsa" CACHE STRING "") | ||
|
|
||
| SET(ADD_Fortran_FLAGS "-O3 -DNDEBUG ${Extrae_LIBRARY}" CACHE STRING "") | ||
| SET(ADD_C_FLAGS "-O3 -DNDEBUG ${Extrae_LIBRARY}" CACHE STRING "") | ||
| SET(ADD_CXX_FLAGS "-std=c++14 -O3 -DNDEBUG --amdgpu-target=gfx90a -fno-gpu-rdc ${Extrae_LIBRARY}" CACHE STRING "") | ||
| SET(ADD_LINKER_FLAGS "-O3 -DNDEBUG ${Extrae_LIBRARY}" CACHE STRING "") | ||
|
|
||
|
|
||
| set (ENABLE_OPENMP OFF CACHE BOOL "") | ||
| set (ENABLE_COLUMN_OPENMP OFF CACHE BOOL "") | ||
| set (ENABLE_HORIZ_OPENMP OFF CACHE BOOL "") | ||
|
|
||
| set (HOMME_TESTING_PROFILE "dev" CACHE STRING "") | ||
|
|
||
| set (USE_NUM_PROCS 4 CACHE STRING "") | ||
|
|
||
| #set (OPT_FLAGS "-mcpu=power9 -mtune=power9" CACHE STRING "") | ||
| SET (USE_MPI_OPTIONS "--bind-to core" CACHE FILEPATH "") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #interactive job | ||
| #bsub -W 2:00 -nnodes 1 -P cli115 -Is /bin/bash | ||
|
|
||
| #1 gpu on 1 node | ||
| #jsrun -n 1 -r 1 -l gpu-gpu -b packed:1 -d plane:1 -a1 -c7 -g1 --smpiargs "-gpu" EXEC < ${nlname} | ||
| #6 gpus on 1 node | ||
| #jsrun -n 6 -r 6 -l gpu-gpu -b packed:1 -d plane:1 -a1 -c7 -g1 --smpiargs "-gpu" EXEC < ${nlname} | ||
| #6 ranks, cpu only on 1 node, not 42 rank, NEEDS visible GPU due to some kokkos init, so, -g1, not -g0 | ||
| #jsrun -n 6 -r 6 -l cpu-cpu -b packed:1 -d plane:1 -a1 -c7 -g1 EXEC < ${nlname} | ||
|
|
||
|
|
||
| set(CMAKE_C_FLAGS "-w" CACHE STRING "") | ||
| set(ADD_CXX_FLAGS "-Xcudafe --diag_suppress=esa_on_defaulted_function_ignored -Wno-unknown-pragmas --fmad=false -O0" CACHE STRING "") | ||
| set(ADD_Fortran_FLAGS " -ffp-contract=off -O0" CACHE STRING "") | ||
| set(OPT_FLAGS "-O0" CACHE STRING "") | ||
| set(DEBUG_FLAGS "-ffp-contract=off -g"CACHE STRING "") | ||
|
|
||
|
|
||
| #SET (HOMMEXX_MPI_ON_DEVICE FALSE CACHE BOOL "") | ||
| SET (HOMMEXX_CUDA_MAX_WARP_PER_TEAM "16" CACHE STRING "") | ||
|
|
||
| SET (NETCDF_DIR $ENV{OLCF_NETCDF_FORTRAN_ROOT} CACHE FILEPATH "") | ||
| SET (NetCDF_Fortran_PATH $ENV{OLCF_NETCDF_FORTRAN_ROOT} CACHE STRING "") | ||
| SET (NetCDF_C_PATH $ENV{OLCF_NETCDF_C_ROOT} CACHE STRING "") | ||
| #SET(NetCDF_C_LIBRARY "/sw/summit/spack-envs/base/opt/linux-rhel8-ppc64le/gcc-7.5.0/netcdf-c-4.8.0-pwi4jbrnwv4lrrjxdu5czbos5uvvjgvr/lib" CACHE STRING "") | ||
| #SET(NetCDF_C_INCLUDE_DIR "/sw/summit/spack-envs/base/opt/linux-rhel8-ppc64le/gcc-7.5.0/netcdf-c-4.8.0-pwi4jbrnwv4lrrjxdu5czbos5uvvjgvr/include" CACHE STRING "") | ||
|
|
||
| SET(HOMME_FIND_BLASLAPACK TRUE CACHE BOOL "") | ||
|
|
||
| SET(WITH_PNETCDF FALSE CACHE FILEPATH "") | ||
|
|
||
| SET(USE_QUEUING FALSE CACHE BOOL "") | ||
|
|
||
| SET(BUILD_HOMME_PREQX_KOKKOS TRUE CACHE BOOL "") | ||
| SET(BUILD_HOMME_THETA_KOKKOS TRUE CACHE BOOL "") | ||
| SET(HOMME_ENABLE_COMPOSE TRUE CACHE BOOL "") | ||
| #SET(HOMME_ENABLE_COMPOSE FALSE CACHE BOOL "") | ||
|
|
||
| SET (HOMMEXX_BFB_TESTING TRUE CACHE BOOL "") | ||
|
|
||
| SET(USE_TRILINOS OFF CACHE BOOL "") | ||
|
|
||
| SET(Kokkos_ENABLE_OPENMP OFF CACHE BOOL "") | ||
| SET(Kokkos_ENABLE_CUDA ON CACHE BOOL "") | ||
| SET(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "") | ||
| SET(Kokkos_ARCH_VOLTA70 ON CACHE BOOL "") | ||
| SET(Kokkos_ENABLE_EXPLICIT_INSTANTIATION OFF CACHE BOOL "") | ||
|
|
||
| SET(CMAKE_C_COMPILER "mpicc" CACHE STRING "") | ||
| SET(CMAKE_Fortran_COMPILER "mpifort" CACHE STRING "") | ||
| SET(CMAKE_CXX_COMPILER "${CMAKE_CURRENT_SOURCE_DIR}/../../externals/kokkos/bin/nvcc_wrapper" CACHE STRING "") | ||
|
|
||
| set (ENABLE_OPENMP OFF CACHE BOOL "") | ||
| set (ENABLE_COLUMN_OPENMP OFF CACHE BOOL "") | ||
| set (ENABLE_HORIZ_OPENMP OFF CACHE BOOL "") | ||
|
|
||
| set (HOMME_TESTING_PROFILE "dev" CACHE STRING "") | ||
|
|
||
| set (USE_NUM_PROCS 4 CACHE STRING "") | ||
|
|
||
| #set (OPT_FLAGS "-mcpu=power9 -mtune=power9" CACHE STRING "") | ||
| SET (USE_MPI_OPTIONS "--bind-to core" CACHE FILEPATH "") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -753,7 +753,7 @@ struct CaarFunctorImpl { | |
| private: | ||
| template <typename ExecSpaceType> | ||
| KOKKOS_INLINE_FUNCTION typename std::enable_if< | ||
| !std::is_same<ExecSpaceType, Hommexx_Cuda>::value, void>::type | ||
| !std::is_same<ExecSpaceType, HommexxGPU>::value, void>::type | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: we could consider using which might be easier to read/parse. |
||
| compute_pressure_impl(KernelVariables &kv) const { | ||
| Kokkos::parallel_for(Kokkos::TeamThreadRange(kv.team, NP * NP), | ||
| [&](const int loop_idx) { | ||
|
|
@@ -787,7 +787,7 @@ struct CaarFunctorImpl { | |
|
|
||
| template <typename ExecSpaceType> | ||
| KOKKOS_INLINE_FUNCTION typename std::enable_if< | ||
| std::is_same<ExecSpaceType, Hommexx_Cuda>::value, void>::type | ||
| std::is_same<ExecSpaceType, HommexxGPU>::value, void>::type | ||
| compute_pressure_impl(KernelVariables &kv) const { | ||
| Kokkos::parallel_for(Kokkos::TeamThreadRange(kv.team, NP * NP), | ||
| [&](const int loop_idx) { | ||
|
|
@@ -821,7 +821,7 @@ struct CaarFunctorImpl { | |
|
|
||
| template <typename ExecSpaceType> | ||
| KOKKOS_INLINE_FUNCTION typename std::enable_if< | ||
| !std::is_same<ExecSpaceType, Hommexx_Cuda>::value, void>::type | ||
| !std::is_same<ExecSpaceType, HommexxGPU>::value, void>::type | ||
| preq_hydrostatic_impl(KernelVariables &kv) const { | ||
| Kokkos::parallel_for(Kokkos::TeamThreadRange(kv.team, NP * NP), | ||
| [&](const int loop_idx) { | ||
|
|
@@ -874,10 +874,10 @@ struct CaarFunctorImpl { | |
| #endif | ||
| } | ||
|
|
||
| // CUDA version | ||
| // GPU version | ||
| template <typename ExecSpaceType> | ||
| KOKKOS_INLINE_FUNCTION typename std::enable_if< | ||
| std::is_same<ExecSpaceType, Hommexx_Cuda>::value, void>::type | ||
| std::is_same<ExecSpaceType, HommexxGPU>::value, void>::type | ||
| preq_hydrostatic_impl(KernelVariables &kv) const { | ||
| assert_vector_size_1(); | ||
| Kokkos::parallel_for(Kokkos::TeamThreadRange(kv.team, NP * NP), | ||
|
|
@@ -929,10 +929,10 @@ struct CaarFunctorImpl { | |
| kv.team_barrier(); | ||
| } | ||
|
|
||
| // CUDA version | ||
| // GPU version | ||
| template <typename ExecSpaceType> | ||
| KOKKOS_INLINE_FUNCTION typename std::enable_if< | ||
| std::is_same<ExecSpaceType, Hommexx_Cuda>::value, void>::type | ||
| std::is_same<ExecSpaceType, HommexxGPU>::value, void>::type | ||
| preq_omega_ps_impl(KernelVariables &kv) const { | ||
| assert_vector_size_1(); | ||
| #ifdef DEBUG_TRACE | ||
|
|
@@ -983,10 +983,10 @@ struct CaarFunctorImpl { | |
| #endif | ||
| } | ||
|
|
||
| // Non-CUDA version | ||
| // Non-GPU version | ||
| template <typename ExecSpaceType> | ||
| KOKKOS_INLINE_FUNCTION typename std::enable_if< | ||
| !std::is_same<ExecSpaceType, Hommexx_Cuda>::value, void>::type | ||
| !std::is_same<ExecSpaceType, HommexxGPU>::value, void>::type | ||
| preq_omega_ps_impl(KernelVariables &kv) const { | ||
| m_sphere_ops.gradient_sphere( | ||
| kv, Homme::subview(m_buffers.pressure, kv.team_idx), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.