void simgrid::kernel::activity::CommImpl::post() { /* Update synchro state */ if (src_timeout && src_timeout->get_state() == simgrid::kernel::resource::Action::State::FINISHED) state_ = SIMIX_SRC_TIMEOUT; else if (dst_timeout && dst_timeout->get_state() == simgrid::kernel::resource::Action::State::FINISHED) state_ = SIMIX_DST_TIMEOUT; else if (src_timeout && src_timeout->get_state() == simgrid::kernel::resource::Action::State::FAILED) state_ = SIMIX_SRC_HOST_FAILURE; else if (dst_timeout && dst_timeout->get_state() == simgrid::kernel::resource::Action::State::FAILED) state_ = SIMIX_DST_HOST_FAILURE; else if (surfAction_ && surfAction_->get_state() == simgrid::kernel::resource::Action::State::FAILED) { state_ = SIMIX_LINK_FAILURE; } else state_ = SIMIX_DONE; XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d", this, (int)state_, src_proc, dst_proc, detached); /* destroy the surf actions associated with the Simix communication */ cleanupSurf(); /* if there are simcalls associated with the synchro, then answer them */ if (not simcalls_.empty()) { SIMIX_comm_finish(this); } }
void simgrid::kernel::activity::Comm::post() { /* Update synchro state */ if (src_timeout && src_timeout->getState() == simgrid::surf::Action::State::done) state = SIMIX_SRC_TIMEOUT; else if (dst_timeout && dst_timeout->getState() == simgrid::surf::Action::State::done) state = SIMIX_DST_TIMEOUT; else if (src_timeout && src_timeout->getState() == simgrid::surf::Action::State::failed) state = SIMIX_SRC_HOST_FAILURE; else if (dst_timeout && dst_timeout->getState() == simgrid::surf::Action::State::failed) state = SIMIX_DST_HOST_FAILURE; else if (surf_comm && surf_comm->getState() == simgrid::surf::Action::State::failed) { state = SIMIX_LINK_FAILURE; } else state = SIMIX_DONE; XBT_DEBUG("SIMIX_post_comm: comm %p, state %d, src_proc %p, dst_proc %p, detached: %d", this, (int)state, src_proc, dst_proc, detached); /* destroy the surf actions associated with the Simix communication */ cleanupSurf(); /* if there are simcalls associated with the synchro, then answer them */ if (!simcalls.empty()) SIMIX_comm_finish(this); }
simgrid::kernel::activity::CommImpl::~CommImpl() { XBT_DEBUG("Really free communication %p", this); cleanupSurf(); if (detached && state_ != SIMIX_DONE) { /* the communication has failed and was detached: * we have to free the buffer */ if (clean_fun) clean_fun(src_buff); src_buff = nullptr; } if (mbox) mbox->remove(this); }