we crash properly when needed, but don't return it properly if errhandler is meant not to crash
datatype->is_replayable() ? count : count * datatype->size(),
tag, simgrid::smpi::Datatype::encode(datatype)));
- simgrid::smpi::Request::recv(buf, count, datatype, src, tag, comm, status);
- retval = MPI_SUCCESS;
+ 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;
simgrid::smpi::Request::send(sendbuf, sendcount, sendtype, dst, sendtag, comm);
retval = MPI_SUCCESS;
} else if (dst == MPI_PROC_NULL){
- simgrid::smpi::Request::recv(recvbuf, recvcount, recvtype, src, recvtag, comm, status);
- retval = MPI_SUCCESS;
+ retval = simgrid::smpi::Request::recv(recvbuf, recvcount, recvtype, src, recvtag, comm, status);
} else if (dst >= comm->group()->size() || dst <0 ||
(src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0))){
retval = MPI_ERR_RANK;
static MPI_Request issend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
static MPI_Request irecv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm);
- static void recv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status* status);
+ static int recv(void* buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status* status);
static void bsend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
static void send(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
static void ssend(const void* buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
return request;
}
-void Request::recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status)
+int Request::recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status)
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
request = irecv(buf, count, datatype, src, tag, comm);
- wait(&request,status);
+ int retval = wait(&request,status);
request = nullptr;
+ return retval;
}
void Request::bsend(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
ret = ((*request)->generalized_funcs)->query_fn(((*request)->generalized_funcs)->extra_state, mystatus);
}
+ if ((*request)->truncated_)
+ ret = MPI_ERR_TRUNCATE;
+
finish_wait(request, status); // may invalidate *request
if (*request != MPI_REQUEST_NULL && (((*request)->flags_ & MPI_REQ_NON_PERSISTENT) != 0))
*request = MPI_REQUEST_NULL;