Skip to content

Conversation

bartgol
Copy link
Contributor

@bartgol bartgol commented May 16, 2025

Update the EKAT submodule and change EAMxx to conform to the new version of EKAT.


A (very disruptive) PR in EKAT (not yet integrated) will break EKAT into sub-packages, to facilitate its use in other applications without the need to bring in every single ekat dependency.

This PR adapts to those changes, which can be summarized in the following points:

  • There is no longer an ekat library, but a bunch of ekat::XYZ libraries, including a ekat::AllLibs one (for convenience).
  • No longer use paths in includes: customer should just include <ekat_blah.hpp>, without any path (they should not care how ekat files are organized in the ekat repo)
  • ekat_kokkos_utils.hpp broken in two: ekat_reduction_utils.hpp and ekat_team_policy_utils.hpp
  • ExeSpaceUtils no longer persent. In its place, use TeamPolicyFactory (from ekat_team_policy_utils.hpp) for team policy creation, and ReductionUtils (from ekat_reduction_utils.hpp) for reduction utilities; both are templated on exec space, just like ExeSpaceUtils was.
  • ScalarTraits no longer provides invalid() and quiet_NaN(), but only provides type info. The functions quiet_NaN() and finite_max() have been added in ekat_math_utils.hpp, but may disappear once we have C++20 (see comment in ekat_pack.hpp about "introspective" constepxr)
  • ekat_file_utils.hpp has been purged, and all tests now simply use the standard library ifstream/ofstream capabilities.
  • There is no more an "ekat" session. The ekat::KokkosUtils has initialize_kokkos_session (and its finalize).
  • Minor changes related to how we print the current session configuration (some are in ekat::Core, some in ekat::KokkosUtils).
  • EkatCreateUnitTestExec no longer has EXCLUDE_TEST_SESSION, but instead has USER_DEFINED_TEST_SESSION, for more expressivity.

The biggest challenge was how to break ekat into N packages, since some utilities were "generic enough", but required knowledge about kokkos (e.g., printing the current arch configuration seems generic enough to be in ekat::Core, but the kokkos backend info requires kokkos to be compiled).

The current result seems to be the best compromise between flexibility (for new customers) and robustness (for existing customers).

I have NOT updated mam4xx/haero to use the new ekat, so all their tests may fail to build (or even configure). I am opening the PR anyways, in the hope to get a build of all the rest until mam4xx is update too.

IMPORTANT NOTE FOR REVIEWERS: I strongly recommend to review the commits individually. I tried to group changes by topic, so reviewing one commit may be simpler; ha couple of commits are quite large, but seeing the same pattern over and over may make it easier to review.

@bartgol bartgol self-assigned this May 16, 2025
Copy link
Member

@jgfouca jgfouca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I like the test data refactor.

Copy link
Contributor

@jeff-cohere jeff-cohere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, there's lots of good stuff here. Nicely and carefully done, @bartgol .

@bartgol bartgol force-pushed the bartgol/ekat-update-051425 branch 9 times, most recently from 1046507 to cb4c11d Compare May 22, 2025 20:28
@bartgol
Copy link
Contributor Author

bartgol commented May 22, 2025

@tcclevenger @jeff-cohere @jgfouca The deprecation of ekat::any and ekat::enable_shared_from_this is causing a vast amount of warnings. I suggest we switch to their std counterparts asap. I see three options:

  1. do it in this PR
  2. do it in a follow-up PR
  3. update ekat now (with current ekat master), and do the std change, THEN merge this PR.

Maybe option 3 is best, even though it ends up updating ekat twice in a short time?

@jgfouca
Copy link
Member

jgfouca commented May 22, 2025

1 seems easiest.

@jeff-cohere
Copy link
Contributor

I agree with Jim. 1 would really be "asap". :-)

@tcclevenger
Copy link
Contributor

I agree, 1.

@bartgol bartgol force-pushed the bartgol/ekat-update-051425 branch 9 times, most recently from 8af2326 to 5d63a77 Compare May 27, 2025 22:26
Copy link

github-actions bot commented May 27, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://E3SM-Project.github.io/E3SM/pr-preview/pr-7362/

Built to branch gh-pages at 2025-08-01 19:06 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@bartgol bartgol force-pushed the bartgol/ekat-update-051425 branch from 5d63a77 to e302fb3 Compare May 27, 2025 23:24
@bartgol bartgol force-pushed the bartgol/ekat-update-051425 branch from 7c8b232 to d6c364c Compare July 30, 2025 00:05
@bartgol bartgol force-pushed the bartgol/ekat-update-051425 branch from d6c364c to 878c029 Compare July 30, 2025 20:13
@bartgol bartgol marked this pull request as ready for review July 30, 2025 21:06
bartgol added a commit that referenced this pull request Jul 30, 2025
Update the EKAT submodule and change EAMxx to conform to the new version of EKAT.

[BFB]
bartgol added a commit that referenced this pull request Aug 1, 2025
Update the EKAT submodule and change EAMxx to conform to the new version of EKAT.
@bartgol bartgol merged commit 5dc34ab into master Aug 4, 2025
21 checks passed
@bartgol bartgol deleted the bartgol/ekat-update-051425 branch August 4, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants