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)
+ if (auto src_process = simgrid::s4u::Actor::by_pid(src))
src_host_ = src_process->get_host();
truncated_ = false;
unmatched_types_ = false;
std::array<MPI_Request, 2> requests;
std::array<MPI_Status, 2> stats;
- aid_t myid = simgrid::s4u::this_actor::get_pid();
- if ((destination == myid) && (source == myid)) {
+ if (aid_t myid = simgrid::s4u::this_actor::get_pid(); (destination == myid) && (source == myid)) {
Datatype::copy(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype);
if (status != MPI_STATUS_IGNORE) {
status->MPI_SOURCE = source;
mailbox = process->mailbox();
XBT_DEBUG("Is there a corresponding recv already posted in the large mailbox %s?", mailbox->get_cname());
- simgrid::kernel::activity::ActivityImplPtr action = mailbox->iprobe(1, &match_send, static_cast<void*>(this));
- if (action == nullptr) {
+ if (not mailbox->iprobe(1, &match_send, static_cast<void*>(this))) {
if ((flags_ & MPI_REQ_SSEND) == 0) {
mailbox = process->mailbox_small();
XBT_DEBUG("No, nothing in the large mailbox, message is to be sent on the small one %s",
mailbox = process->mailbox_small();
XBT_DEBUG("SSEND : Is there a corresponding recv already posted in the small mailbox %s?",
mailbox->get_cname());
- action = mailbox->iprobe(1, &match_send, static_cast<void*>(this));
- if (action == nullptr) {
+ if (not mailbox->iprobe(1, &match_send, static_cast<void*>(this))) {
XBT_DEBUG("No, we are first, send to large mailbox");
mailbox = process->mailbox();
}
*count = 0;
for (int i = 0; i < incount; i++) {
if (requests[i] != MPI_REQUEST_NULL && not (requests[i]->flags_ & MPI_REQ_FINISHED)) {
- int ret = test(&requests[i], pstat, &flag);
- if(ret!=MPI_SUCCESS)
+ if (test(&requests[i], pstat, &flag) != MPI_SUCCESS)
error = 1;
if(flag) {
indices[*count] = i;
if(req->detached_sender_ != nullptr){
//integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
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) {
+ if (double sleeptime = simgrid::s4u::Actor::self()->get_host()->extension<simgrid::smpi::Host>()->orecv(
+ req->real_size(), req->src_host_, dst_host);
+ sleeptime > 0.0) {
simgrid::s4u::this_actor::sleep_for(sleeptime);
XBT_DEBUG("receiving size of %zu : sleep %f ", req->real_size_, sleeptime);
}
// this is not a detached send
kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
kernel::actor::ActivityWaitSimcall observer{issuer, (*request)->action_.get(), -1};
- kernel::actor::simcall_blocking(
- [&observer] { observer.get_activity()->wait_for(observer.get_issuer(), observer.get_timeout()); },
- &observer);
+ kernel::actor::simcall_blocking([issuer, &observer] { observer.get_activity()->wait_for(issuer, -1); },
+ &observer);
} catch (const CancelException&) {
XBT_VERB("Request cancelled");
}