}
std::string display_size() override { return std::to_string(send_size > 0 ? send_size : recv_size); }
};
+
+/**
+ * If we want to wait for a request of asynchronous communication, we need to be able
+ * to identify this request. We do this by searching for a request identified by (src, dest, tag).
+ */
+class WaitTIData : public TIData {
+ int src;
+ int dest;
+ int tag;
+
+public:
+ explicit WaitTIData(int src, int dest, int tag) : TIData("wait"), src(src), dest(dest), tag(tag){};
+
+ std::string print() override
+ {
+ std::stringstream stream;
+ stream << getName() << " " << src << " " << dest << " " << tag;
+
+ return stream.str();
+ }
+
+ std::string display_size() override { return ""; }
+};
}
}
int my_proc_id = (*request)->comm() != MPI_COMM_NULL
? simgrid::s4u::this_actor::get_pid()
: -1; // TODO: cheinrich: Check if this correct or if it should be MPI_UNDEFINED
- TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("wait"));
+ TRACE_smpi_comm_in(my_proc_id, __func__,
+ new simgrid::instr::WaitTIData((*request)->src(), (*request)->dst(), (*request)->tag()));
simgrid::smpi::Request::wait(request, status);
retval = MPI_SUCCESS;
// MPI_REQUEST_NULL by Request::wait!
bool is_wait_for_receive = (request->flags() & MPI_REQ_RECV);
// TODO: Here we take the rank while we normally take the process id (look for my_proc_id)
- TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("wait"));
+ TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::WaitTIData(args.src, args.dst, args.tag));
MPI_Status status;
Request::wait(&request, &status);