-
Notifications
You must be signed in to change notification settings - Fork 146
A simpler way to deal with the mismatching layouts between the user code and the memory space #3976
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
Conversation
a94c4eb to
13e272c
Compare
b5a23a7 to
5439f1c
Compare
|
Cleaning history after which this PR is ready for review |
eisenhauer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I see looks good. Did you have tests to add?
…t to adjust the variable dimensions
5439f1c to
4db0f2c
Compare
For now I only have examples, I agree I should add tests to the BP GPU suite. Maybe I'll find time tonight. |
…ith different layout combinations
4db0f2c to
71ad750
Compare
|
The testing needs to be a separate PR (I will bring this up tomorrow) but basically we only have testing for Cuda and single mpi rank right now, so I want to redesign the whole testing for the GPU-aware functionality to include the layout and other memory spaces. For now, the examples are testing what I would put in the tests anyway so they would pass. |
A simpler way of switching the dimensions for GPU by using two Layout members in VariableBase to keep track of the base layout (RowMajor for C++ and ColumnMajor for Fortran) and the buffer layout (RowMajor for CPU pointers and ColumnMajor for GPU pointers). If there is a mismatch between the two dimensions are switched.
This PR closes #3961
Tested in C++.
Tested in Fortran.
Currently the fortran example needs another library that takes care of the interoperability between Kokkos and Fortran: https://github.com/kokkos/kokkos-fortran-interop
Kokkos Views have a concept of Layout. ADIOS2 will capture this when users give Views to their Get/Put call and update the variable correspondingly. There is a new example to test this.
Future documentation
I will update the documentation in a future PR on how to compile and run the fortran and the new layout examples as well as the new changes to the
Shapefunction that can now take a memory space and a layout to return the correct dimensions.Future testing
The only things tested right now are: the logic when creating a variable, when calling
SetSelectionand when callingShape(for using Put/Get with different layouts). We might need testing for other ways of users setting the dimensions of the variable (on write and read -- to be designed later)