- if (request == nullptr) {
- retval = MPI_ERR_ARG;
- } else if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
- } else if (dst == MPI_PROC_NULL) {
- *request = MPI_REQUEST_NULL;
- retval = MPI_SUCCESS;
- } else if (dst >= comm->group()->size() || dst <0){
- retval = MPI_ERR_RANK;
- } else if ((count < 0) || (buf==nullptr && count > 0)) {
- retval = MPI_ERR_COUNT;
- } else if (not datatype->is_valid()) {
- retval = MPI_ERR_TYPE;
- } else if(tag<0 && tag != MPI_ANY_TAG){
- retval = MPI_ERR_TAG;
- } 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 retval = 0;
+ 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);