Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make a list of WorkstationVM, instead of iterating over all hosts to list them.
[simgrid.git] / src / surf / surf_interface.cpp
index 1860479..2654254 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;
@@ -537,7 +541,7 @@ double Model::shareResourcesLazy(double now)
     value = lmm_variable_getvalue(action->getVariable());
     if (value > 0) {
       if (action->getRemains() > 0) {
-        value = action->getRemains() / value;
+        value = action->getRemainsNoUpdate() / value;
         min = now + value;
       } else {
         value = 0.0;
@@ -604,7 +608,7 @@ double Model::shareResourcesMaxMin(ActionListPtr running_actions,
 
   if (value > 0) {
     if (action->getRemains() > 0)
-      min = action->getRemains() / value;
+      min = action->getRemainsNoUpdate() / value;
     else
       min = 0.0;
     if ((action->getMaxDuration() >= 0) && (action->getMaxDuration() < min))
@@ -618,7 +622,7 @@ double Model::shareResourcesMaxMin(ActionListPtr running_actions,
     value = lmm_variable_getvalue(action->getVariable());
     if (value > 0) {
       if (action->getRemains() > 0)
-        value = action->getRemains() / value;
+        value = action->getRemainsNoUpdate() / value;
       else
         value = 0.0;
       if (value < min) {