LvArray icon indicating copy to clipboard operation
LvArray copied to clipboard

Changes supporting GEOSX Trilinos/Tpetra wrapper

Open klevzoff opened this issue 5 years ago • 5 comments

This PR adds a simple function in ArrayView (and NewChaiBuffer) to get the data pointer in a specific MemorySpace, whether most current or not.

While this should not be needed/used by most developers, Tpetra implements dual memory space semantics, meaning that Tpetra::Vector for example contains pointers in both host and device memory spaces, and can potentially move data between them as needed. Therefore, in order to support the zero-copy creation of parallel vectors from ArrayView of local values, we have to be able to deliver pointers in both memory spaces.

Related to https://github.com/GEOSX/GEOSX/pull/1086

klevzoff avatar Aug 03 '20 06:08 klevzoff

Note: code in GEOSX that uses this is currently disabled behind an #if 0, because I found out some Tpetra-based solvers only work reliably with Unified Memory, and so the zero-copy dual-view semantics cannot be implemented. So this PR could in principle be abandoned, however I though it might be useful in future.

klevzoff avatar Aug 08 '20 06:08 klevzoff

Note: code in GEOSX that uses this is currently disabled behind an #if 0, because I found out some Tpetra-based solvers only work reliably with Unified Memory, and so the zero-copy dual-view semantics cannot be implemented. So this PR could in principle be abandoned, however I though it might be useful in future.

Do we need to update Trilinos?

rrsettgast avatar Aug 10 '20 14:08 rrsettgast

Do we need to update Trilinos?

No, there's no new version available. And it's not something they seem to have fixed yet. All Tpetra build instructions, FAQs, etc. explicitly require configuring Kokkos to use UM as default memory space for CUDA.

klevzoff avatar Aug 10 '20 16:08 klevzoff

Do we need to update Trilinos?

No, there's no new version available. And it's not something they seem to have fixed yet. All Tpetra build instructions, FAQs, etc. explicitly require configuring Kokkos to use UM as default memory space for CUDA.

🤦

rrsettgast avatar Aug 10 '20 17:08 rrsettgast

No, there's no new version available. And it's not something they seem to have fixed yet. All Tpetra build instructions, FAQs, etc. explicitly require configuring Kokkos to use UM as default memory space for CUDA.

🤦

We can always just allocate the matrix with unified memory, it would be pretty easy to add that support.

corbett5 avatar Aug 10 '20 17:08 corbett5