Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
code simplification
[simgrid.git] / src / kernel / activity / CommImpl.cpp
index 1b61834..c5b8e12 100644 (file)
@@ -6,8 +6,8 @@
 #include "src/kernel/activity/CommImpl.hpp"
 
 #include "simgrid/modelchecker.h"
-#include "src/mc/mc_replay.h"
-#include "src/simix/smx_network_private.h"
+#include "src/mc/mc_replay.hpp"
+#include "src/simix/smx_network_private.hpp"
 #include "src/surf/surf_interface.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_network);
@@ -61,7 +61,6 @@ void simgrid::kernel::activity::CommImpl::cancel()
   if (state == SIMIX_WAITING) {
     mbox->remove(this);
     state = SIMIX_CANCELED;
-    this->unref();
   } 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)) {
 
@@ -72,11 +71,7 @@ void simgrid::kernel::activity::CommImpl::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 surf_comm->getRemains();
 }
 
 /** @brief This is part of the cleanup process, probably an internal command */