Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
code simplification: directly give the host name to SD_workstation_create
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 27 Dec 2015 20:05:21 +0000 (21:05 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 27 Dec 2015 20:05:21 +0000 (21:05 +0100)
src/simdag/private.h
src/simdag/sd_global.c
src/simdag/sd_workstation.c

index 906a85b..0a3bc8c 100644 (file)
@@ -121,8 +121,7 @@ typedef struct SD_dependency {
 XBT_PUBLIC(xbt_swag_t) SD_simulate_swag(double how_long); /* could be public, but you need to see the internals of the SD_task_t to use it */
 
 
-XBT_PRIVATE SD_workstation_t __SD_workstation_create(void *surf_workstation,
-                                         void *data);
+XBT_PRIVATE SD_workstation_t __SD_workstation_create(const char* name);
 XBT_PRIVATE void __SD_workstation_destroy(void *workstation);
 XBT_PRIVATE int __SD_workstation_is_busy(SD_workstation_t workstation);
 
index b625857..5c55398 100644 (file)
@@ -211,9 +211,7 @@ void SD_create_environment(const char *platform_file)
     xbt_dict_cursor_t cursor = NULL;
     simgrid_Host* host = NULL;
     xbt_dict_foreach(host_list, cursor, name, host){
-      surf_Host* surf_host = (surf_Host*) surf_host_resource_priv(host);
-      if (surf_host != NULL)
-        __SD_workstation_create(surf_host, NULL);
+       __SD_workstation_create((const char*)name);
     }
   }
 
index 8162d2e..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;
 }