Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
code simplification: directly give the host name to SD_workstation_create
[simgrid.git] / src / simdag / sd_workstation.c
index 178c33a..7a4a17c 100644 (file)
@@ -17,22 +17,18 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_workstation, sd,
 
 /* Creates a workstation and registers it in SD.
  */
-SD_workstation_t __SD_workstation_create(void *surf_workstation,
-                                         void *data)
+SD_workstation_t __SD_workstation_create(const char *name)
 {
 
   SD_workstation_priv_t workstation;
-  const char *name;
 
   workstation = xbt_new(s_SD_workstation_priv_t, 1);
   workstation->access_mode = SD_WORKSTATION_SHARED_ACCESS;      /* default mode is shared */
   workstation->task_fifo = NULL;
   workstation->current_task = NULL;
 
-  name = surf_resource_name(surf_workstation);
   sg_host_t sg_host = sg_host_by_name(name);
   sg_host_sd_set(sg_host,workstation);
-  sg_host_user_set(sg_host,data);
   return sg_host;
 }
 
@@ -72,7 +68,7 @@ void __SD_storage_destroy(void *storage)
  */
 SD_workstation_t SD_workstation_get_by_name(const char *name)
 {
-  return xbt_lib_get_elm_or_null(host_lib, name);
+  return sg_host_by_name(name);
 }
 
 /**
@@ -101,7 +97,7 @@ const SD_workstation_t *SD_workstation_get_list(void) {
  */
 int SD_workstation_get_number(void)
 {
-  return xbt_lib_length(host_lib);
+  return sg_host_count();
 }
 
 /**
@@ -164,7 +160,7 @@ const char *SD_workstation_get_property_value(SD_workstation_t ws,
  */
 xbt_dict_t SD_workstation_get_properties(SD_workstation_t workstation)
 {
-  return surf_host_get_properties(surf_host_resource_priv(workstation));
+  return sg_host_get_properties(workstation);
 }