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

Fix guards OpenMP and GPU execution policy guards in signed_distance API #1192

Open
kennyweiss opened this issue Sep 27, 2023 · 1 comment
Open
Labels
App Integration Issues related to integration with applications bug Something isn't working Reviewed User Request Issues related to user requests

Comments

@kennyweiss
Copy link
Member

A user reported an error in how we handle execution policy guards in the signed distance API.
Specifically, we're using #ifdef in some cases but should actually be using #ifndef guards.

See #1191 for a proposed bugfix.
(Specifically, the changes to signed_distance.cpp)

We might consider using this as an opportunity to clean up this section of the code.
Specifically, should the SignedDistExec::OpenMP enum case be defined in configurations that don't have OpenMP? Or would it be better to avoid this problem by either

  • defining only the valid enum cases for the configuration
    E.g. something like changing the enum definition from this
    // Signed Distance execution policies
    enum class SignedDistExec
    {
    CPU = 0,
    OpenMP = 1,
    GPU = 2
    };

    to
enum class SignedDistExec
{
  CPU = 0
#if defined(AXOM_USE_OPENMP) && defined(AXOM_USE_RAJA)
  , OpenMP = 1
#endif
#if defined(AXOM_USE_GPU) && defined(AXOM_USE_RAJA)
  , GPU = 2
#endif
};
  • or, keeping the enum as it is and adding an isValid(SignedDistanceExec) method that can better isolate the checks

This might depend on expectations about how users are using the SignedDistanceExec enum.

@kennyweiss kennyweiss added bug Something isn't working App Integration Issues related to integration with applications User Request Issues related to user requests labels Sep 27, 2023
@cyrush
Copy link
Member

cyrush commented Sep 27, 2023

since this could be an issue in multiple places, should we move to use axom-wide execution polices?
(instead of ones for specific algorithms)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Integration Issues related to integration with applications bug Something isn't working Reviewed User Request Issues related to user requests
Projects
None yet
Development

No branches or pull requests

2 participants