Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Free smpi_instances.
[simgrid.git] / src / surf / workstation_clm03.cpp
index 254c1d17557ce7317448ba6a3131cb4763fdc5b5..99e5d33838e700932386ab845da4e43d14586bde 100644 (file)
@@ -15,10 +15,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_workstation);
  * CallBacks *
  *************/
 
-static void workstation_new(sg_platf_host_cbarg_t host){
-  reinterpret_cast<WorkstationCLM03ModelPtr>(surf_workstation_model)->createResource(host->id);
-}
-
 /*********
  * Model *
  *********/
@@ -31,10 +27,10 @@ void surf_workstation_model_init_current_default(void)
   surf_network_model_init_LegrandVelho();
   surf_workstation_model->p_cpuModel = surf_cpu_model_pm;
 
-  ModelPtr model = static_cast<ModelPtr>(surf_workstation_model);
+  ModelPtr model = surf_workstation_model;
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
-  sg_platf_host_add_cb(workstation_new);
+  sg_platf_host_add_cb(workstation_parse_init);
 }
 
 void surf_workstation_model_init_compound()
@@ -44,10 +40,10 @@ void surf_workstation_model_init_compound()
   xbt_assert(surf_network_model, "No network model defined yet!");
   surf_workstation_model = new WorkstationCLM03Model();
 
-  ModelPtr model = static_cast<ModelPtr>(surf_workstation_model);
+  ModelPtr model = surf_workstation_model;
   xbt_dynar_push(model_list, &model);
   xbt_dynar_push(model_list_invoke, &model);
-  sg_platf_host_add_cb(workstation_new);
+  sg_platf_host_add_cb(workstation_parse_init);
 }
 
 WorkstationCLM03Model::WorkstationCLM03Model()
@@ -58,18 +54,13 @@ WorkstationCLM03Model::WorkstationCLM03Model()
 WorkstationCLM03Model::~WorkstationCLM03Model()
 {}
 
-void WorkstationCLM03Model::parseInit(sg_platf_host_cbarg_t host){
-  createResource(host->id);
-}
-
-WorkstationPtr WorkstationCLM03Model::createResource(const char *name){
-
+WorkstationPtr WorkstationCLM03Model::createWorkstation(const char *name){
   WorkstationPtr workstation = new WorkstationCLM03(surf_workstation_model, name, NULL,
                  (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL),
                  (RoutingEdgePtr)xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL),
                  static_cast<CpuPtr>(xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL)));
   XBT_DEBUG("Create workstation %s with %ld mounted disks", name, xbt_dynar_length(workstation->p_storage));
-  xbt_lib_set(host_lib, name, SURF_WKS_LEVEL, static_cast<ResourcePtr>(workstation));
+  xbt_lib_set(host_lib, name, SURF_WKS_LEVEL, workstation);
   return workstation;
 }