llnl / llnl/axom

Fix guards OpenMP and GPU execution policy guards in signed_distance API

Open
#1,192 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

App Integration bug Reviewed User Request
Dominant language
C++
Stars
196
Forks
34
Avg merge
4d 1h
Merged PRs (30d)
11

Description

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 https://github.com/LLNL/axom/pull/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

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the proposed changes to src/axom/quest/interface/signed_distance.cpp in pull request #1191, then read the SignedDistExec definition in src/axom/quest/interface/signed_distance.hpp. Review the OpenMP and GPU configuration guards and determine whether enum cases should remain available in unsupported configurations or be conditionally defined. Done means the signed-distance API has correct guards and a decided, consistent handling of invalid execution policies.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, hpc
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.