* It let us know how to unserialize at the end of the communication */
MPI_Datatype old_type_;
size_t size_;
- int src_;
- int dst_;
+ aid_t src_;
+ aid_t dst_;
int tag_;
// to handle cases where we have an unknown sender
// We can't override src, tag, and size, because the request may be reused later
- int real_src_;
+ aid_t real_src_;
int real_tag_;
bool truncated_;
size_t real_size_;
public:
Request() = default;
- Request(const void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm, unsigned flags, MPI_Op op = MPI_REPLACE);
+ Request(const void* buf, int count, MPI_Datatype datatype, aid_t src, aid_t dst, int tag, MPI_Comm comm,
+ unsigned flags, MPI_Op op = MPI_REPLACE);
MPI_Comm comm() const { return comm_; }
size_t size() const { return size_; }
size_t real_size() const { return real_size_; }
- int src() const { return src_; }
- int dst() const { return dst_; }
+ aid_t src() const { return src_; }
+ aid_t dst() const { return dst_; }
int tag() const { return tag_; }
int flags() const { return flags_; }
bool detached() const { return detached_; }
namespace simgrid{
namespace smpi{
-Request::Request(const void* buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm,
+Request::Request(const void* buf, int count, MPI_Datatype datatype, aid_t src, aid_t dst, int tag, MPI_Comm comm,
unsigned flags, MPI_Op op)
: buf_(const_cast<void*>(buf))
, old_type_(datatype)
{
xbt_assert(sender, "Cannot match against null sender");
xbt_assert(receiver, "Cannot match against null receiver");
- XBT_DEBUG("Trying to match %s of sender src %d against %d, tag %d against %d, id %d against %d",
+ XBT_DEBUG("Trying to match %s of sender src %ld against %ld, tag %d against %d, id %d against %d",
(req == receiver ? "send" : "recv"), sender->src_, receiver->src_, sender->tag_, receiver->tag_,
sender->comm_->id(), receiver->comm_->id());
void Request::print_request(const char* message) const
{
- XBT_VERB("%s request %p [buf = %p, size = %zu, src = %d, dst = %d, tag = %d, flags = %x]",
- message, this, buf_, size_, src_, dst_, tag_, flags_);
+ XBT_VERB("%s request %p [buf = %p, size = %zu, src = %ld, dst = %ld, tag = %d, flags = %x]", message, this, buf_,
+ size_, src_, dst_, tag_, flags_);
}
/* factories, to hide the internal flags from the caller */
MPI_REQ_PERSISTENT | MPI_REQ_ISEND | MPI_REQ_SEND | MPI_REQ_PREPARED);
}
-
MPI_Request Request::rma_send_init(const void *buf, int count, MPI_Datatype datatype, int src, int dst, int tag, MPI_Comm comm,
MPI_Op op)
{
MPI_Request Request::recv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
{
- int source = MPI_PROC_NULL;
+ aid_t source = MPI_PROC_NULL;
if (src == MPI_ANY_SOURCE)
source = MPI_ANY_SOURCE;
else if (src != MPI_PROC_NULL)
MPI_Op op)
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
- int source = MPI_PROC_NULL;
+ aid_t source = MPI_PROC_NULL;
if (src == MPI_ANY_SOURCE)
source = MPI_ANY_SOURCE;
else if (src != MPI_PROC_NULL)
MPI_Request Request::irecv_init(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
{
- int source = MPI_PROC_NULL;
+ aid_t source = MPI_PROC_NULL;
if (src == MPI_ANY_SOURCE)
source = MPI_ANY_SOURCE;
else if (src != MPI_PROC_NULL)
return request;
}
-
MPI_Request Request::irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm)
{
MPI_Request request = nullptr; /* MC needs the comm to be set to nullptr during the call */
- int source = MPI_PROC_NULL;
+ aid_t source = MPI_PROC_NULL;
if (src == MPI_ANY_SOURCE)
source = MPI_ANY_SOURCE;
else if (src != MPI_PROC_NULL)
void *recvbuf, int recvcount, MPI_Datatype recvtype, int src, int recvtag,
MPI_Comm comm, MPI_Status * status)
{
- int source = MPI_PROC_NULL;
+ aid_t source = MPI_PROC_NULL;
if (src == MPI_ANY_SOURCE)
source = MPI_ANY_SOURCE;
else if (src != MPI_PROC_NULL)
source = comm->group()->actor(src);
- int destination = dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL;
+ aid_t destination = dst != MPI_PROC_NULL ? comm->group()->actor(dst) : MPI_PROC_NULL;
std::array<MPI_Request, 2> requests;
std::array<MPI_Status, 2> stats;
- int myid = simgrid::s4u::this_actor::get_pid();
+ aid_t myid = simgrid::s4u::this_actor::get_pid();
if ((destination == myid) && (source == myid)) {
Datatype::copy(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype);
if (status != MPI_STATUS_IGNORE) {
mut->unlock();
} else { /* the RECV flag was not set, so this is a send */
const simgrid::smpi::ActorExt* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
- xbt_assert(process, "Actor pid=%d is gone??", dst_);
+ xbt_assert(process, "Actor pid=%ld is gone??", dst_);
if (TRACE_smpi_view_internals())
TRACE_smpi_send(src_, src_, dst_, tag_, size_);
this->print_request("New send");
Status::empty(status);
status->MPI_SOURCE = MPI_PROC_NULL;
} else {
- int src = req->src_ == MPI_ANY_SOURCE ? req->real_src_ : req->src_;
+ aid_t src = req->src_ == MPI_ANY_SOURCE ? req->real_src_ : req->src_;
status->MPI_SOURCE = req->comm_->group()->rank(src);
status->MPI_TAG = req->tag_ == MPI_ANY_TAG ? req->real_tag_ : req->tag_;
status->MPI_ERROR = req->truncated_ ? MPI_ERR_TRUNCATE : MPI_SUCCESS;
*flag=1;
if(req != MPI_REQUEST_NULL &&
status != MPI_STATUS_IGNORE) {
- int src = req->src_ == MPI_ANY_SOURCE ? req->real_src_ : req->src_;
+ aid_t src = req->src_ == MPI_ANY_SOURCE ? req->real_src_ : req->src_;
status->MPI_SOURCE = req->comm_->group()->rank(src);
status->MPI_TAG = req->tag_ == MPI_ANY_TAG ? req->real_tag_ : req->tag_;
status->MPI_ERROR = req->truncated_ ? MPI_ERR_TRUNCATE : MPI_SUCCESS;