From: Augustin Degomme Date: Tue, 17 May 2022 12:27:44 +0000 (+0000) Subject: Merge branch 'dev-fix-get-eager-activities' into 'master' X-Git-Tag: v3.32~242 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cae6ec1dd7be471ac6eb6c4fbc809a6647687d33?hp=fbf9b818a646c6ae51571104a56182f3e509ccc7 Merge branch 'dev-fix-get-eager-activities' into 'master' add eager get comms to actor activities See merge request simgrid/simgrid!96 --- diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index 4c4db3a7d6..0dc962a8f6 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -300,18 +300,19 @@ ActivityImplPtr CommImpl::irecv(actor::CommIrecvSimcall* observer) // find a match in the list of already received comms other_comm = mbox->find_matching_comm(CommImplType::SEND, observer->get_match_fun(), observer->get_payload(), this_synchro, /*done*/ true, /*remove_matching*/ true); - // if not found, assume the receiver came first, register it to the mailbox in the classical way - if (not other_comm) { - XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request " - "into list"); - other_comm = std::move(this_synchro); - mbox->push(other_comm); + if (other_comm && other_comm->surf_action_ && other_comm->get_remaining() < 1e-12) { + XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get()); + other_comm->set_state(State::DONE); + other_comm->set_mailbox(nullptr); } else { - if (other_comm->surf_action_ && other_comm->get_remaining() < 1e-12) { - XBT_DEBUG("comm %p has been already sent, and is finished, destroy it", other_comm.get()); - other_comm->set_state(State::DONE); - other_comm->set_mailbox(nullptr); + // if not found, assume the receiver came first, register it to the mailbox in the classical way + if (not other_comm) { + XBT_DEBUG("We have messages in the permanent receive list, but not the one we are looking for, pushing request " + "into list"); + other_comm = std::move(this_synchro); + mbox->push(other_comm); } + observer->get_issuer()->activities_.emplace_back(other_comm); } } else { /* Prepare a comm describing us, so that it gets passed to the user-provided filter of other side */