X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/364eee0fc6ab77fddc5437ac273527bd27711724..86e534066dafbcbb2284a75ad76d8258a329d226:/src/kernel/activity/CommImpl.cpp diff --git a/src/kernel/activity/CommImpl.cpp b/src/kernel/activity/CommImpl.cpp index c7517bf5ed..98be4746d6 100644 --- a/src/kernel/activity/CommImpl.cpp +++ b/src/kernel/activity/CommImpl.cpp @@ -4,9 +4,10 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/activity/CommImpl.hpp" +#include "src/kernel/resource/Action.hpp" #include "simgrid/modelchecker.h" -#include "src/mc/mc_replay.h" +#include "src/mc/mc_replay.hpp" #include "src/simix/smx_network_private.hpp" #include "src/surf/surf_interface.hpp" @@ -41,16 +42,16 @@ simgrid::kernel::activity::CommImpl::~CommImpl() void simgrid::kernel::activity::CommImpl::suspend() { /* FIXME: shall we suspend also the timeout synchro? */ - if (surf_comm) - surf_comm->suspend(); + if (surfAction_) + surfAction_->suspend(); /* in the other case, the action will be suspended on creation, in SIMIX_comm_start() */ } void simgrid::kernel::activity::CommImpl::resume() { /*FIXME: check what happen with the timeouts */ - if (surf_comm) - surf_comm->resume(); + if (surfAction_) + surfAction_->resume(); /* in the other case, the synchro were not really suspended yet, see SIMIX_comm_suspend() and SIMIX_comm_start() */ } @@ -64,26 +65,22 @@ void simgrid::kernel::activity::CommImpl::cancel() } else if (not MC_is_active() /* when running the MC there are no surf actions */ && not MC_record_replay_is_active() && (state == SIMIX_READY || state == SIMIX_RUNNING)) { - surf_comm->cancel(); + surfAction_->cancel(); } } /** @brief get the amount remaining from the communication */ double simgrid::kernel::activity::CommImpl::remains() { - if (state == SIMIX_RUNNING) - return surf_comm->getRemains(); - - /* FIXME: check what should be returned in the other cases */ - return 0; + return surfAction_->getRemains(); } /** @brief This is part of the cleanup process, probably an internal command */ void simgrid::kernel::activity::CommImpl::cleanupSurf() { - if (surf_comm) { - surf_comm->unref(); - surf_comm = nullptr; + if (surfAction_) { + surfAction_->unref(); + surfAction_ = nullptr; } if (src_timeout) { @@ -108,7 +105,7 @@ void simgrid::kernel::activity::CommImpl::post() 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) { + else if (surfAction_ && surfAction_->getState() == simgrid::surf::Action::State::failed) { state = SIMIX_LINK_FAILURE; } else state = SIMIX_DONE;