14 void* buffer,
int count, MPI_Datatype type,
int root_rank, MPI_Comm c,
18 if (root == util::comm_rank(c)) {
19 buf = MPIBuffer::copy(buffer, count, type);
21 buf = MPIBuffer::wrap(buffer, count, type);
27 CollectiveLog::operator=(std::move(o));
29 buf = std::move(o.buf);
36 serialize::read(i, root);
37 serialize::read(i, buf);
39 void serialize_impl(std::ostream& s)
const override {
40 serialize::write(s, root);
41 serialize::write(s, buf);
44 std::string str()
const override {
45 return "Bcast " + std::to_string(m_idx) +
46 " (root = " + std::to_string(root) +
")";
49 int begin(MPI_Comm c)
const override {
51 int ret = PMPI_Ibcast(buf, buf, buf, root, c, req());
52 if (ret == MPI_SUCCESS) ret = PMPI_Wait(req(), MPI_STATUS_IGNORE);
54 buf.release_user_buf();
58 void replay(MPI_Comm c)
const override {
60 int ret = PMPI_Ibcast(buf, buf, buf, root, c, req());
62 ret == MPI_SUCCESS,
"Non-process MPI error during collective replay\n"