-
Notifications
You must be signed in to change notification settings - Fork 9
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
Issue 502 - Implements new read_array templates dim3 absorbing boundaries write/read #503
Conversation
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.
One minor suggestion.
write(IOUT) | ||
|
||
! Converting the logical arrays to integer arrays and writing them as ints | ||
! call save_logical_nspec_array(ispec_is_acoustic) |
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.
Should this be commented?
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.
Yes, I initially wrote a function to write an integer array instead of the boolean array. But the error was something else. I think here, I agree with the last comment, that we should assign integers to the array in terms of which element is what, and then read those integers on the CPP side into tags.
I did not do that yet to move on with the rest of the file since reading the boolean array was not the issue.
template <typename T> using View2D = Kokkos::View<T **, Kokkos::HostSpace>; | ||
|
||
template <typename T> using View3D = Kokkos::View<T ***, Kokkos::HostSpace>; | ||
|
||
template <typename T> using View4D = Kokkos::View<T ****, Kokkos::HostSpace>; | ||
|
||
template <typename T> using View5D = Kokkos::View<T *****, Kokkos::HostSpace>; | ||
|
||
template <typename T> void read_array(std::ifstream &stream, View1D<T> &array); | ||
|
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.
Should these be a single function? We could have a function like this -
template <typename ViewType>
void read_array(std::ifstream &stream, ViewType &array);
then have template specializations for different dimensions
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.
Yes, that can be done!
Description
This PR implements
Kokkos::View
reads of 2D and 3D views forread_array
andread_index_array
.Issue Number
Closes #502
Checklist
Please make sure to check developer documentation on specfem docs.