Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
added code to allow for DO_ONCE loops. very preliminary.
[simgrid.git] / src / surf / cpu.c
index 06bcaac..75b84d5 100644 (file)
@@ -13,7 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
 surf_cpu_model_t surf_cpu_model = NULL;
 lmm_system_t cpu_maxmin_system = NULL;
 
-xbt_dict_t cpu_set;
+xbt_dict_t cpu_set = NULL;
 
 static void cpu_free(void *cpu)
 {
@@ -29,7 +29,9 @@ static cpu_Cas01_t cpu_new(char *name, double power_scale,
                           xbt_dict_t cpu_properties)
 {
   cpu_Cas01_t cpu = xbt_new0(s_cpu_Cas01_t, 1);
-
+  xbt_assert1(!xbt_dict_get_or_null(cpu_set, name),
+             "Host '%s' declared several times in the platform file",name);
+   
   cpu->model = (surf_model_t) surf_cpu_model;
   cpu->name = name;
   cpu->power_scale = power_scale;