XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
-static int getPid(MPI_Comm comm, int id)
+static aid_t getPid(MPI_Comm comm, int id)
{
return comm->group()->actor(id);
}
retval = MPI_ERR_REQUEST;
} else {
MPI_Request req = *request;
- int my_proc_id = (req->comm() != MPI_COMM_NULL) ? simgrid::s4u::this_actor::get_pid() : -1;
+ aid_t my_proc_id = (req->comm() != MPI_COMM_NULL) ? simgrid::s4u::this_actor::get_pid() : -1;
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("Start", req->dst(),
req->size(),
}
}
if(retval != MPI_ERR_REQUEST) {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("Startall"));
if (not TRACE_smpi_view_internals())
for (int i = 0; i < count; i++) {
CHECK_IRECV_INPUTS
smpi_bench_end();
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("irecv", src,
datatype->is_replayable() ? count : count * datatype->size(),
smpi_bench_end();
int retval = 0;
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int trace_dst = getPid(comm, dst);
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t trace_dst = getPid(comm, dst);
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("isend", dst,
datatype->is_replayable() ? count : count * datatype->size(),
CHECK_ISEND_INPUTS
smpi_bench_end();
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int trace_dst = getPid(comm, dst);
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t trace_dst = getPid(comm, dst);
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("ISsend", dst,
datatype->is_replayable() ? count : count * datatype->size(),
} else if (src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0)){
retval = MPI_ERR_RANK;
} else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("recv", src,
datatype->is_replayable() ? count : count * datatype->size(),
retval = simgrid::smpi::Request::recv(buf, count, datatype, src, tag, comm, status);
// the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
- int src_traced=0;
- if (status != MPI_STATUS_IGNORE)
- src_traced = getPid(comm, status->MPI_SOURCE);
- else
- src_traced = getPid(comm, src);
if (not TRACE_smpi_view_internals()) {
+ aid_t src_traced = (status != MPI_STATUS_IGNORE) ? getPid(comm, status->MPI_SOURCE) : getPid(comm, src);
TRACE_smpi_recv(src_traced, my_proc_id, tag);
}
CHECK_SEND_INPUTS
smpi_bench_end();
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int dst_traced = getPid(comm, dst);
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t dst_traced = getPid(comm, dst);
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("send", dst,
datatype->is_replayable() ? count : count * datatype->size(),
CHECK_SEND_INPUTS
smpi_bench_end();
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int dst_traced = getPid(comm, dst);
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t dst_traced = getPid(comm, dst);
int bsend_buf_size = 0;
void* bsend_buf = nullptr;
smpi_process()->bsend_buffer(&bsend_buf, &bsend_buf_size);
int size = datatype->get_extent() * count;
- if(bsend_buf==nullptr || bsend_buf_size < size + MPI_BSEND_OVERHEAD )
+ if (bsend_buf == nullptr || bsend_buf_size < size + MPI_BSEND_OVERHEAD) {
+ smpi_bench_begin();
return MPI_ERR_BUFFER;
+ }
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("bsend", dst,
datatype->is_replayable() ? count : count * datatype->size(),
CHECK_ISEND_INPUTS
smpi_bench_end();
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int trace_dst = getPid(comm, dst);
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t trace_dst = getPid(comm, dst);
int bsend_buf_size = 0;
void* bsend_buf = nullptr;
smpi_process()->bsend_buffer(&bsend_buf, &bsend_buf_size);
int size = datatype->get_extent() * count;
- if(bsend_buf==nullptr || bsend_buf_size < size + MPI_BSEND_OVERHEAD )
+ if (bsend_buf == nullptr || bsend_buf_size < size + MPI_BSEND_OVERHEAD) {
+ smpi_bench_begin();
return MPI_ERR_BUFFER;
+ }
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("ibsend", dst,
datatype->is_replayable() ? count : count * datatype->size(),
CHECK_SEND_INPUTS
smpi_bench_end();
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int dst_traced = getPid(comm, dst);
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t dst_traced = getPid(comm, dst);
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::Pt2PtTIData("Ssend", dst,
datatype->is_replayable() ? count : count * datatype->size(),
(src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0))){
retval = MPI_ERR_RANK;
} else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int dst_traced = getPid(comm, dst);
- int src_traced = getPid(comm, src);
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t dst_traced = getPid(comm, dst);
+ aid_t src_traced = getPid(comm, src);
// FIXME: Hack the way to trace this one
auto dst_hack = std::make_shared<std::vector<int>>();
}
retval = MPI_SUCCESS;
} else {
- int my_proc_id = ((*request)->comm() != MPI_COMM_NULL) ? simgrid::s4u::this_actor::get_pid() : -1;
+ aid_t my_proc_id = ((*request)->comm() != MPI_COMM_NULL) ? simgrid::s4u::this_actor::get_pid() : -1;
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("test"));
retval = simgrid::smpi::Request::test(request,status, flag);
if (index == nullptr || flag == nullptr) {
retval = MPI_ERR_ARG;
} else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("testany"));
retval = simgrid::smpi::Request::testany(count, requests, index, flag, status);
TRACE_smpi_comm_out(my_proc_id);
if (flag == nullptr) {
retval = MPI_ERR_ARG;
} else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("testall"));
retval = simgrid::smpi::Request::testall(count, requests, flag, statuses);
TRACE_smpi_comm_out(my_proc_id);
if (outcount == nullptr) {
retval = MPI_ERR_ARG;
} else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ aid_t my_proc_id = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(my_proc_id, __func__, new simgrid::instr::NoOpTIData("testsome"));
retval = simgrid::smpi::Request::testsome(incount, requests, outcount, indices, status);
TRACE_smpi_comm_out(my_proc_id);
const simgrid::smpi::Request* req = *request;
// Requests already received are null. Is this request a wait for RECV?
if (req != MPI_REQUEST_NULL && (req->flags() & MPI_REQ_RECV)) {
- int src_traced = req->src();
- int dst_traced = req->dst();
+ aid_t src_traced = req->src();
+ aid_t dst_traced = req->dst();
// the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
if (src_traced == MPI_ANY_SOURCE && status != MPI_STATUS_IGNORE)
src_traced = req->comm()->group()->actor(status->MPI_SOURCE);
} else {
// for tracing, save the handle which might get overridden before we can use the helper on it
MPI_Request savedreq = *request;
- if (savedreq != MPI_REQUEST_NULL && not(savedreq->flags() & MPI_REQ_FINISHED)
- && not(savedreq->flags() & MPI_REQ_GENERALIZED))
+ if (savedreq != MPI_REQUEST_NULL && not(savedreq->flags() & (MPI_REQ_FINISHED | MPI_REQ_GENERALIZED | MPI_REQ_NBC)))
savedreq->ref();//don't erase the handle in Request::wait, we'll need it later
else
savedreq = MPI_REQUEST_NULL;
- int my_proc_id = (*request)->comm() != MPI_COMM_NULL ? simgrid::s4u::this_actor::get_pid() : -1;
+ aid_t my_proc_id = (*request)->comm() != MPI_COMM_NULL ? simgrid::s4u::this_actor::get_pid() : -1;
TRACE_smpi_comm_in(my_proc_id, __func__,
new simgrid::instr::WaitTIData((*request)->src(), (*request)->dst(), (*request)->tag()));
// for tracing, save the handles which might get overridden before we can use the helper on it
std::vector<MPI_Request> savedreqs(requests, requests + count);
for (MPI_Request& req : savedreqs) {
- if (req != MPI_REQUEST_NULL && not(req->flags() & MPI_REQ_FINISHED))
+ if (req != MPI_REQUEST_NULL && not(req->flags() & (MPI_REQ_FINISHED | MPI_REQ_NBC)))
req->ref();
else
req = MPI_REQUEST_NULL;
}
- int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
+ aid_t rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitAny", count));
*index = simgrid::smpi::Request::waitany(count, requests, status);
// for tracing, save the handles which might get overridden before we can use the helper on it
std::vector<MPI_Request> savedreqs(requests, requests + count);
for (MPI_Request& req : savedreqs) {
- if (req != MPI_REQUEST_NULL && not(req->flags() & MPI_REQ_FINISHED))
+ if (req != MPI_REQUEST_NULL && not(req->flags() & (MPI_REQ_FINISHED | MPI_REQ_NBC)))
req->ref();
else
req = MPI_REQUEST_NULL;
}
- int rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
+ aid_t rank_traced = simgrid::s4u::this_actor::get_pid(); // FIXME: In PMPI_Wait, we check if the comm is null?
TRACE_smpi_comm_in(rank_traced, __func__, new simgrid::instr::CpuTIData("waitall", count));
int retval = simgrid::smpi::Request::waitall(count, requests, status);