Skip to content

Fix axom::copy so it can be called from OpenMP loop#1894

Merged
BradWhitlock merged 4 commits into
developfrom
bugfix/whitlock/axom_copy_umpire
Jun 29, 2026
Merged

Fix axom::copy so it can be called from OpenMP loop#1894
BradWhitlock merged 4 commits into
developfrom
bugfix/whitlock/axom_copy_umpire

Conversation

@BradWhitlock

Copy link
Copy Markdown
Member

This PR resolves #1724 where using axom::copy from an OpenMP loop when Umpire is enabled can result in a fatal problem where multiple threads attempt to construct the Umpire resource manager.

  • Introduce std::call_once initialization to get the Umpire objects
  • Use the cached objects in axom::copy.
  • Added a test

@kennyweiss kennyweiss left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @BradWhitlock !

Comment thread src/axom/core/memory_management.hpp
Comment thread src/axom/core/memory_management.hpp

// Resolve Umpire's fallback HOST path once so the first threaded axom::copy()
// cannot race through lazy resource creation.
std::call_once(once, []() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@BradWhitlock BradWhitlock merged commit 9be7101 into develop Jun 29, 2026
15 checks passed
@BradWhitlock BradWhitlock deleted the bugfix/whitlock/axom_copy_umpire branch June 29, 2026 16:55
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.

Potential race condition in axom::copy when Umpire is enabled.

3 participants