CHECK_COUNT(2, count)\
CHECK_TYPE(3, datatype)\
CHECK_PROC(4, dst)\
+ CHECK_RANK(4, dst, comm)\
CHECK_TAG(5, tag)\
CHECK_COMM(6)\
CHECK_COUNT(2, count)\
CHECK_TYPE(3, datatype)\
CHECK_PROC(4, src)\
+ if(src!=MPI_ANY_SOURCE)\
+ CHECK_RANK(4, src, comm)\
CHECK_TAG(5, tag)\
CHECK_COMM(6)
/* PMPI User level calls */
CHECK_IRECV_INPUTS
smpi_bench_end();
- int retval = 0;
- 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();
-
- TRACE_smpi_comm_in(my_proc_id, __func__,
- new simgrid::instr::Pt2PtTIData("irecv", src,
- datatype->is_replayable() ? count : count * datatype->size(),
- tag, simgrid::smpi::Datatype::encode(datatype)));
-
- *request = simgrid::smpi::Request::irecv(buf, count, datatype, src, tag, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(my_proc_id);
- }
-
+ int 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(),
+ tag, simgrid::smpi::Datatype::encode(datatype)));
+ *request = simgrid::smpi::Request::irecv(buf, count, datatype, src, tag, comm);
+ TRACE_smpi_comm_out(my_proc_id);
smpi_bench_begin();
- return retval;
+ return MPI_SUCCESS;
}
smpi_bench_end();
int retval = 0;
- if (dst >= comm->group()->size() || dst <0){
- retval = MPI_ERR_RANK;
- } else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int 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(),
- tag, simgrid::smpi::Datatype::encode(datatype)));
-
- TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
-
- *request = simgrid::smpi::Request::isend(buf, count, datatype, dst, tag, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(my_proc_id);
- }
-
+ int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ int 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(),
+ tag, simgrid::smpi::Datatype::encode(datatype)));
+ TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
+ *request = simgrid::smpi::Request::isend(buf, count, datatype, dst, tag, comm);
+ retval = MPI_SUCCESS;
+ TRACE_smpi_comm_out(my_proc_id);
smpi_bench_begin();
return retval;
CHECK_ISEND_INPUTS
smpi_bench_end();
- int retval = 0;
- if (dst >= comm->group()->size() || dst <0){
- retval = MPI_ERR_RANK;
- } else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int 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(),
- tag, simgrid::smpi::Datatype::encode(datatype)));
- TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
-
- *request = simgrid::smpi::Request::issend(buf, count, datatype, dst, tag, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(my_proc_id);
- }
-
+ int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ int 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(),
+ tag, simgrid::smpi::Datatype::encode(datatype)));
+ TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
+ *request = simgrid::smpi::Request::issend(buf, count, datatype, dst, tag, comm);
+ TRACE_smpi_comm_out(my_proc_id);
smpi_bench_begin();
- return retval;
+ return MPI_SUCCESS;
}
int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status)
CHECK_SEND_INPUTS
smpi_bench_end();
- int retval = 0;
- if (dst >= comm->group()->size() || dst <0){
- retval = MPI_ERR_RANK;
- } else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int 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(),
- tag, simgrid::smpi::Datatype::encode(datatype)));
- if (not TRACE_smpi_view_internals()) {
- TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
- }
-
- simgrid::smpi::Request::send(buf, count, datatype, dst, tag, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(my_proc_id);
+ int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ int 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(),
+ tag, simgrid::smpi::Datatype::encode(datatype)));
+ if (not TRACE_smpi_view_internals()) {
+ TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
}
-
+ simgrid::smpi::Request::send(buf, count, datatype, dst, tag, comm);
+ TRACE_smpi_comm_out(my_proc_id);
smpi_bench_begin();
- return retval;
+ return MPI_SUCCESS;
}
int PMPI_Rsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
CHECK_SEND_INPUTS
smpi_bench_end();
- int retval = 0;
- if (dst >= comm->group()->size() || dst <0){
- retval = MPI_ERR_RANK;
- } else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int 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 )
- 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(),
- tag, simgrid::smpi::Datatype::encode(datatype)));
- if (not TRACE_smpi_view_internals()) {
- TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
- }
-
- simgrid::smpi::Request::bsend(buf, count, datatype, dst, tag, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(my_proc_id);
+ int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ int 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 )
+ 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(),
+ tag, simgrid::smpi::Datatype::encode(datatype)));
+ if (not TRACE_smpi_view_internals()) {
+ TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
}
-
+ simgrid::smpi::Request::bsend(buf, count, datatype, dst, tag, comm);
+ TRACE_smpi_comm_out(my_proc_id);
smpi_bench_begin();
- return retval;
+ return MPI_SUCCESS;
}
int PMPI_Ibsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
CHECK_ISEND_INPUTS
smpi_bench_end();
- int retval = 0;
- if (dst >= comm->group()->size() || dst <0){
- retval = MPI_ERR_RANK;
- } else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int 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 )
- 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(),
- tag, simgrid::smpi::Datatype::encode(datatype)));
-
- TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
-
- *request = simgrid::smpi::Request::ibsend(buf, count, datatype, dst, tag, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(my_proc_id);
- }
-
+ int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ int 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 )
+ 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(),
+ tag, simgrid::smpi::Datatype::encode(datatype)));
+ TRACE_smpi_send(my_proc_id, my_proc_id, trace_dst, tag, count * datatype->size());
+ *request = simgrid::smpi::Request::ibsend(buf, count, datatype, dst, tag, comm);
+ TRACE_smpi_comm_out(my_proc_id);
smpi_bench_begin();
- if (retval != MPI_SUCCESS && request!=nullptr)
- *request = MPI_REQUEST_NULL;
- return retval;
+ return MPI_SUCCESS;
}
int PMPI_Bsend_init(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request* request)
CHECK_SEND_INPUTS
smpi_bench_end();
- int retval = 0;
- if (dst >= comm->group()->size() || dst <0){
- retval = MPI_ERR_RANK;
- } else {
- int my_proc_id = simgrid::s4u::this_actor::get_pid();
- int 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(),
- tag, simgrid::smpi::Datatype::encode(datatype)));
- TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
-
- simgrid::smpi::Request::ssend(buf, count, datatype, dst, tag, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(my_proc_id);
- }
-
+ int my_proc_id = simgrid::s4u::this_actor::get_pid();
+ int 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(),
+ tag, simgrid::smpi::Datatype::encode(datatype)));
+ TRACE_smpi_send(my_proc_id, my_proc_id, dst_traced, tag, count * datatype->size());
+ simgrid::smpi::Request::ssend(buf, count, datatype, dst, tag, comm);
+ TRACE_smpi_comm_out(my_proc_id);
smpi_bench_begin();
- return retval;
+ return MPI_SUCCESS;
}
int PMPI_Sendrecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, int sendtag, void* recvbuf,
int recvcount, MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status* status)
{
int retval = 0;
-
- smpi_bench_end();
CHECK_BUFFER(1, sendbuf, sendcount)
CHECK_COUNT(2, sendcount)
CHECK_TYPE(3, sendtype)
CHECK_TYPE(8, recvtype)
CHECK_TAG(10, recvtag)
CHECK_COMM(11)
+ smpi_bench_end();
+
if (src == MPI_PROC_NULL) {
if(status!=MPI_STATUS_IGNORE){
simgrid::smpi::Status::empty(status);
simgrid::smpi::Status::empty(status);
- CHECK_REQUEST(1)
+ CHECK_NULL(1, MPI_ERR_ARG, request)
if (*request == MPI_REQUEST_NULL) {
retval = MPI_SUCCESS;
} else {