Skip to content

Commit

Permalink
Merge branch 'bartgol/point-to-ekat-master' into next (PR #6421)
Browse files Browse the repository at this point in the history
Point to ekat master branch, and fix usage of deprecated kokkos code in Homme

We just merged the kokkos-4.2 branch in ekat/master, so now we can
make e3sm point directly to the ekat/master branch, which avoids
conflicts when doing a downstream merge into scream repo.

Also, fix usage of deprecated kokkos code in Homme. The tests on e3sm
repo are set so that Kokkos allows using deprecated code (with
warnings), but it caused some errors downstream in eamxx. Using the
non-deprecated code is a simple fix

[BFB]
  • Loading branch information
jgfouca committed May 16, 2024
2 parents 1383b06 + 7d5fc96 commit cac1721
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
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

0 comments on commit cac1721

Please sign in to comment.