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 09b44c4..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)
@@ -1087,7 +1099,7 @@ void surf_workstation_resource_init_KCCFLN05_Vegas(const char *filename)
   resource_init_internal();
   parse_file(filename);
 
-  lmm_set_default_protocol_functions(func_vegas_f, func_vegas_fp, func_vegas_fpi, func_vegas_fpip);
+  lmm_set_default_protocol_functions(func_vegas_fpi);
 
   surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (Vegas)";
   use_lagrange_solver=1;
@@ -1101,7 +1113,7 @@ void surf_workstation_resource_init_KCCFLN05_Reno(const char *filename)
   resource_init_internal();
   parse_file(filename);
 
-  lmm_set_default_protocol_functions(func_reno_f, func_reno_fp, func_reno_fpi, func_reno_fpip);
+  lmm_set_default_protocol_functions(func_reno_fpi);
 
   surf_workstation_resource->common_public->name = "Workstation KCCFLN05 (Reno)";
   use_lagrange_solver=1;