if (synchro->state_ != SIMIX_WAITING && synchro->state_ != SIMIX_RUNNING) {
SIMIX_comm_finish(synchro);
} else { /* we need a sleep action (even when there is no timeout) to be notified of host failures */
- simgrid::kernel::resource::Action* sleep = simcall->issuer->host_->pimpl_cpu->sleep(timeout);
+ simgrid::kernel::resource::Action* sleep = simcall->issuer->get_host()->pimpl_cpu->sleep(timeout);
sleep->set_data(synchro.get());
simgrid::kernel::activity::CommImplPtr comm =
if (timeout < 0.0){
simcall->timer = NULL;
} else {
- simcall->timer = SIMIX_timer_set(SIMIX_get_clock() + timeout, [simcall]() {
+ simcall->timer = simgrid::simix::Timer::set(SIMIX_get_clock() + timeout, [simcall]() {
SIMIX_waitany_remove_simcall_from_actions(simcall);
simcall_comm_waitany__set__result(simcall, -1);
SIMIX_simcall_answer(simcall);
if (simcall->call == SIMCALL_COMM_WAITANY) {
SIMIX_waitany_remove_simcall_from_actions(simcall);
if (simcall->timer) {
- SIMIX_timer_remove(simcall->timer);
+ simcall->timer->remove();
simcall->timer = nullptr;
}
if (not MC_is_active() && not MC_record_replay_is_active())
/* Check out for errors */
- if (not simcall->issuer->host_->is_on()) {
+ if (not simcall->issuer->get_host()->is_on()) {
simcall->issuer->context_->iwannadie = true;
- simcall->issuer->exception =
+ simcall->issuer->exception_ =
std::make_exception_ptr(simgrid::HostFailureException(XBT_THROW_POINT, "Host failed"));
} else {
switch (comm->state_) {
break;
case SIMIX_SRC_TIMEOUT:
- simcall->issuer->exception = std::make_exception_ptr(
+ simcall->issuer->exception_ = std::make_exception_ptr(
simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the sender"));
break;
case SIMIX_DST_TIMEOUT:
- simcall->issuer->exception = std::make_exception_ptr(
+ simcall->issuer->exception_ = std::make_exception_ptr(
simgrid::TimeoutError(XBT_THROW_POINT, "Communication timeouted because of the receiver"));
break;
if (simcall->issuer == comm->src_actor_)
simcall->issuer->context_->iwannadie = true;
else
- simcall->issuer->exception =
+ simcall->issuer->exception_ =
std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Remote peer failed"));
break;
if (simcall->issuer == comm->dst_actor_)
simcall->issuer->context_->iwannadie = true;
else
- simcall->issuer->exception =
+ simcall->issuer->exception_ =
std::make_exception_ptr(simgrid::NetworkFailureException(XBT_THROW_POINT, "Remote peer failed"));
break;
case SIMIX_LINK_FAILURE:
XBT_DEBUG("Link failure in synchro %p between '%s' and '%s': posting an exception to the issuer: %s (%p) "
"detached:%d",
- synchro.get(), comm->src_actor_ ? comm->src_actor_->host_->get_cname() : nullptr,
- comm->dst_actor_ ? comm->dst_actor_->host_->get_cname() : nullptr, simcall->issuer->get_cname(),
- simcall->issuer, comm->detached);
+ synchro.get(), comm->src_actor_ ? comm->src_actor_->get_host()->get_cname() : nullptr,
+ comm->dst_actor_ ? comm->dst_actor_->get_host()->get_cname() : nullptr,
+ simcall->issuer->get_cname(), simcall->issuer, comm->detached);
if (comm->src_actor_ == simcall->issuer) {
XBT_DEBUG("I'm source");
} else if (comm->dst_actor_ == simcall->issuer) {
case SIMIX_CANCELED:
if (simcall->issuer == comm->dst_actor_)
- simcall->issuer->exception = std::make_exception_ptr(
+ simcall->issuer->exception_ = std::make_exception_ptr(
simgrid::CancelException(XBT_THROW_POINT, "Communication canceled by the sender"));
else
- simcall->issuer->exception = std::make_exception_ptr(
+ simcall->issuer->exception_ = std::make_exception_ptr(
simgrid::CancelException(XBT_THROW_POINT, "Communication canceled by the receiver"));
break;
}
/* if there is an exception during a waitany or a testany, indicate the position of the failed communication */
- if (simcall->issuer->exception &&
+ if (simcall->issuer->exception_ &&
(simcall->call == SIMCALL_COMM_WAITANY || simcall->call == SIMCALL_COMM_TESTANY)) {
// First retrieve the rank of our failing synchro
int rank = -1;
// In order to modify the exception we have to rethrow it:
try {
- std::rethrow_exception(simcall->issuer->exception);
+ std::rethrow_exception(simcall->issuer->exception_);
} catch (simgrid::TimeoutError& e) {
e.value = rank;
- simcall->issuer->exception = std::make_exception_ptr(e);
+ simcall->issuer->exception_ = std::make_exception_ptr(e);
} catch (simgrid::NetworkFailureException& e) {
e.value = rank;
- simcall->issuer->exception = std::make_exception_ptr(e);
+ simcall->issuer->exception_ = std::make_exception_ptr(e);
} catch (simgrid::CancelException& e) {
e.value = rank;
- simcall->issuer->exception = std::make_exception_ptr(e);
+ simcall->issuer->exception_ = std::make_exception_ptr(e);
}
}
}
}
- if (simcall->issuer->host_->is_on())
+ if (simcall->issuer->get_host()->is_on())
SIMIX_simcall_answer(simcall);
else
simcall->issuer->context_->iwannadie = true;