Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Corrected some bugs, added the simix support to the other workstation
[simgrid.git] / src / surf / workstation_KCCFLN05.c
index 9d5c210..09b44c4 100644 (file)
@@ -233,15 +233,22 @@ static double share_resources(double now)
 
   xbt_swag_foreach(action, running_actions) {
     if(action->latency>0) {
-      if(min<0) min = action->latency;
-      else if (action->latency<min) min = action->latency;
+      if(min<0) {
+       min = action->latency;
+       DEBUG3("Updating min (value) with %p (start %f): %f",action, 
+              action->generic_action.start, min);
+      }
+      else if (action->latency<min) {
+       min = action->latency;
+       DEBUG3("Updating min (latency) with %p (start %f): %f",action, 
+              action->generic_action.start, min);
+      }
     }
   }
 
+  DEBUG1("min value : %f",min);
+
   return min;
-/*   return generic_maxmin_share_resources(surf_workstation_resource->common_public-> */
-/*                                     states.running_action_set, */
-/*                                     xbt_swag_offset(action, variable)); */
 }
 
 static void update_actions_state(double now, double delta)
@@ -346,6 +353,9 @@ static void update_resource_state(void *id,
        if(action->suspended==0)
          lmm_update_variable_weight(maxmin_system, action->variable, 
                                     action->lat_current);
+       lmm_update_variable_latency(maxmin_system, action->variable, delta);
+       
+
       }
     } else if (event_type == nw_link->state_event) {
       if (value > 0)
@@ -484,6 +494,7 @@ static double get_available_speed(void *cpu)
   return ((cpu_KCCFLN05_t) cpu)->power_current;
 }
 
+
 static surf_action_t communicate(void *src, void *dst, double size, double rate)
 {
   surf_action_workstation_KCCFLN05_t action = NULL;
@@ -548,6 +559,8 @@ static surf_action_t communicate(void *src, void *dst, double size, double rate)
       lmm_update_variable_bound(maxmin_system, action->variable, action->rate);
   }
 
+  lmm_update_variable_latency(maxmin_system, action->variable, action->latency);
+  
   for (i = 0; i < route_size; i++)
     lmm_expand(maxmin_system, route->links[i]->constraint, action->variable, 1.0);
   if (card_src->bus)
@@ -1055,14 +1068,45 @@ void surf_workstation_resource_init_KCCFLN05(const char *filename)
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
 
-void surf_workstation_resource_init_KCCFLN05_proportionnal(const char *filename)
+void surf_workstation_resource_init_KCCFLN05_proportional(const char *filename)
 {
   xbt_assert0(!surf_cpu_resource, "CPU resource type already defined");
   xbt_assert0(!surf_network_resource, "network resource type already defined");
   resource_init_internal();
   parse_file(filename);
 
-  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (proportionnal)";
+  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (proportional)";
   use_sdp_solver=1;
   xbt_dynar_push(resource_list, &surf_workstation_resource);
 }
+
+void surf_workstation_resource_init_KCCFLN05_Vegas(const char *filename)
+{
+  xbt_assert0(!surf_cpu_resource, "CPU resource type already defined");
+  xbt_assert0(!surf_network_resource, "network resource type already defined");
+  resource_init_internal();
+  parse_file(filename);
+
+  lmm_set_default_protocol_functions(func_vegas_f, func_vegas_fp, func_vegas_fpi, func_vegas_fpip);
+
+  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (Vegas)";
+  use_lagrange_solver=1;
+  xbt_dynar_push(resource_list, &surf_workstation_resource);
+}
+
+void surf_workstation_resource_init_KCCFLN05_Reno(const char *filename)
+{
+  xbt_assert0(!surf_cpu_resource, "CPU resource type already defined");
+  xbt_assert0(!surf_network_resource, "network resource type already defined");
+  resource_init_internal();
+  parse_file(filename);
+
+  lmm_set_default_protocol_functions(func_reno_f, func_reno_fp, func_reno_fpi, func_reno_fpip);
+
+  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (Reno)";
+  use_lagrange_solver=1;
+  xbt_dynar_push(resource_list, &surf_workstation_resource);
+}
+
+
+