-
Notifications
You must be signed in to change notification settings - Fork 10
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
non-contiguous Impl::irecv
#32
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.
I think the Packer
object and its logic should be outlined also in the source code.
src/KokkosComm_request.hpp
Outdated
} | ||
|
||
template <Invokable Fn> | ||
void call_and_drop_at_wait(const Fn &f) { |
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.
For consistency with keep_until_wait(rv)
consider renaming this to keep_until_wait_and_execute
and the args could be the callback (unpacker) and the rv.
src/impl/KokkosComm_irecv.hpp
Outdated
|
||
template <KokkosExecutionSpace ExecSpace, KokkosView RecvView, typename MpiArgs> | ||
struct IrecvUnpacker { | ||
IrecvUnpacker(const ExecSpace &space, RecvView &rv, MpiArgs &args) |
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.
Consider move into KokkosComm::Impl::Packer
using Packer = typename KCPT::packer_type; | ||
using Args = typename Packer::args_type; | ||
|
||
Args args = Packer::allocate_packed_for(space, "packed", rv); |
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.
Maybe use allocate_packed_for
also in the isend
and send
implementation
The unit test part of this is done better in #37 |
Hi @cwpearson, what is still missing for this PR to be merged? |
@dssgabriel could you please review #37 so that can go in. In the mean time, I can address some of the comments on this PR |
Impl::irecv
, improve unit testing outputImpl::irecv
9711464
to
4d1b31d
Compare
Add an interface to KokkosComm:Req to register a callable at wait(). Use that interface to invoke unpack operations (if needed) at wait(). Add packer_type to MpiArgs. Make failures off rank 0 somewhat visible in the unit tests.
Co-authored-by: Daniel Arndt <[email protected]>
Co-authored-by: Daniel Arndt <[email protected]>
Co-authored-by: Daniel Arndt <[email protected]>
Apart from a review approval, is there anything else missing in this PR? It would be nice to have it merged 🙂 |
There are a lot of merge conflicts. |
} else { | ||
using SendScalar = typename SendView::value_type; | ||
mpi_isend_fn(KCT::data_handle(sv), KCT::span(sv), mpi_type_v<SendScalar>, dest, tag, comm, &req.mpi_req()); | ||
mpi_isend_fn(KCT::data_handle(sv), KCT::span(sv), mpi_type_v<SendScalar>, dest, tag, comm, &req->mpi_req()); |
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.
Somewhat out of scope, but: there needs to be a fence before the send to make sure all computation on the execution space has completed.
template <Invokable Fn> | ||
void call_and_drop_at_wait(const Fn &f) { | ||
wait_callbacks_.push_back(std::make_shared<InvokableHolder<Fn>>(f)); | ||
} |
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.
Suggest perfect forwarding to avoid copies (needs similar change to InvokableHolder
):
template <Invokable Fn> | |
void call_and_drop_at_wait(const Fn &f) { | |
wait_callbacks_.push_back(std::make_shared<InvokableHolder<Fn>>(f)); | |
} | |
template <Invokable Fn> | |
void call_and_drop_at_wait(Fn &&f) { | |
wait_callbacks_.push_back(std::make_shared<InvokableHolder<Fn>>(std::forward<Fn>(f))); | |
} |
Replacement for #9
Add an interface to KokkosComm:Req to register a callable at wait(). Use that interface to invoke unpack operations (if needed) at wait(). Add packer_type to MpiArgs.