Skip to content

Update EKAT#8088

Merged
tcclevenger merged 2 commits into
E3SM-Project:masterfrom
tcclevenger:tcclevenger/update_ekat_aurora_fixes
Feb 24, 2026
Merged

Update EKAT#8088
tcclevenger merged 2 commits into
E3SM-Project:masterfrom
tcclevenger:tcclevenger/update_ekat_aurora_fixes

Conversation

@tcclevenger

Copy link
Copy Markdown
Contributor

Motivation: incorporating changes for Aurora and Chrysalis oneapi-ifx compiler. Other changes included.

[BFB]

@amametjanov amametjanov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know about the other changes, but updates to

  1. cmake/EkatSetCompilerFlags.cmake
  2. extern/kokkos

are good.

@tcclevenger tcclevenger requested a review from bartgol February 17, 2026 20:35
@tcclevenger

Copy link
Copy Markdown
Contributor Author

@bartgol Are the other changes in EKAT ok to pull to master, or is there anything that needs to wait? There's fails in SP which I'll investigate.

@bartgol

bartgol commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

Everything should be tested and safe to use. There have been a few mods in the ekat::Pack package, which I needed in order to use packs with non-builtin types (namely, a Sacado Fad type). But I am using it just fine inside hommexx, in the e3sm fork we have for that project.

That said, I am not using single precision in hommexx+sacado, so there may be some issue there. If you figure out what it is, ping me on any ninja fix PR in ekat (or assign me to it).

@bartgol

bartgol commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

@tcclevenger I just reopened a PR in E3SM-Project/kokkos. I think we need to thread carefully with unmerged PRs when dealing with submodules...

Edit: I think all is good. The kokkos pr was into the e3sm-master branch, and got merged, so we're good as long as we keep pointing to e3sm-master.

@tcclevenger tcclevenger force-pushed the tcclevenger/update_ekat_aurora_fixes branch from 7d75e33 to b056263 Compare February 18, 2026 15:58
Comment on lines -73 to -76
result = max(beta*result,static_cast<const ScalarOut&>(alpha*newVal));
result = max(beta*result,alpha*newVal);
break;
case CombineMode::Min:
result = min(beta*result,static_cast<const ScalarOut&>(alpha*newVal));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@bartgol Not sure why these were needed, but after updating ekat that caused these error messages

E3SM/components/eamxx/src/share/util/eamxx_combine_ops.hpp:73:32: error: invalid ‘static_cast’ from type ‘std::enable_if_t<true, ekat::Pack<double, 16> >’ {aka ‘ekat::Pack<double, 16>’} to type ‘const ekat::Pack<float, 16>&’
   73 |       result = max(beta*result,static_cast<const ScalarOut&>(alpha*newVal));

I think the cast can just be safely removed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this was to allow the compiler to build when ScalarIn and ScalarOut are different, like in this case. When doing max(double,float), assuming the compiler managed to do it, I would expect it to promot float->double, while I wanted all ops to happen in whatever precision the output is, so I casted to the output scalar.

I thought this would be from IO using single-precision for output, but the eamxx FM storing in double precision, but I see that the error comes from the single precision build. I don't think we should have any double in a SP build...

Perhaps we could adjust the static cast so that it doesn't have references; if coeff is already of type ScalarOut (possibly with ref/cv qualifiers), then it's compiled away, otherwise a ScalarOut is constructed from the result).

@bartgol bartgol Feb 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, the error was in combine ops unit test, which does

combine<Update>(two,x,2.0,1.0);

while two and x are packs of Real. We should replace the hard-coded doubles like 1.0 with Real(1.0) (or simply with integers, as those should work), and reinstate the cast (without the reference though, as that doesn't play well with templates).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, if you do that, there some leftover debugging stuff in the combine ops unit tests. Can you prune it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yep, I think that's it. Thanks!

@tcclevenger tcclevenger force-pushed the tcclevenger/update_ekat_aurora_fixes branch from eee2d6c to 6adef18 Compare February 19, 2026 16:58
@tcclevenger tcclevenger requested review from bartgol and removed request for bartgol February 23, 2026 19:28
@tcclevenger

tcclevenger commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

@bartgol This look good to merge to you? Even though it changes Kokkos, it's a single line so I don't think we need to do next testing?

@bartgol bartgol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

EKAT changes are only impacting eamxx, and the one-liner change in kokkos should not affect any existing run, so I am in favor of merging.

tcclevenger added a commit that referenced this pull request Feb 24, 2026
Motivation: incorporating changes for Aurora and Chrysalis oneapi-ifx compiler. Other changes included.

[BFB]
@tcclevenger tcclevenger merged commit c4b884d into E3SM-Project:master Feb 24, 2026
24 of 25 checks passed
@tcclevenger tcclevenger deleted the tcclevenger/update_ekat_aurora_fixes branch February 24, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BFB PR leaves answers BFB EKAT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants