14 const void* send,
void* recv,
int count, MPI_Datatype type, MPI_Op o,
18 sbuf(MPIBuffer::copy(send == MPI_IN_PLACE ? recv : send, count, type)),
19 rbuf(MPIBuffer::wrap(recv, count, type)) {}
23 CollectiveLog::operator=(std::move(o));
25 sbuf = std::move(o.sbuf);
26 rbuf = std::move(o.rbuf);
33 serialize::read(i, op);
34 serialize::read(i, sbuf);
35 rbuf = MPIBuffer::create(sbuf, sbuf);
37 void serialize_impl(std::ostream& s)
const override {
38 serialize::write(s, op);
39 serialize::write(s, sbuf);
42 std::string str()
const override {
43 return "Allreduce " + std::to_string(m_idx);
46 int begin(MPI_Comm c)
const override {
48 int ret = PMPI_Iallreduce(sbuf, rbuf, sbuf, sbuf, op, c, req());
49 if (ret == MPI_SUCCESS) ret = PMPI_Wait(req(), MPI_STATUS_IGNORE);
51 rbuf.release_user_buf();
55 void replay(MPI_Comm c)
const override {
57 int ret = PMPI_Iallreduce(sbuf, rbuf, sbuf, sbuf, op, c, req());
59 ret == MPI_SUCCESS,
"Non-process MPI error during collective replay\n"