Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Clean bound in surf
[simgrid.git] / src / surf / surf_interface.cpp
index efc5739..4378973 100644 (file)
@@ -90,6 +90,8 @@ xbt_dynar_t surf_path = NULL;
 xbt_dynar_t host_that_restart = NULL;
 xbt_dict_t watched_hosts_lib;
 
+surf_callback(void, void) surfExitCallbacks;
+
 s_surf_model_description_t surf_plugin_description[] = {
                  {"Energy",
                   "Cpu energy consumption.",
@@ -154,7 +156,7 @@ s_surf_model_description_t surf_workstation_model_description[] = {
 
 s_surf_model_description_t surf_vm_workstation_model_description[] = {
   {"default",
-   "Default vm workstation model.)",
+   "Default vm workstation model.",
    surf_vm_workstation_model_init_current_default},
   {NULL, NULL, NULL}      /* this array must be NULL terminated */
 };
@@ -443,6 +445,8 @@ void surf_exit(void)
   xbt_dynar_free(&model_list_invoke);
   routing_exit();
 
+  surf_callback_emit(surfExitCallbacks);
+
   if (maxmin_system) {
     lmm_system_free(maxmin_system);
     maxmin_system = NULL;
@@ -846,6 +850,22 @@ void Action::setState(e_surf_action_state_t state)
   XBT_OUT();
 }
 
+double Action::getBound()
+{
+  return (p_variable) ? lmm_variable_getbound(p_variable) : 0;
+}
+
+void Action::setBound(double bound)
+{
+  XBT_IN("(%p,%g)", this, bound);
+  if (p_variable)
+    lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), bound);
+
+  if (getModel()->getUpdateMechanism() == UM_LAZY)
+       heapRemove(getModel()->getActionHeap());
+  XBT_OUT();
+}
+
 double Action::getStartTime()
 {
   return m_start;