X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cd42089e037bc9108a5b8a049433e680a2f94029..877fd76c223fe2fba051129f3ba0339bb5566bce:/src/surf/surf_interface.cpp?ds=sidebyside diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 1d3c71eecc..3062d0cb5b 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -5,7 +5,6 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "surf_interface.hpp" -#include "VirtualMachineImpl.hpp" #include "cpu_interface.hpp" #include "mc/mc.h" #include "network_interface.hpp" @@ -13,10 +12,10 @@ #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 XBT_LOG_NEW_CATEGORY(surf, "All SURF categories"); @@ -345,7 +344,6 @@ void surf_exit() delete model; delete all_existing_models; xbt_dynar_free(&model_list_invoke); - routing_exit(); simgrid::surf::surfExitCallbacks(); @@ -685,9 +683,7 @@ void Action::setData(void* data) void Action::setCategory(const char *category) { - XBT_IN("(%p,%s)", this, category); category_ = xbt_strdup(category); - XBT_OUT(); } void Action::ref(){ @@ -696,11 +692,9 @@ void Action::ref(){ void Action::setMaxDuration(double duration) { - XBT_IN("(%p,%g)", this, duration); maxDuration_ = duration; if (getModel()->getUpdateMechanism() == UM_LAZY) // remove action from the heap heapRemove(getModel()->getActionHeap()); - XBT_OUT(); } void Action::gapRemove() {} @@ -749,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(); }