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

MAM4xx sycl errors #2841

Open
oksanaguba opened this issue May 22, 2024 · 5 comments
Open

MAM4xx sycl errors #2841

oksanaguba opened this issue May 22, 2024 · 5 comments

Comments

@oksanaguba
Copy link
Contributor

Tagging @odiazib @overfelt @tcclevenger @bartgol .

There is an error i do not know how to resolve

In file included from /home/onguba/scream-b2/components/../externals/mam4xx/src/mam4xx/calcsize.hpp:14:
/home/onguba/scream-b2/components/../externals/mam4xx/src/mam4xx/conversions.hpp:253:19: error: SYCL kernel cannot call through a function pointer
  253 |   const auto ws = wsat(T, p);
      |                   ^

pointing to code

KOKKOS_INLINE_FUNCTION Real relative_humidity_from_vapor_mixing_ratio(
    Real w, Real T, Real p,
    Real (*wsat)(Real, Real) = saturation_mixing_ratio_hardy) {
  const auto ws = wsat(T, p);
  return w / ws;
}

Other errros so far are only about printf, where i use the same workaround as in homme,

#ifdef KOKKOS_ENABLE_SYCL
    Kokkos::printf ("k = %d\n",k);
#else
    printf ("k = %d\n",k);
#endif

though i am not sure why it is not just kokkos::printf for all builds (maybe i tried that and it did not work).

@tcclevenger
Copy link
Contributor

Re printf: I believe this is something that is fixed in later Kokkos versions (I think 4.2 on, and E3SM is using 3.7). Once we can update kokkos I think these workarounds won't be necessary.

@oksanaguba
Copy link
Contributor Author

@tcclevenger thanks -- my kokkos is pretty updated (branch develop from Apr 26, 2024)

@bartgol
Copy link
Contributor

bartgol commented May 22, 2024

I guess passing a function pointer is problematic. Perhaps you could template on a function type, and pass a lambda.

@tcclevenger
Copy link
Contributor

@tcclevenger thanks -- my kokkos is pretty updated (branch develop from Apr 26, 2024)

Oh interesting. I can find some time to look into the specifics of that change and the SYCL backend.. But if your using april develop those changes would definitely be included.

@odiazib
Copy link
Contributor

odiazib commented May 22, 2024

Hi @oksanaguba, do you require MAM4XX for your simulation? If not, you can disable it by using -DSCREAM_ENABLE_MAM=OFF as suggested by @jeff-cohere in the Emaxx change discussion on Slack. I will proceed to open an issue in the MAM4XX repository to address this.

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

No branches or pull requests

4 participants