-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
retval = MPI_ERR_TAG;
} else {
int my_proc_id = simgrid::s4u::Actor::self()->getPid();
- int src_traced = getPid(comm, src);
TRACE_smpi_comm_in(my_proc_id, __FUNCTION__,
new simgrid::instr::Pt2PtTIData("recv", src,
datatype->is_replayable() ? count : count * datatype->size(),
// the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE)
if (status != MPI_STATUS_IGNORE) {
- src_traced = getPid(comm, status->MPI_SOURCE);
+ int src_traced = getPid(comm, status->MPI_SOURCE);
if (not TRACE_smpi_view_internals()) {
TRACE_smpi_recv(src_traced, my_proc_id, tag);
}
retval = MPI_ERR_COMM;
} else if (not sendtype->is_valid() || not recvtype->is_valid()) {
retval = MPI_ERR_TYPE;
- } else if (src == MPI_PROC_NULL || dst == MPI_PROC_NULL) {
- simgrid::smpi::Status::empty(status);
- status->MPI_SOURCE = MPI_PROC_NULL;
- retval = MPI_SUCCESS;
+ } else if (src == MPI_PROC_NULL) {
+ if(status!=MPI_STATUS_IGNORE){
+ simgrid::smpi::Status::empty(status);
+ status->MPI_SOURCE = MPI_PROC_NULL;
+ }
+ if(dst != MPI_PROC_NULL)
+ 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;
}else if (dst >= comm->group()->size() || dst <0 ||
(src!=MPI_ANY_SOURCE && (src >= comm->group()->size() || src <0))){
retval = MPI_ERR_RANK;