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

Initial MIR component #1438

Open
wants to merge 323 commits into
base: develop
Choose a base branch
from
Open

Initial MIR component #1438

wants to merge 323 commits into from

Conversation

BradWhitlock
Copy link
Member

@BradWhitlock BradWhitlock commented Oct 3, 2024

This PR is adds an initial MIR component to Axom. EquiZ MIR was implemented as the first algorithm because it was more familiar and my first goal was to shake out problems with infrastructure for writing algorithms against Blueprint data. The MIR algorithm takes Blueprint input and generates Blueprint output.

This PR does the following:

  • Supercedes previous MIR work (previous work was either adapted or moved to "reference" directory)
  • Implements EquiZ (without iteration for now) that runs on CPU/GPU and works on 2D/3D meshes with various topology and shape types.
  • Provides views to simplify writing algorithms that use Blueprint data.
  • Provides several utility classes that perform mesh operations (extract zones, merge meshes, etc.)
  • Adds documentation
  • Adds example programs
  • Adds a little core infrastructure

NOTE:

  • The Elvira algorithm will be added in a future PR.
  • The previous serial MIR implementation was moved to a "reference" directory that we can remove once EquiZAlgorithm has iteration support (future work).
  • The component requires Conduit, RAJA, Umpire - I'll probably have to iterate with the CI some to make that work everywhere.
  • There are some files that changed because of "make style"

data Outdated
Copy link
Member

@kennyweiss kennyweiss Oct 30, 2024

Choose a reason for hiding this comment

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

@BradWhitlock -- Will there be an axom_data PR associated with this PR?

Copy link
Member Author

@BradWhitlock BradWhitlock Oct 31, 2024

Choose a reason for hiding this comment

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

Yes. I added a few YAML files for some CI test results. I made a PR for the test baselines.

Copy link
Member

@kennyweiss kennyweiss left a comment

Choose a reason for hiding this comment

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

My first attempt at a review -- all the stuff that's not MIR.

Comment on lines +277 to +279
if args.ninja:
cmakeline += ' -G "Ninja"'

Copy link
Member

Choose a reason for hiding this comment

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

👍

Comment on lines 41 to 48
# Add MIR if the prerequisites are found.
if(RAJA_FOUND AND UMPIRE_FOUND AND CONDUIT_FOUND)
axom_add_component(COMPONENT_NAME mir
DEFAULT_STATE ${AXOM_ENABLE_ALL_COMPONENTS})
else()
message(STATUS "Axom Component MIR turned off due to missing RAJA, UMPIRE, or Conduit.")
set(AXOM_ENABLE_MIR OFF CACHE BOOL "")
endif()
Copy link
Member

Choose a reason for hiding this comment

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

This is different than how we handle missing deps in other components. E.g. sidre has a hard dependency on conduit (and inlet and klee depend on sidre), but we don't enforce this at the add_component level.

It might be a good idea to revisit that choice, but I think we should be consistent across the components.

Copy link
Member Author

Choose a reason for hiding this comment

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

@kennyweiss - I am making a change to add mir always via axom_add_component. It does fail during configuration when requirements such as RAJA or Conduit are not present. That's what we want. Unfortunately, that makes host-configs such as [email protected] fail to build Axom. That feels like a step backwards. In cases like that, I'm planning to add an explicit set(AXOM_ENABLE_MIR FALSE CACHE BOOL "") so these host-configs continue to work. Any objections?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops. That host-config is just something I have locally. If there is a versioned host-config that lacks MIR required libraries, the plan is to add set(AXOM_ENABLE_MIR FALSE CACHE BOOL "").

Copy link
Member Author

Choose a reason for hiding this comment

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

I ended up adding MIR always (in the style of other components) and then adjusted a few CI builds so they pass -DAXOM_ENABLE_MIR:BOOL=OFF if they lack the required tpls.

Comment on lines +68 to +69
AXOM_HOST_DEVICE T* data() noexcept { return &m_data[0]; }
AXOM_HOST_DEVICE const T* data() const noexcept { return &m_data[0]; }
Copy link
Member

Choose a reason for hiding this comment

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

Since these have the same return type/value as operator T*, I assume they're necessary for consistency w/ an expected interface

Should the const overload be marked as constexpr?

Copy link
Member

Choose a reason for hiding this comment

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

These are really nice! We can probably use them in several places throughout axom.

src/axom/core/utilities/BitUtilities.hpp Outdated Show resolved Hide resolved
using MaterialID = int;
using MaterialIDArray = axom::Array<MaterialID>;
using MaterialIDView = axom::ArrayView<MaterialID>;
using MaterialVF = float;

Choose a reason for hiding this comment

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

Is float a design choice over double?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but I think I could change it to use the material view's FloatType for MaterialVF so it stays true to the types specified in the material view. I think I had some compiler problems in this code but I could try again.

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

Successfully merging this pull request may close these issues.

5 participants