Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move NetCard to its own header file
[simgrid.git] / src / surf / surf_interface.cpp
index 01bc6f0..3062d0c 100644 (file)
 #include "simgrid/sg_config.h"
 #include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 #include "src/internal_config.h"
+#include "src/kernel/routing/NetCard.hpp"
 #include "src/simix/smx_host_private.h"
 #include "src/surf/HostImpl.hpp"
 #include "surf_private.h"
-#include "surf_routing.hpp"
 #include <vector>
 
 XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
@@ -344,7 +344,6 @@ void surf_exit()
     delete model;
   delete all_existing_models;
   xbt_dynar_free(&model_list_invoke);
-  routing_exit();
 
   simgrid::surf::surfExitCallbacks();
 
@@ -744,9 +743,14 @@ void Action::suspend()
   XBT_IN("(%p)", this);
   if (suspended_ != 2) {
     lmm_update_variable_weight(getModel()->getMaxminSystem(), getVariable(), 0.0);
-    suspended_ = 1;
-    if (getModel()->getUpdateMechanism() == UM_LAZY)
+    if (getModel()->getUpdateMechanism() == UM_LAZY){
       heapRemove(getModel()->getActionHeap());
+      if (getModel()->getUpdateMechanism() == UM_LAZY  && stateSet_ == getModel()->getRunningActionSet() && priority_ > 0){
+        //If we have a lazy model, we need to update the remaining value accordingly
+        updateRemainingLazy(surf_get_clock());
+      }
+    }
+    suspended_ = 1;
   }
   XBT_OUT();
 }