-
Notifications
You must be signed in to change notification settings - Fork 7
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
MPI shared memory #14
base: unstable
Are you sure you want to change the base?
Conversation
92e2e2b
to
1738e29
Compare
// Expose some commonly used attributes | ||
BaseType* base() const noexcept { return static_cast<BaseType*>(get_attr(MPI_WIN_BASE)); } | ||
MPI_Aint size() const noexcept { return *static_cast<MPI_Aint*>(get_attr(MPI_WIN_SIZE)); } | ||
int disp_unit() const noexcept { return *static_cast<int*>(get_attr(MPI_WIN_DISP_UNIT)); } | ||
}; |
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.
Can these function calls be turned into members that are initialized at construction?
|
||
/// Load data from a remote memory window. | ||
template <typename TargetType = BaseType, typename OriginType> | ||
std::enable_if_t<has_mpi_type<OriginType> && has_mpi_type<TargetType>, void> |
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.
Replace std::enable_if
with requires
.
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.
Can we make this non-MPI compatible?
|
||
void free() noexcept { | ||
if (win != MPI_WIN_NULL) { | ||
MPI_Win_free(&win); |
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.
Check that MPI_Win_free
is indeed blocking on all ranks.
All tests were run with multiple nodes and different number of slots on each node:
Some ideas:
MPI allocatorSimilar to
std::allocator
implement ashared_allocator
and adistributed_shared_allocator
, such that one can use e.g.std::vector<double, mpi::shared_allocator<double>>
Questions:
split_shared()
on the default communicator, but for distributed shared memory there needs to be internode communication and that is not easily guessed from the default communicator. Maybe a global hash table with allocation information is needed?On top of that, for distributed shared memory access must be fenced and broadcasted between nodes. That's not so easy to abstract away.