Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Dec 9, 2023
1 parent 76d238b commit 9a0ad2c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/wrench/simgrid_S4U_util/S4U_CommPort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,15 @@ namespace wrench {
}

if (log) WRENCH_DEBUG("Getting a message from commport '%s' with timeout %lf sec", this->s4u_mb->get_cname(), timeout);
SimulationMessage *msg;

SimulationMessage *msg_mb;
SimulationMessage *msg_mq;

WRENCH_INFO("IN GET MESSAGE FOR COMMPORT %p", this);
simgrid::s4u::ActivitySet pending_receives;
auto mb_comm = this->s4u_mb->get_async<SimulationMessage>(&msg);
auto mb_comm = this->s4u_mb->get_async<SimulationMessage>(&msg_mb);
pending_receives.push(mb_comm);
auto mq_comm = this->s4u_mq->get_async<SimulationMessage>(&msg);
auto mq_comm = this->s4u_mq->get_async<SimulationMessage>(&msg_mq);
pending_receives.push(mq_comm);

WRENCH_INFO("IN GET MESSAGE: %p(%s) %p(%s)",
Expand Down Expand Up @@ -151,14 +153,18 @@ namespace wrench {

WRENCH_DEBUG("Got the message\n");

SimulationMessage *msg = nullptr;

WRENCH_INFO("XXX IN GET MESSAGE NBEFIORE CENCEL");
if (finished_recv == mb_comm) {
msg = msg_mb;
WRENCH_INFO("IT WAS THE MB_COM");
WRENCH_INFO("CANCELING %p", mq_comm.get());
mq_comm->cancel();
WRENCH_INFO("WAITING ON %p", mb_comm.get());
// mb_comm->wait();
} else if (finished_recv == mq_comm) {
msg = msg_mq;
mb_comm->cancel();
// mq_comm->wait();
}
Expand Down

0 comments on commit 9a0ad2c

Please sign in to comment.