-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement serialization and deserialization #93
Conversation
Looking forward to this! I'll probably review tomorrow |
A few big picture thoughts on serialization:
|
PiecewiseDB<NGRIDS> dbh(Spiner::AllocationTarget::Host, NCOARSE, NCOARSE, | ||
NCOARSE); |
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.
These changes were actually unnecessary. I originally had this test merged with the new test, and needed host-side data. However I split them into separate tests for clarity. Nevertheless, there's no harm in this change.
test/test.cpp
Outdated
AND_THEN("They do not point ot the same memory") { | ||
// checks DataBox pointer | ||
REQUIRE(dbh2.data() != dbh.data()); | ||
// checks accessor agrees | ||
REQUIRE(&dbh2(0) != &dbh(0)); | ||
} |
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.
This check is important, as it ensures that we didn't accidentally just create a shallow copy of the original DataBox
.
Tests triggered on re-git. |
tests pass. |
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.
Looks good! Approved with a minor addition to the tests and a question.
PR Summary
Using tabulated data in, e.g., MPI Windows for shared memory requires the ability to serialize a
DataBox
object into pre-allocated shared memory and to build a new thread-local object around said shared memory, so that the object itself is thread-local but it internally points at a table that lives in shared memory. This PR implements this capability.This will be needed for the equivalent capability in
Singularity-EOS
and also provides a prototype for how that model and API will look.PR Checklist