Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Allow to instanciate the constant network model. It uses a newly created routing...
[simgrid.git] / src / surf / workstation.c
index 92e8a9dc8ff118ddede542682ac4c6cdd91b1db2..7a56c2723a351afb640465a0c5989501cf34c464 100644 (file)
@@ -9,7 +9,6 @@
 #include "xbt/dict.h"
 #include "portable.h"
 #include "surf_private.h"
-#include "network_common.h"
 
 typedef struct workstation_CLM03 {
   s_surf_resource_t generic_resource; /* Must remain first to add this to a trace */
@@ -46,9 +45,8 @@ void create_workstations(void)
 
   xbt_dict_foreach(surf_model_resource_set(surf_cpu_model), cursor, name, cpu) {
     int *id = xbt_dict_get_or_null(used_routing->host_id,name);
-    xbt_assert1(id, "No host %s found in the platform file", name);
 
-    workstation_new(name, cpu, *id);
+    workstation_new(name, cpu, id?*id:0);
   }
 }
 
@@ -197,7 +195,7 @@ static surf_action_t communicate(void *workstation_src,
         size, rate);
 }
 
-static e_surf_cpu_state_t get_state(void *workstation)
+static e_surf_resource_state_t get_state(void *workstation)
 {
   return surf_cpu_model->extension.
     cpu.get_state(((workstation_CLM03_t) workstation)->cpu);
@@ -255,6 +253,9 @@ static void finalize(void)
   surf_model_exit(surf_workstation_model);
   surf_workstation_model = NULL;
 }
+static xbt_dict_t get_properties(const void*ws){
+  return surf_resource_properties(((workstation_CLM03_t)ws)->cpu);
+}
 
 static void surf_workstation_model_init_internal(void)
 {
@@ -295,6 +296,7 @@ static void surf_workstation_model_init_internal(void)
   surf_workstation_model->extension.workstation.get_link_latency =
     get_link_latency;
   surf_workstation_model->extension.workstation.link_shared = link_shared;
+  surf_workstation_model->extension.workstation.get_properties = get_properties;
 }
 
 /********************************************************************/