Skip to content
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

Point to ekat master branch, and fix usage of deprecated kokkos code in Homme #6421

Merged
merged 3 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cime_config/machines/cmake_macros/gnugpu_pm-gpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (COMP_NAME STREQUAL gptl)
endif()
string(APPEND CPPDEFS " -DTHRUST_IGNORE_CUB_VERSION_CHECK")
string(APPEND CMAKE_CUDA_FLAGS " -ccbin CC -O2 -arch sm_80 --use_fast_math")
string(APPEND KOKKOS_OPTIONS " -DKokkos_ARCH_AMPERE80=On -DKokkos_ENABLE_CUDA=On -DKokkos_ENABLE_CUDA_LAMBDA=On -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=Off")
string(APPEND KOKKOS_OPTIONS " -DKokkos_ARCH_AMPERE80=On -DKokkos_ENABLE_CUDA=On -DKokkos_ENABLE_CUDA_LAMBDA=On -DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_OPENMP=Off -DKokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC=Off")
set(CMAKE_CUDA_ARCHITECTURES "80")
string(APPEND CMAKE_C_FLAGS_RELEASE " -O2")
string(APPEND CMAKE_Fortran_FLAGS_RELEASE " -O2")
Expand Down
2 changes: 1 addition & 1 deletion components/homme/src/share/compose/cedr_kokkos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct ExeSpaceUtils {
#ifdef COMPOSE_MIMIC_GPU
const int max_threads =
#ifdef KOKKOS_ENABLE_OPENMP
ExeSpace::concurrency()
ExeSpace().concurrency()
#else
1
#endif
Expand Down
5 changes: 1 addition & 4 deletions components/homme/src/share/cxx/ExecSpaceDefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,14 @@ static
typename std::enable_if<!OnGpu<ExecSpaceType>::value,int>::type
get_num_concurrent_teams (const Kokkos::TeamPolicy<ExecSpaceType,Tags...>& policy) {
const int team_size = policy.team_size();
const int concurrency = ExecSpaceType::concurrency();
const int concurrency = ExecSpaceType().concurrency();
return (concurrency + team_size - 1) / team_size;
}

template<typename ExecSpaceType, typename... Tags>
static
typename std::enable_if<OnGpu<ExecSpaceType>::value,int>::type
get_num_concurrent_teams (const Kokkos::TeamPolicy<ExecSpaceType,Tags...>& policy) {
// const int team_size = policy.team_size() * policy.vector_length();
// const int concurrency = ExecSpaceType::concurrency();
// return (concurrency + team_size - 1) / team_size;
return policy.league_size();
}

Expand Down
2 changes: 1 addition & 1 deletion components/homme/src/share/cxx/kokkos_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _TeamUtilsCommonBase
template <typename TeamPolicy>
_TeamUtilsCommonBase(const TeamPolicy& policy)
{
_max_threads = ExeSpace::concurrency() / ( OnGpu<ExeSpace>::value ? 2 : 1);
_max_threads = ExeSpace().concurrency() / ( OnGpu<ExeSpace>::value ? 2 : 1);
const int team_size = policy.team_size();
_num_teams = _max_threads / team_size;
_team_size = _max_threads / _num_teams;
Expand Down