-/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2022. 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. */
detached_ = false;
detached_sender_ = nullptr;
real_src_ = 0;
+ // get src_host if it's available (src is valid)
+ auto src_process = simgrid::s4u::Actor::by_pid(src);
+ if (src_process)
+ src_host_ = src_process->get_host();
truncated_ = false;
unmatched_types_ = false;
real_size_ = 0;
receiver->src_ == sender->src_) &&
((receiver->tag_ == MPI_ANY_TAG && sender->tag_ >= 0) || receiver->tag_ == sender->tag_)) {
// we match, we can transfer some values
- if (receiver->src_ == MPI_ANY_SOURCE)
+ if (receiver->src_ == MPI_ANY_SOURCE) {
receiver->real_src_ = sender->src_;
+ receiver->src_host_ = sender->src_host_;
+ }
if (receiver->tag_ == MPI_ANY_TAG)
receiver->real_tag_ = sender->tag_;
if ((receiver->flags_ & MPI_REQ_PROBE) == 0 ){
double sleeptime = 0.0;
if (detached_ || ((flags_ & (MPI_REQ_ISEND | MPI_REQ_SSEND)) != 0)) { // issend should be treated as isend
// isend and send timings may be different
- sleeptime = ((flags_ & MPI_REQ_ISEND) != 0)
- ? simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->oisend(size_)
- : simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->osend(size_);
+ sleeptime =
+ ((flags_ & MPI_REQ_ISEND) != 0)
+ ? simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->oisend(
+ size_, simgrid::s4u::Actor::by_pid(src_)->get_host(), simgrid::s4u::Actor::by_pid(dst_)->get_host())
+ : simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->osend(
+ size_, simgrid::s4u::Actor::by_pid(src_)->get_host(),
+ simgrid::s4u::Actor::by_pid(dst_)->get_host());
}
if(sleeptime > 0.0){
XBT_DEBUG("Exception in testany");
return 0;
}
-
+
if (i != -1) { // -1 is not MPI_UNDEFINED but a SIMIX return code. (nothing matches)
*index = map[i];
if (requests[*index] != MPI_REQUEST_NULL && (requests[*index]->flags_ & MPI_REQ_GENERALIZED) &&
}else{
*outflag=0;
}
- if (ret != MPI_SUCCESS)
+ if (ret != MPI_SUCCESS)
error = 1;
}else{
Status::empty(pstat);
status[i] = *pstat;
}
}
- if(error==1)
+ if (error == 1)
return MPI_ERR_IN_STATUS;
- else
+ else
return MPI_SUCCESS;
}
/*(seconds * flop/s -> total flops)*/ smpi_iprobe_sleep * speed * maxrate)
->set_name("iprobe")
/* Not the entire CPU can be used when iprobing: This is important for
- * the energy consumption caused by polling with iprobes.
+ * the energy consumption caused by polling with iprobes.
* Note also that the number of flops that was
* computed above contains a maxrate factor and is hence reduced (maxrate < 1)
*/
- ->set_bound(maxrate*speed)
+ ->set_bound(maxrate * speed)
->start()
->wait();
}
}
if(req->detached_sender_ != nullptr){
//integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
- double sleeptime =
- simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->orecv(req->real_size());
+ simgrid::s4u::Host* dst_host = simgrid::s4u::Actor::by_pid(req->dst_)->get_host();
+ double sleeptime = simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->orecv(
+ req->real_size(), req->src_host_, dst_host);
if (sleeptime > 0.0) {
simgrid::s4u::this_actor::sleep_for(sleeptime);
XBT_DEBUG("receiving size of %zu : sleep %f ", req->real_size_, sleeptime);
indices[count] = index;
count++;
for (int i = 0; i < incount; i++) {
- if (i!=index && requests[i] != MPI_REQUEST_NULL
- && not(requests[i]->flags_ & MPI_REQ_FINISHED)) {
+ if (i != index && requests[i] != MPI_REQUEST_NULL && not(requests[i]->flags_ & MPI_REQ_FINISHED)) {
test(&requests[i], pstat,&flag);
if (flag==1){
indices[count] = i;