Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Keep cleaning up func_f, func_fp, func_fpip...
[simgrid.git] / src / surf / workstation_KCCFLN05.c
index 1097df4..4f30af0 100644 (file)
@@ -76,7 +76,14 @@ static void __update_cpu_usage(cpu_KCCFLN05_t cpu)
 
 static void *name_service(const char *name)
 {
-  return xbt_dict_get_or_null(workstation_set, name);
+  xbt_ex_t e;
+  void *res=NULL;
+  TRY {
+     res = xbt_dict_get(workstation_set, name);
+  } CATCH(e) {
+     RETHROW1("Host '%s' not found (dict raised this exception: %s)",name);
+  }
+  return res;
 }
 
 static const char *get_resource_name(void *resource_id)
@@ -926,11 +933,16 @@ static void parse_route_set_endpoints(void)
 
 static void parse_route_elem(void)
 {
+  xbt_ex_t e;
   if (nb_link == link_list_capacity) {
     link_list_capacity *= 2;
     link_list = xbt_realloc(link_list, (link_list_capacity) * sizeof(network_link_KCCFLN05_t));
   }
-  link_list[nb_link++] = xbt_dict_get_or_null(network_link_set, A_surfxml_route_element_name);
+  TRY {
+     link_list[nb_link++] = xbt_dict_get(network_link_set, A_surfxml_route_element_name);
+  } CATCH(e) {
+     RETHROW1("Link %s not found (dict raised this exception: %s)",A_surfxml_route_element_name);
+  }
 }
 
 static void parse_route_set_route(void)
@@ -1068,14 +1080,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_fpi);
+
+  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_fpi);
+
+  surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (Reno)";
+  use_lagrange_solver=1;
+  xbt_dynar_push(resource_list, &surf_workstation_resource);
+}
+
+
+