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 bin index to DoF ID mapping bug in adaptive libMesh meshes #3206

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

nuclearkevin
Copy link
Contributor

@nuclearkevin nuclearkevin commented Nov 25, 2024

Description

#3185 added support for adaptive mesh-based libMesh tallies in applications that use OpenMC's C/C++ API, which was enabled by a bin index to element DoF ID map (and it's corresponding inverse map). These maps are generated by looping over all local active elements, which works fine when running with OpenMP. When running with MPI libMesh "assigns" elements to each processor, and sets up local element iterators to only loop over those assigned elements. This results in a partial map for bin indices to DoF IDs being generated. Unfortunately, I only tested #3185 in serial and with shared memory parallelism which allowed this bug to slip through the cracks.

This PR fixes this bug by using the non-local element iterators / number of elements.

Checklist

  • I have performed a self-review of my own code
  • I have run clang-format (version 15) on any C++ source files (if applicable)
  • I have followed the style guidelines for Python source files (if applicable)
  • I have made corresponding changes to the documentation (if applicable)
  • I have added tests that prove my fix is effective or that my feature works (if applicable)

Copy link
Contributor

@pshriwise pshriwise left a comment

Choose a reason for hiding this comment

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

This makes sense to me. Thanks @nuclearkevin!

@pshriwise pshriwise merged commit a9fe2a0 into openmc-dev:develop Nov 27, 2024
16 checks passed
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.

2 participants