Skip to content

Deep copy from Sidre to Conduit #1510

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

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

Conversation

gunney1
Copy link
Contributor

@gunney1 gunney1 commented Mar 3, 2025

Summary

  • This PR is a feature
  • It does the following:
    • Implement Group::deepCopyToConduit and View::deepCopyToConduit
    • Support copying from one allocator id to another. The allocator ids are set before the copy, and the copy assures destination memory uses the right id.
    • Support Conduit memory allocation using any Axom or Umpire allocator id.
    • Fix bug that always allocates string and scalar View data on host. They now allocate in the default allocator of the Group that owns the View. (We have discussed this in the project meetings, reaching the concensus was that all data should use the default allocator unless individually overridden, despite the fact that many parts of a hierarchy would only be used on the host.)
    • Manually tell a bunch of Views to allocate data on the host, where they are used and expected to be.
    • Add tests for the new methods.

The goal of this change is toward supporting transparent switching between sidre and conduit. With the addition of Group::deepCopyToConduit, the state of conduit-sidre hierarchy copies is:
Screenshot_2025-04-22_06-02-48
* I labeled importConduitTreeExternal as the shallow conduit-to-sidre copy, but it's not exactly analogous to createNativeLayout (the shallow sidre-to-conduit copy).

@gunney1 gunney1 added the Sidre Issues related to Axom's 'sidre' component label Mar 3, 2025
@gunney1 gunney1 self-assigned this Mar 3, 2025
gunney1 added 20 commits March 6, 2025 09:17
The actual fix is on another branch, but I can't wait for it to
be merged.
It's failing.  Maybe because non-Umpire allocators are not
working right or Group isn't using it right.
Also disable test copying in/out of Umpire.
This check needs to wait for proper support for
that kind of copy, which is being performed on
another branch.
change transfer_allocator method name to transferTo.
Also use call-back to return View-specific allocator.
@gunney1 gunney1 force-pushed the feature/gunney/copy-sidre-to-conduit branch from 6764c24 to 41c15d7 Compare March 28, 2025 18:08
@gunney1 gunney1 force-pushed the feature/gunney/copy-sidre-to-conduit branch from 582bbad to 46bb8a7 Compare April 1, 2025 01:06
}
@endcode
*/
struct ConduitMemory
Copy link
Member

Choose a reason for hiding this comment

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

It looks like is does the same job as ConduitAllocateThroughAxom.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a similar idea but it directly supports arbitrary Axom (or Umpire) allocator ids, including those of applications and third-party libraries.

@gunney1 gunney1 changed the title Implement sidre-to-conduit copies Deep copy from Sidre to Conduit Apr 23, 2025
@gunney1 gunney1 added the GPU Issues related to GPU development label Apr 23, 2025
* deep-copied.
*
* The destination's allocator id should be preserved and used for
* array allocations. However, I'm still checking on this.
Copy link
Contributor

Choose a reason for hiding this comment

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

This work-in-progress comment should be resolved prior to merge.


// TODO: Probably wrong to use owning group's default allocator.
// Group can allocate View with non-default allocator.
// int currentAllocId = getOwningGroup()->getDefaultAllocatorID();
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this commented-out section has been resolved and the TODO can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GPU Issues related to GPU development Sidre Issues related to Axom's 'sidre' component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants