13 const void* send,
void* recv,
int count, MPI_Datatype type, MPI_Op o,
17 sbuf(MPIBuffer::copy(send == MPI_IN_PLACE ? recv : send, count, type)),
18 rbuf(MPIBuffer::wrap(recv, count, type)) {}
22 CollectiveLog::operator=(std::move(o));
24 sbuf = std::move(o.sbuf);
25 rbuf = std::move(o.rbuf);
32 serialize::read(i, op);
33 serialize::read(i, sbuf);
34 rbuf = MPIBuffer::create(sbuf, sbuf);
36 void serialize_impl(std::ostream& s)
const override {
37 serialize::write(s, op);
38 serialize::write(s, sbuf);
41 std::string str()
const override {
42 return "Allreduce " + std::to_string(m_idx);
45 int begin(MPI_Comm c)
const override {
47 int ret = PMPI_Iallreduce(sbuf, rbuf, sbuf, sbuf, op, c, req());
48 if (ret == MPI_SUCCESS) ret = PMPI_Wait(req(), MPI_STATUS_IGNORE);
50 rbuf.release_user_buf();
54 void replay(MPI_Comm c)
const override {
56 int ret = PMPI_Iallreduce(sbuf, rbuf, sbuf, sbuf, op, c, req());
58 ret == MPI_SUCCESS,
"Non-process MPI error during collective replay\n"