Skip to content

SRFSN: Replace MATMUL intrisics with explicit loops#46

Merged
awnawab merged 5 commits into
ecmwf-ifs:mainfrom
mlange05:naml-srfsn-matmul-fix
Jun 11, 2026
Merged

SRFSN: Replace MATMUL intrisics with explicit loops#46
awnawab merged 5 commits into
ecmwf-ifs:mainfrom
mlange05:naml-srfsn-matmul-fix

Conversation

@mlange05

@mlange05 mlange05 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR is bringing in one of the more subtle changes in the Cy50r3 merge, which requires adjustments of test error norms for the insitu_US_Ha1 test for certain compilers. It simply replaces a set of MATMUL intrinsics in the snow scheme with equivalent explicit loops and adjusts the error tolerances for specific compilers to get the CI runners to pass.

I've also piggy-backed a small fix to an integer KIND declaration in the same file - even though this should be unrelated.

Also tagging @piotrows for visibility.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

piotrows and others added 5 commits June 6, 2026 04:59
The use of MATMUL intrinsics has proven problematic for GPU
compilation with NVHPC-22.11. We've replaced it here with manual SUM
and multiplications, but this was not perfectly bit-identical on CPU.
This fixes various CI test runs follwoing the Cy50r3 update.

@awnawab awnawab left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The changes look good to me ✅ thanks a lot for grinding through what was quite a painful debug session 🙏

@gabardu

gabardu commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

I think that's ok, I'd say over a multi-year run we can confidently use a lower threshold, which I think it is justified if a relatively small change like this introduces deviations. Thanks a lot @mlange05 , good to go for me.

@awnawab awnawab merged commit 2bd9a30 into ecmwf-ifs:main Jun 11, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants