Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SimDag Revolution: SD_workstation becomes sg_host
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 26 Jan 2016 12:56:04 +0000 (13:56 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 26 Jan 2016 12:57:48 +0000 (13:57 +0100)
47 files changed:
examples/simdag/dax/dax_test.c
examples/simdag/dot/dot_test.c
examples/simdag/dot/ptg_test.c
examples/simdag/dot/simulate_dot.c
examples/simdag/goal/goal_test.c
examples/simdag/io/sd_io.c
examples/simdag/metaxml/sd_meta.c
examples/simdag/properties/sd_prop.c
examples/simdag/scheduling/minmin_test.c
examples/simdag/sd_avail.c
examples/simdag/sd_comm_throttling.c
examples/simdag/sd_fail.c
examples/simdag/sd_test.c
examples/simdag/sd_test2.c
examples/simdag/sd_typed_tasks_test.c
include/simgrid/host.h
include/simgrid/simdag.h
src/simdag/sd_dotloader.cpp
src/simdag/sd_global.cpp
src/simdag/sd_task.cpp
src/simdag/sd_workstation.cpp
src/simdag/simdag_private.h
src/simgrid/host.cpp
teshsuite/simdag/availability/availability_test.c
teshsuite/simdag/basic/basic0.c
teshsuite/simdag/basic/basic1.c
teshsuite/simdag/basic/basic2.c
teshsuite/simdag/basic/basic3.c
teshsuite/simdag/basic/basic4.c
teshsuite/simdag/basic/basic5.c
teshsuite/simdag/basic/basic6.c
teshsuite/simdag/incomplete/incomplete.c
teshsuite/simdag/network/mxn/test_intra_all2all.c
teshsuite/simdag/network/mxn/test_intra_independent_comm.c
teshsuite/simdag/network/mxn/test_intra_scatter.c
teshsuite/simdag/network/p2p/test_latency1.c
teshsuite/simdag/network/p2p/test_latency2.c
teshsuite/simdag/network/p2p/test_latency3.c
teshsuite/simdag/network/p2p/test_latency_bound.c
teshsuite/simdag/network/test_reinit_costs.c
teshsuite/simdag/partask/test_comp_only_par.c
teshsuite/simdag/partask/test_comp_only_seq.c
teshsuite/simdag/platforms/Evaluate_get_route_time.c
teshsuite/simdag/platforms/Evaluate_parse_time.c
teshsuite/simdag/platforms/basic_parsing_test.c
teshsuite/simdag/platforms/flatifier.cpp
teshsuite/simdag/platforms/is_router_test.c

index 934d812..de65c4c 100644 (file)
@@ -19,8 +19,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test,
 static int name_compare_hosts(const void *n1, const void *n2)
 {
   char name1[80], name2[80];
 static int name_compare_hosts(const void *n1, const void *n2)
 {
   char name1[80], name2[80];
-  strcpy(name1, SD_workstation_get_name(*((SD_workstation_t *) n1)));
-  strcpy(name2, SD_workstation_get_name(*((SD_workstation_t *) n2)));
+  strcpy(name1, sg_host_get_name(*((sg_host_t *) n1)));
+  strcpy(name2, sg_host_get_name(*((sg_host_t *) n2)));
 
   return strcmp(name1, name2);
 }
 
   return strcmp(name1, name2);
 }
@@ -75,12 +75,12 @@ int main(int argc, char **argv)
 
   /* Schedule them all on the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
 
   /* Schedule them all on the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
-  const SD_workstation_t *ws_list = SD_workstation_get_list();
-  int totalHosts = SD_workstation_get_count();
-  qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
+  const sg_host_t *ws_list = sg_host_list();
+  int totalHosts = sg_host_count();
+  qsort((void *) ws_list, totalHosts, sizeof(sg_host_t),
         name_compare_hosts);
 
         name_compare_hosts);
 
-  int count = SD_workstation_get_count();
+  int count = sg_host_count();
   xbt_dynar_foreach(dax, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
       if (!strcmp(SD_task_get_name(task), "end"))
   xbt_dynar_foreach(dax, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
       if (!strcmp(SD_task_get_name(task), "end"))
@@ -102,24 +102,24 @@ int main(int argc, char **argv)
 
   xbt_dynar_foreach(dax, cursor, task) {
     int kind = SD_task_get_kind(task);
 
   xbt_dynar_foreach(dax, cursor, task) {
     int kind = SD_task_get_kind(task);
-    SD_workstation_t *wsl = SD_task_get_workstation_list(task);
+    sg_host_t *wsl = SD_task_get_workstation_list(task);
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f] %s compute %f # %s\n",
               SD_task_get_start_time(task),
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f] %s compute %f # %s\n",
               SD_task_get_start_time(task),
-              SD_workstation_get_name(wsl[0]), SD_task_get_amount(task),
+              sg_host_get_name(wsl[0]), SD_task_get_amount(task),
               SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f] %s send %s %f # %s\n",
               SD_task_get_start_time(task),
               SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f] %s send %s %f # %s\n",
               SD_task_get_start_time(task),
-              SD_workstation_get_name(wsl[0]),
-              SD_workstation_get_name(wsl[1]), SD_task_get_amount(task),
+              sg_host_get_name(wsl[0]),
+              sg_host_get_name(wsl[1]), SD_task_get_amount(task),
               SD_task_get_name(task));
       fprintf(out, "[%f] %s recv %s %f # %s\n",
               SD_task_get_finish_time(task),
               SD_task_get_name(task));
       fprintf(out, "[%f] %s recv %s %f # %s\n",
               SD_task_get_finish_time(task),
-              SD_workstation_get_name(wsl[1]),
-              SD_workstation_get_name(wsl[0]), SD_task_get_amount(task),
+              sg_host_get_name(wsl[1]),
+              sg_host_get_name(wsl[0]), SD_task_get_amount(task),
               SD_task_get_name(task));
       break;
     default:
               SD_task_get_name(task));
       break;
     default:
index 382c921..d06e646 100644 (file)
@@ -73,9 +73,9 @@ int main(int argc, char **argv)
 
   /* Schedule them all on the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
 
   /* Schedule them all on the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
-  const SD_workstation_t *ws_list = SD_workstation_get_list();
+  const sg_host_t *ws_list = sg_host_list();
 
 
-  int count = SD_workstation_get_count();
+  int count = sg_host_count();
   xbt_dynar_foreach(dot, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
       if (!strcmp(SD_task_get_name(task), "end"))
   xbt_dynar_foreach(dot, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
       if (!strcmp(SD_task_get_name(task), "end"))
@@ -98,21 +98,21 @@ int main(int argc, char **argv)
 
   xbt_dynar_foreach(dot, cursor, task) {
     int kind = SD_task_get_kind(task);
 
   xbt_dynar_foreach(dot, cursor, task) {
     int kind = SD_task_get_kind(task);
-    SD_workstation_t *wsl = SD_task_get_workstation_list(task);
+    sg_host_t *wsl = SD_task_get_workstation_list(task);
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f->%f] %s compute %f flops # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f->%f] %s compute %f flops # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
-          SD_workstation_get_name(wsl[0]), SD_task_get_amount(task),
+          sg_host_get_name(wsl[0]), SD_task_get_amount(task),
           SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f -> %f] %s -> %s transfer of %.0f bytes # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
           SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f -> %f] %s -> %s transfer of %.0f bytes # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
-          SD_workstation_get_name(wsl[0]),
-          SD_workstation_get_name(wsl[1]), SD_task_get_amount(task),
+          sg_host_get_name(wsl[0]),
+          sg_host_get_name(wsl[1]), SD_task_get_amount(task),
           SD_task_get_name(task));
       break;
     default:
           SD_task_get_name(task));
       break;
     default:
index 623e461..19c6de9 100644 (file)
@@ -58,8 +58,8 @@ int main(int argc, char **argv){
 
   /* Schedule them all on all the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
 
   /* Schedule them all on all the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
-  const SD_workstation_t *ws_list = SD_workstation_get_list();
-  int count = SD_workstation_get_count();
+  const sg_host_t *ws_list = sg_host_list();
+  int count = sg_host_count();
   xbt_dynar_foreach(dot, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_PAR_AMDAHL) {
         SD_task_schedulev(task, count, ws_list);
   xbt_dynar_foreach(dot, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_PAR_AMDAHL) {
         SD_task_schedulev(task, count, ws_list);
index c68c98f..c0fbe0c 100644 (file)
@@ -84,21 +84,21 @@ int main(int argc, char **argv)
 
   xbt_dynar_foreach(dot, cursor, task) {
     int kind = SD_task_get_kind(task);
 
   xbt_dynar_foreach(dot, cursor, task) {
     int kind = SD_task_get_kind(task);
-    SD_workstation_t *wsl = SD_task_get_workstation_list(task);
+    sg_host_t *wsl = SD_task_get_workstation_list(task);
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f->%f] %s compute %f flops # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
     switch (kind) {
     case SD_TASK_COMP_SEQ:
       fprintf(out, "[%f->%f] %s compute %f flops # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
-          SD_workstation_get_name(wsl[0]), SD_task_get_amount(task),
+          sg_host_get_name(wsl[0]), SD_task_get_amount(task),
           SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f -> %f] %s -> %s transfer of %.0f bytes # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
           SD_task_get_name(task));
       break;
     case SD_TASK_COMM_E2E:
       fprintf(out, "[%f -> %f] %s -> %s transfer of %.0f bytes # %s\n",
           SD_task_get_start_time(task),
           SD_task_get_finish_time(task),
-          SD_workstation_get_name(wsl[0]),
-          SD_workstation_get_name(wsl[1]), SD_task_get_amount(task),
+          sg_host_get_name(wsl[0]),
+          sg_host_get_name(wsl[1]), SD_task_get_amount(task),
           SD_task_get_name(task));
       break;
     default:
           SD_task_get_name(task));
       break;
     default:
index 1b2e514..e44ceea 100644 (file)
@@ -26,7 +26,7 @@ typedef struct {
 } s_bcast_task_t,*bcast_task_t;
 
 
 } s_bcast_task_t,*bcast_task_t;
 
 
-const SD_workstation_t* ws_list;
+const sg_host_t* ws_list;
 int count = 0;
 
 xbt_dynar_t reclaimed;
 int count = 0;
 
 xbt_dynar_t reclaimed;
@@ -68,12 +68,12 @@ int main(int argc, char **argv) {
     SD_create_environment("../../platforms/One_cluster_no_backbone.xml");
   }
 
     SD_create_environment("../../platforms/One_cluster_no_backbone.xml");
   }
 
-  ws_list = SD_workstation_get_list();
+  ws_list = sg_host_list();
   reclaimed = xbt_dynar_new(sizeof(bcast_task_t),xbt_free_ref);
   xbt_dynar_t done = NULL;
 
   xbt_os_cputimer_start(timer);
   reclaimed = xbt_dynar_new(sizeof(bcast_task_t),xbt_free_ref);
   xbt_dynar_t done = NULL;
 
   xbt_os_cputimer_start(timer);
-  send_one(0,SD_workstation_get_count());
+  send_one(0,sg_host_count());
   do {
     if (done != NULL && !xbt_dynar_is_empty(done)) {
       unsigned int cursor;
   do {
     if (done != NULL && !xbt_dynar_is_empty(done)) {
       unsigned int cursor;
index 5dc9a57..4d8c3a4 100644 (file)
@@ -15,7 +15,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(sd_io,
 int main(int argc, char **argv)
 {
   unsigned int ctr;
 int main(int argc, char **argv)
 {
   unsigned int ctr;
-  const SD_workstation_t *workstations;
+  const sg_host_t *workstations;
   int total_nworkstations;
   xbt_dict_t current_storage_list;
   char *mount_name;
   int total_nworkstations;
   xbt_dict_t current_storage_list;
   char *mount_name;
@@ -28,14 +28,14 @@ int main(int argc, char **argv)
    */
   SD_config("host/model", "default");
   SD_create_environment(argv[1]);
    */
   SD_config("host/model", "default");
   SD_create_environment(argv[1]);
-  workstations = SD_workstation_get_list();
-  total_nworkstations = SD_workstation_get_count();
+  workstations = sg_host_list();
+  total_nworkstations = sg_host_count();
 
   for (ctr=0; ctr<total_nworkstations;ctr++){
 
   for (ctr=0; ctr<total_nworkstations;ctr++){
-    current_storage_list = SD_workstation_get_mounted_storage_list(workstations[ctr]);
+    current_storage_list = sg_host_get_mounted_storage_list(workstations[ctr]);
     xbt_dict_foreach(current_storage_list,cursor,mount_name,storage_name)
       XBT_INFO("Workstation '%s' mounts '%s'",
     xbt_dict_foreach(current_storage_list,cursor,mount_name,storage_name)
       XBT_INFO("Workstation '%s' mounts '%s'",
-         SD_workstation_get_name(workstations[ctr]), mount_name);
+         sg_host_get_name(workstations[ctr]), mount_name);
     xbt_dict_free(&current_storage_list);
   }
   SD_exit();
     xbt_dict_free(&current_storage_list);
   }
   SD_exit();
index 170a265..2b3da2a 100644 (file)
@@ -23,10 +23,10 @@ int main(int argc, char **argv)
 {
 
   const char *platform_file;
 {
 
   const char *platform_file;
-  const SD_workstation_t *workstations;
+  const sg_host_t *workstations;
   int ws_nr;
   int ws_nr;
-  SD_workstation_t w1 = NULL;
-  SD_workstation_t w2 = NULL;
+  sg_host_t w1 = NULL;
+  sg_host_t w2 = NULL;
   const char *name1, *name2;
   int i, j, k;
 
   const char *name1, *name2;
   int i, j, k;
 
@@ -46,8 +46,8 @@ int main(int argc, char **argv)
   SD_create_environment(platform_file);
 
   /* test the estimation functions */
   SD_create_environment(platform_file);
 
   /* test the estimation functions */
-  workstations = SD_workstation_get_list();
-  ws_nr = SD_workstation_get_count();
+  workstations = sg_host_list();
+  ws_nr = sg_host_count();
 
 
   /* Show routes between all workstation */
 
 
   /* Show routes between all workstation */
@@ -58,8 +58,8 @@ int main(int argc, char **argv)
       int route_size;
       w1 = workstations[i];
       w2 = workstations[j];
       int route_size;
       w1 = workstations[i];
       w2 = workstations[j];
-      name1 = SD_workstation_get_name(w1);
-      name2 = SD_workstation_get_name(w2);
+      name1 = sg_host_get_name(w1);
+      name2 = sg_host_get_name(w2);
       XBT_INFO("Route between %s and %s:", name1, name2);
       route = SD_route_get_list(w1, w2);
       route_size = SD_route_get_size(w1, w2);
       XBT_INFO("Route between %s and %s:", name1, name2);
       route = SD_route_get_list(w1, w2);
       route_size = SD_route_get_size(w1, w2);
index a015ef9..4af031c 100644 (file)
@@ -16,8 +16,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Property test");
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {
-  SD_workstation_t w1;
-  SD_workstation_t w2;
+  sg_host_t w1;
+  sg_host_t w2;
   const char *name1;
   const char *name2;
   xbt_dict_t props;
   const char *name1;
   const char *name2;
   xbt_dict_t props;
@@ -36,17 +36,17 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   /* init of platform elements */
   SD_create_environment(argv[1]);
 
   /* init of platform elements */
-  w1 = SD_workstation_get_by_name("host1");
-  w2 = SD_workstation_get_by_name("host2");
-  name1 = SD_workstation_get_name(w1);
-  name2 = SD_workstation_get_name(w2);
+  w1 = sg_host_by_name("host1");
+  w2 = sg_host_by_name("host2");
+  name1 = sg_host_get_name(w1);
+  name2 = sg_host_get_name(w2);
 
 
 
 
-  /* The host properties can be retrived from all interfaces */
+  /* The host properties can be retrieved from all interfaces */
 
   XBT_INFO("Property list for workstation %s", name1);
   /* Get the property list of the workstation 1 */
 
   XBT_INFO("Property list for workstation %s", name1);
   /* Get the property list of the workstation 1 */
-  props = SD_workstation_get_properties(w1);
+  props = sg_host_get_properties(w1);
 
 
   /* Trying to set a new property */
 
 
   /* Trying to set a new property */
@@ -59,13 +59,13 @@ int main(int argc, char **argv)
 
   /* Try to get a property that does not exist */
 
 
   /* Try to get a property that does not exist */
 
-  value = SD_workstation_get_property_value(w1, noexist);
+  value = sg_host_get_property_value(w1, noexist);
   XBT_INFO("\tProperty: %s has value: %s", noexist, value?value:"Undefined (NULL)");
 
 
   XBT_INFO("Property list for workstation %s", name2);
   /* Get the property list of the workstation 2 */
   XBT_INFO("\tProperty: %s has value: %s", noexist, value?value:"Undefined (NULL)");
 
 
   XBT_INFO("Property list for workstation %s", name2);
   /* Get the property list of the workstation 2 */
-  props = SD_workstation_get_properties(w2);
+  props = sg_host_get_properties(w2);
   cursor = NULL;
 
   /* Print the properties of the workstation 2 */
   cursor = NULL;
 
   /* Print the properties of the workstation 2 */
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
   /* Modify an existing property test. First check it exists */
   XBT_INFO("Modify an existing property");
 
   /* Modify an existing property test. First check it exists */
   XBT_INFO("Modify an existing property");
 
-  value = SD_workstation_get_property_value(w2, exist);
+  value = sg_host_get_property_value(w2, exist);
   if (value == NULL)
     XBT_INFO("\tProperty: %s is undefined", exist);
   else {
   if (value == NULL)
     XBT_INFO("\tProperty: %s is undefined", exist);
   else {
@@ -85,11 +85,11 @@ int main(int argc, char **argv)
   }
 
   /* Test if we have changed the value */
   }
 
   /* Test if we have changed the value */
-  value = SD_workstation_get_property_value(w2, exist);
+  value = sg_host_get_property_value(w2, exist);
   XBT_INFO("\tProperty: %s new value: %s", exist, value?value:"Undefined (NULL)");
 
   XBT_INFO("\tProperty: %s new value: %s", exist, value?value:"Undefined (NULL)");
 
-  /* Test if properties are displayed by SD_workstation_dump */
-  SD_workstation_dump(w2);
+  /* Test if properties are displayed by sg_host_dump */
+  sg_host_dump(w2);
 
   SD_exit();
   return 0;
 
   SD_exit();
   return 0;
index 130baf2..330eeba 100644 (file)
@@ -23,47 +23,47 @@ struct _WorkstationAttribute {
   SD_task_t last_scheduled_task;
 };
 
   SD_task_t last_scheduled_task;
 };
 
-static void SD_workstation_allocate_attribute(SD_workstation_t workstation)
+static void sg_host_allocate_attribute(sg_host_t workstation)
 {
   void *data;
   data = calloc(1, sizeof(struct _WorkstationAttribute));
 {
   void *data;
   data = calloc(1, sizeof(struct _WorkstationAttribute));
-  SD_workstation_set_data(workstation, data);
+  sg_host_user_set(workstation, data);
 }
 
 }
 
-static void SD_workstation_free_attribute(SD_workstation_t workstation)
+static void sg_host_free_attribute(sg_host_t workstation)
 {
 {
-  free(SD_workstation_get_data(workstation));
-  SD_workstation_set_data(workstation, NULL);
+  free(sg_host_user(workstation));
+  sg_host_user_set(workstation, NULL);
 }
 
 }
 
-static double SD_workstation_get_available_at(SD_workstation_t workstation)
+static double sg_host_get_available_at(sg_host_t workstation)
 {
   WorkstationAttribute attr =
 {
   WorkstationAttribute attr =
-      (WorkstationAttribute) SD_workstation_get_data(workstation);
+      (WorkstationAttribute) sg_host_user(workstation);
   return attr->available_at;
 }
 
   return attr->available_at;
 }
 
-static void SD_workstation_set_available_at(SD_workstation_t workstation,
+static void sg_host_set_available_at(sg_host_t workstation,
                                             double time)
 {
   WorkstationAttribute attr =
                                             double time)
 {
   WorkstationAttribute attr =
-      (WorkstationAttribute) SD_workstation_get_data(workstation);
+      (WorkstationAttribute) sg_host_user(workstation);
   attr->available_at = time;
   attr->available_at = time;
-  SD_workstation_set_data(workstation, attr);
+  sg_host_user_set(workstation, attr);
 }
 
 }
 
-static SD_task_t SD_workstation_get_last_scheduled_task( SD_workstation_t workstation){
+static SD_task_t sg_host_get_last_scheduled_task( sg_host_t workstation){
   WorkstationAttribute attr =
   WorkstationAttribute attr =
-      (WorkstationAttribute) SD_workstation_get_data(workstation);
+      (WorkstationAttribute) sg_host_user(workstation);
   return attr->last_scheduled_task;
 }
 
   return attr->last_scheduled_task;
 }
 
-static void SD_workstation_set_last_scheduled_task(SD_workstation_t workstation,
+static void sg_host_set_last_scheduled_task(sg_host_t workstation,
     SD_task_t task){
   WorkstationAttribute attr =
     SD_task_t task){
   WorkstationAttribute attr =
-      (WorkstationAttribute) SD_workstation_get_data(workstation);
+      (WorkstationAttribute) sg_host_user(workstation);
   attr->last_scheduled_task=task;
   attr->last_scheduled_task=task;
-  SD_workstation_set_data(workstation, attr);
+  sg_host_user_set(workstation, attr);
 }
 
 static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
 }
 
 static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
@@ -84,7 +84,7 @@ static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
   return ready_tasks;
 }
 
   return ready_tasks;
 }
 
-static double finish_on_at(SD_task_t task, SD_workstation_t workstation)
+static double finish_on_at(SD_task_t task, sg_host_t workstation)
 {
   volatile double result;
   unsigned int i;
 {
   volatile double result;
   unsigned int i;
@@ -94,7 +94,7 @@ static double finish_on_at(SD_task_t task, SD_workstation_t workstation)
   SD_task_t parent, grand_parent;
   xbt_dynar_t parents, grand_parents;
 
   SD_task_t parent, grand_parent;
   xbt_dynar_t parents, grand_parents;
 
-  SD_workstation_t *grand_parent_workstation_list;
+  sg_host_t *grand_parent_workstation_list;
 
   parents = SD_task_get_parents(task);
 
 
   parents = SD_task_get_parents(task);
 
@@ -138,27 +138,27 @@ static double finish_on_at(SD_task_t task, SD_workstation_t workstation)
 
     xbt_dynar_free_container(&parents);
 
 
     xbt_dynar_free_container(&parents);
 
-    result = MAX(SD_workstation_get_available_at(workstation),
+    result = MAX(sg_host_get_available_at(workstation),
                last_data_available) +
                last_data_available) +
-        SD_workstation_get_computation_time(workstation,
+        sg_host_computation_time(workstation,
                                             SD_task_get_amount(task));
   } else {
     xbt_dynar_free_container(&parents);
 
                                             SD_task_get_amount(task));
   } else {
     xbt_dynar_free_container(&parents);
 
-    result = SD_workstation_get_available_at(workstation) +
-        SD_workstation_get_computation_time(workstation,
+    result = sg_host_get_available_at(workstation) +
+        sg_host_computation_time(workstation,
                                             SD_task_get_amount(task));
   }
   return result;
 }
 
                                             SD_task_get_amount(task));
   }
   return result;
 }
 
-static SD_workstation_t SD_task_get_best_workstation(SD_task_t task)
+static sg_host_t SD_task_get_best_workstation(SD_task_t task)
 {
   int i;
   double EFT, min_EFT = -1.0;
 {
   int i;
   double EFT, min_EFT = -1.0;
-  const SD_workstation_t *workstations = SD_workstation_get_list();
-  int nworkstations = SD_workstation_get_count();
-  SD_workstation_t best_workstation;
+  const sg_host_t *workstations = sg_host_list();
+  int nworkstations = sg_host_count();
+  sg_host_t best_workstation;
 
   best_workstation = workstations[0];
   min_EFT = finish_on_at(task, workstations[0]);
 
   best_workstation = workstations[0];
   min_EFT = finish_on_at(task, workstations[0]);
@@ -167,7 +167,7 @@ static SD_workstation_t SD_task_get_best_workstation(SD_task_t task)
     EFT = finish_on_at(task, workstations[i]);
     XBT_DEBUG("%s finishes on %s at %f",
            SD_task_get_name(task),
     EFT = finish_on_at(task, workstations[i]);
     XBT_DEBUG("%s finishes on %s at %f",
            SD_task_get_name(task),
-           SD_workstation_get_name(workstations[i]), EFT);
+           sg_host_get_name(workstations[i]), EFT);
 
     if (EFT < min_EFT) {
       min_EFT = EFT;
 
     if (EFT < min_EFT) {
       min_EFT = EFT;
@@ -182,10 +182,10 @@ static void output_xml(FILE * out, xbt_dynar_t dax)
 {
   unsigned int i, j, k;
   int current_nworkstations;
 {
   unsigned int i, j, k;
   int current_nworkstations;
-  const int nworkstations = SD_workstation_get_count();
-  const SD_workstation_t *workstations = SD_workstation_get_list();
+  const int nworkstations = sg_host_count();
+  const sg_host_t *workstations = sg_host_list();
   SD_task_t task;
   SD_task_t task;
-  SD_workstation_t *list;
+  sg_host_t *list;
 
   fprintf(out, "<?xml version=\"1.0\"?>\n");
   fprintf(out, "<grid_schedule>\n");
 
   fprintf(out, "<?xml version=\"1.0\"?>\n");
   fprintf(out, "<grid_schedule>\n");
@@ -227,8 +227,8 @@ static void output_xml(FILE * out, xbt_dynar_t dax)
     list = SD_task_get_workstation_list(task);
     for (j = 0; j < current_nworkstations; j++) {
       for (k = 0; k < nworkstations; k++) {
     list = SD_task_get_workstation_list(task);
     for (j = 0; j < current_nworkstations; j++) {
       for (k = 0; k < nworkstations; k++) {
-        if (!strcmp(SD_workstation_get_name(workstations[k]),
-                    SD_workstation_get_name(list[j]))) {
+        if (!strcmp(sg_host_get_name(workstations[k]),
+                    sg_host_get_name(list[j]))) {
           fprintf(out, "               <hosts start=\"%u\" nb=\"1\"/>\n",
                   k);
           fprintf(out,
           fprintf(out, "               <hosts start=\"%u\" nb=\"1\"/>\n",
                   k);
           fprintf(out,
@@ -251,9 +251,9 @@ int main(int argc, char **argv)
   double finish_time, min_finish_time = -1.0;
   SD_task_t task, selected_task = NULL, last_scheduled_task;
   xbt_dynar_t ready_tasks;
   double finish_time, min_finish_time = -1.0;
   SD_task_t task, selected_task = NULL, last_scheduled_task;
   xbt_dynar_t ready_tasks;
-  SD_workstation_t workstation, selected_workstation = NULL;
+  sg_host_t workstation, selected_workstation = NULL;
   int total_nworkstations = 0;
   int total_nworkstations = 0;
-  const SD_workstation_t *workstations = NULL;
+  const sg_host_t *workstations = NULL;
   xbt_dynar_t dax;
   FILE *out = NULL;
 
   xbt_dynar_t dax;
   FILE *out = NULL;
 
@@ -276,11 +276,11 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   /*  Allocating the workstation attribute */
   SD_create_environment(argv[1]);
 
   /*  Allocating the workstation attribute */
-  total_nworkstations = SD_workstation_get_count();
-  workstations = SD_workstation_get_list();
+  total_nworkstations = sg_host_count();
+  workstations = sg_host_list();
 
   for (cursor = 0; cursor < total_nworkstations; cursor++)
 
   for (cursor = 0; cursor < total_nworkstations; cursor++)
-    SD_workstation_allocate_attribute(workstations[cursor]);
+    sg_host_allocate_attribute(workstations[cursor]);
 
 
   /* load the DAX file */
 
 
   /* load the DAX file */
@@ -320,7 +320,7 @@ int main(int argc, char **argv)
     }
 
     XBT_INFO("Schedule %s on %s", SD_task_get_name(selected_task),
     }
 
     XBT_INFO("Schedule %s on %s", SD_task_get_name(selected_task),
-          SD_workstation_get_name(selected_workstation));
+          sg_host_get_name(selected_workstation));
 
     SD_task_schedulel(selected_task, 1, selected_workstation);
 
 
     SD_task_schedulel(selected_task, 1, selected_workstation);
 
@@ -336,19 +336,19 @@ int main(int argc, char **argv)
     */
 
     last_scheduled_task = 
     */
 
     last_scheduled_task = 
-      SD_workstation_get_last_scheduled_task(selected_workstation);
+      sg_host_get_last_scheduled_task(selected_workstation);
     if (last_scheduled_task && 
   (SD_task_get_state(last_scheduled_task) != SD_DONE) &&
   (SD_task_get_state(last_scheduled_task) != SD_FAILED) &&
   !SD_task_dependency_exists(
     if (last_scheduled_task && 
   (SD_task_get_state(last_scheduled_task) != SD_DONE) &&
   (SD_task_get_state(last_scheduled_task) != SD_FAILED) &&
   !SD_task_dependency_exists(
-     SD_workstation_get_last_scheduled_task(selected_workstation),
+     sg_host_get_last_scheduled_task(selected_workstation),
      selected_task))
       SD_task_dependency_add("resource", NULL,
            last_scheduled_task, selected_task);
     
      selected_task))
       SD_task_dependency_add("resource", NULL,
            last_scheduled_task, selected_task);
     
-    SD_workstation_set_last_scheduled_task(selected_workstation, selected_task);
+    sg_host_set_last_scheduled_task(selected_workstation, selected_task);
     
     
-    SD_workstation_set_available_at(selected_workstation, min_finish_time);
+    sg_host_set_available_at(selected_workstation, min_finish_time);
 
     xbt_dynar_free_container(&ready_tasks);
     /* reset the min_finish_time for the next set of ready tasks */
 
     xbt_dynar_free_container(&ready_tasks);
     /* reset the min_finish_time for the next set of ready tasks */
@@ -380,7 +380,7 @@ int main(int argc, char **argv)
   xbt_dynar_free_container(&dax);
 
   for (cursor = 0; cursor < total_nworkstations; cursor++)
   xbt_dynar_free_container(&dax);
 
   for (cursor = 0; cursor < total_nworkstations; cursor++)
-    SD_workstation_free_attribute(workstations[cursor]);
+    sg_host_free_attribute(workstations[cursor]);
 
   /* exit */
   SD_exit();
 
   /* exit */
   SD_exit();
index 94c5809..d0ff078 100644 (file)
@@ -45,13 +45,13 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(sd_avail,
 int main(int argc, char **argv)
 {
   unsigned int ctr;
 int main(int argc, char **argv)
 {
   unsigned int ctr;
-  const SD_workstation_t *workstations;
+  const sg_host_t *workstations;
   SD_task_t t1, c1, t2, c2, t3, c3, t4, task;
   xbt_dynar_t changed_tasks;
 
   SD_init(&argc, argv);
   SD_create_environment(argv[1]);
   SD_task_t t1, c1, t2, c2, t3, c3, t4, task;
   xbt_dynar_t changed_tasks;
 
   SD_init(&argc, argv);
   SD_create_environment(argv[1]);
-  workstations = SD_workstation_get_list();
+  workstations = sg_host_list();
 
   t1 = SD_task_create_comp_seq("t1", NULL, 25000000);
   c1 = SD_task_create_comm_e2e("c1", NULL, 125000000);
 
   t1 = SD_task_create_comp_seq("t1", NULL, 25000000);
   c1 = SD_task_create_comm_e2e("c1", NULL, 125000000);
@@ -90,11 +90,11 @@ int main(int argc, char **argv)
              SD_route_get_bandwidth(workstations[0], workstations[1]),
              SD_route_get_latency(workstations[0], workstations[1]));
     XBT_INFO("Jupiter: speed=%.0f",
              SD_route_get_bandwidth(workstations[0], workstations[1]),
              SD_route_get_latency(workstations[0], workstations[1]));
     XBT_INFO("Jupiter: speed=%.0f",
-             SD_workstation_get_speed(workstations[0])*
-             SD_workstation_get_available_speed(workstations[0]));
+             sg_host_speed(workstations[0])*
+             sg_host_get_available_speed(workstations[0]));
     XBT_INFO("Tremblay: speed=%.0f",
     XBT_INFO("Tremblay: speed=%.0f",
-             SD_workstation_get_speed(workstations[1])*
-             SD_workstation_get_available_speed(workstations[1]));
+             sg_host_speed(workstations[1])*
+             sg_host_get_available_speed(workstations[1]));
     xbt_dynar_foreach(changed_tasks, ctr, task) {
       XBT_INFO("Task '%s' start time: %f, finish time: %f",
            SD_task_get_name(task),
     xbt_dynar_foreach(changed_tasks, ctr, task) {
       XBT_INFO("Task '%s' start time: %f, finish time: %f",
            SD_task_get_name(task),
index 260ef34..1265710 100644 (file)
@@ -17,7 +17,7 @@ int main(int argc, char **argv)
 {
   unsigned int ctr;
   const char *platform_file;
 {
   unsigned int ctr;
   const char *platform_file;
-  const SD_workstation_t *workstations;
+  const sg_host_t *workstations;
   SD_task_t task, taskA, taskB, taskC, taskD, taskE;
   xbt_dynar_t changed_tasks;
 
   SD_task_t task, taskA, taskB, taskC, taskD, taskE;
   xbt_dynar_t changed_tasks;
 
@@ -33,7 +33,7 @@ int main(int argc, char **argv)
   platform_file = argv[1];
   SD_create_environment(platform_file);
  
   platform_file = argv[1];
   SD_create_environment(platform_file);
  
-  workstations = SD_workstation_get_list();
+  workstations = sg_host_list();
 
   /* creation of some typed tasks and their dependencies */
   /* chain of five tasks, three compute tasks with two data transfers */
 
   /* creation of some typed tasks and their dependencies */
   /* chain of five tasks, three compute tasks with two data transfers */
index 39d85d3..fc1647c 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
   SD_task_t task;
   double computation_amount[1];
   double communication_amount[2] = { 0 };
   SD_task_t task;
   double computation_amount[1];
   double communication_amount[2] = { 0 };
-  SD_workstation_t workstation_list[1];
+  sg_host_t workstation_list[1];
 
   /* initialization of SD */
   SD_init(&argc, argv);
 
   /* initialization of SD */
   SD_init(&argc, argv);
@@ -36,7 +36,7 @@ int main(int argc, char **argv)
   XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
            SD_task_get_name(task));
 
   XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
            SD_task_get_name(task));
 
-  SD_task_schedulel(task, 1, SD_workstation_get_by_name("Faulty Host"));
+  SD_task_schedulel(task, 1, sg_host_by_name("Faulty Host"));
 
   SD_simulate(-1.0);
 
 
   SD_simulate(-1.0);
 
@@ -49,7 +49,7 @@ int main(int argc, char **argv)
   XBT_INFO("let's unschedule task '%s' and reschedule it on the 'Safe Host'",
            SD_task_get_name(task));
   SD_task_unschedule(task);
   XBT_INFO("let's unschedule task '%s' and reschedule it on the 'Safe Host'",
            SD_task_get_name(task));
   SD_task_unschedule(task);
-  SD_task_schedulel(task, 1, SD_workstation_get_by_name("Safe Host"));
+  SD_task_schedulel(task, 1, sg_host_by_name("Safe Host"));
 
   XBT_INFO("Run the simulation again");
   SD_simulate(-1.0);
 
   XBT_INFO("Run the simulation again");
   SD_simulate(-1.0);
@@ -74,7 +74,7 @@ int main(int argc, char **argv)
   XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
              SD_task_get_name(task));
 
   XBT_INFO("Schedule task '%s' on workstation 'Faulty Host'",
              SD_task_get_name(task));
 
-  workstation_list[0] = SD_workstation_get_by_name("Faulty Host");
+  workstation_list[0] = sg_host_by_name("Faulty Host");
   SD_task_schedule(task, 1, workstation_list,
           computation_amount, communication_amount,-1);
 
   SD_task_schedule(task, 1, workstation_list,
           computation_amount, communication_amount,-1);
 
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
            SD_task_get_name(task));
   SD_task_unschedule(task);
 
            SD_task_get_name(task));
   SD_task_unschedule(task);
 
-  workstation_list[0] = SD_workstation_get_by_name("Safe Host");
+  workstation_list[0] = sg_host_by_name("Safe Host");
 
   SD_task_schedule(task, 1, workstation_list,
                    computation_amount, communication_amount,-1);
 
   SD_task_schedule(task, 1, workstation_list,
                    computation_amount, communication_amount,-1);
index 291ae49..eac945e 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv)
   int i;
   unsigned int ctr;
   const char *platform_file;
   int i;
   unsigned int ctr;
   const char *platform_file;
-  const SD_workstation_t *workstations;
+  const sg_host_t *workstations;
   const char *name1;
   const char *name2;
   double computation_amount1;
   const char *name1;
   const char *name2;
   double computation_amount1;
@@ -31,11 +31,11 @@ int main(int argc, char **argv)
   xbt_dynar_t changed_tasks;
   xbt_ex_t ex;
   const int workstation_number = 2;
   xbt_dynar_t changed_tasks;
   xbt_ex_t ex;
   const int workstation_number = 2;
-  SD_workstation_t workstation_list[2];
+  sg_host_t workstation_list[2];
   double computation_amount[2];
   double communication_amount[4] = { 0 };
   double rate = -1.0;
   double computation_amount[2];
   double communication_amount[4] = { 0 };
   double rate = -1.0;
-  SD_workstation_t w1, w2;
+  sg_host_t w1, w2;
 
   /* initialization of SD */
   SD_init(&argc, argv);
 
   /* initialization of SD */
   SD_init(&argc, argv);
@@ -50,20 +50,20 @@ int main(int argc, char **argv)
   SD_create_environment(platform_file);
 
   /* test the estimation functions */
   SD_create_environment(platform_file);
 
   /* test the estimation functions */
-  workstations = SD_workstation_get_list();
+  workstations = sg_host_list();
   w1 = workstations[0];
   w2 = workstations[1];
   w1 = workstations[0];
   w2 = workstations[1];
-  name1 = SD_workstation_get_name(w1);
-  name2 = SD_workstation_get_name(w2);
+  name1 = sg_host_get_name(w1);
+  name2 = sg_host_get_name(w2);
   computation_amount1 = 2000000;
   computation_amount2 = 1000000;
   communication_amount12 = 2000000;
   communication_amount21 = 3000000;
   XBT_INFO("Computation time for %f flops on %s: %f", computation_amount1,
   computation_amount1 = 2000000;
   computation_amount2 = 1000000;
   communication_amount12 = 2000000;
   communication_amount21 = 3000000;
   XBT_INFO("Computation time for %f flops on %s: %f", computation_amount1,
-        name1, SD_workstation_get_computation_time(w1,
+        name1, sg_host_computation_time(w1,
                                                    computation_amount1));
   XBT_INFO("Computation time for %f flops on %s: %f", computation_amount2,
                                                    computation_amount1));
   XBT_INFO("Computation time for %f flops on %s: %f", computation_amount2,
-        name2, SD_workstation_get_computation_time(w2,
+        name2, sg_host_computation_time(w2,
                                                    computation_amount2));
 
   XBT_INFO("Route between %s and %s:", name1, name2);
                                                    computation_amount2));
 
   XBT_INFO("Route between %s and %s:", name1, name2);
index fa3e413..d589e33 100644 (file)
@@ -18,15 +18,15 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test,
 
 static int nameCompareHosts(const void *n1, const void *n2)
 {
 
 static int nameCompareHosts(const void *n1, const void *n2)
 {
-  return strcmp(SD_workstation_get_name(*((SD_workstation_t *) n1)),
-                SD_workstation_get_name(*((SD_workstation_t *) n2)));
+  return strcmp(sg_host_get_name(*((sg_host_t *) n1)),
+                sg_host_get_name(*((sg_host_t *) n2)));
 }
 
 int main(int argc, char **argv)
 {
   int i, j;
   int n_hosts;
 }
 
 int main(int argc, char **argv)
 {
   int i, j;
   int n_hosts;
-  const SD_workstation_t *hosts;
+  const sg_host_t *hosts;
   SD_task_t taskInit;
   SD_task_t PtoPComm1;
   SD_task_t PtoPComm2;
   SD_task_t taskInit;
   SD_task_t PtoPComm1;
   SD_task_t PtoPComm2;
@@ -36,23 +36,23 @@ int main(int argc, char **argv)
   SD_task_t InterRedist;
   SD_task_t taskFinal;
   SD_task_t ParComp_wcomm2;
   SD_task_t InterRedist;
   SD_task_t taskFinal;
   SD_task_t ParComp_wcomm2;
-  SD_workstation_t PtoPcomm1_hosts[2];
-  SD_workstation_t PtoPcomm2_hosts[2];
+  sg_host_t PtoPcomm1_hosts[2];
+  sg_host_t PtoPcomm2_hosts[2];
   double PtoPcomm1_table[] = { 0, 12500000, 0, 0 };     /* 100Mb */
   double PtoPcomm2_table[] = { 0, 1250000, 0, 0 };      /* 10Mb */
   double ParComp_wocomm_cost[] = { 1e+9, 1e+9, 1e+9, 1e+9, 1e+9 };      /* 1 Gflop per Proc */
   double *ParComp_wocomm_table;
   double PtoPcomm1_table[] = { 0, 12500000, 0, 0 };     /* 100Mb */
   double PtoPcomm2_table[] = { 0, 1250000, 0, 0 };      /* 10Mb */
   double ParComp_wocomm_cost[] = { 1e+9, 1e+9, 1e+9, 1e+9, 1e+9 };      /* 1 Gflop per Proc */
   double *ParComp_wocomm_table;
-  SD_workstation_t ParComp_wocomm_hosts[5];
+  sg_host_t ParComp_wocomm_hosts[5];
   double *IntraRedist_cost;
   double *IntraRedist_table;
   double *IntraRedist_cost;
   double *IntraRedist_table;
-  SD_workstation_t IntraRedist_hosts[5];
+  sg_host_t IntraRedist_hosts[5];
   double ParComp_wcomm1_cost[] = { 1e+9, 1e+9, 1e+9, 1e+9, 1e+9 };      /* 1 Gflop per Proc */
   double *ParComp_wcomm1_table;
   double ParComp_wcomm1_cost[] = { 1e+9, 1e+9, 1e+9, 1e+9, 1e+9 };      /* 1 Gflop per Proc */
   double *ParComp_wcomm1_table;
-  SD_workstation_t ParComp_wcomm1_hosts[5];
+  sg_host_t ParComp_wcomm1_hosts[5];
   double *InterRedist_cost;
   double *InterRedist_table;
   double ParComp_wcomm2_cost[] = { 1e+8, 1e+8, 1e+8, 1e+8, 1e+8 };      /* 1 Gflop per Proc (0.02sec duration) */
   double *InterRedist_cost;
   double *InterRedist_table;
   double ParComp_wcomm2_cost[] = { 1e+8, 1e+8, 1e+8, 1e+8, 1e+8 };      /* 1 Gflop per Proc (0.02sec duration) */
-  SD_workstation_t ParComp_wcomm2_hosts[5];
+  sg_host_t ParComp_wcomm2_hosts[5];
   double final_cost = 5e+9;
   double *ParComp_wcomm2_table;
 
   double final_cost = 5e+9;
   double *ParComp_wcomm2_table;
 
@@ -66,11 +66,11 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   /* getting platform infos */
   SD_create_environment(argv[1]);
 
   /* getting platform infos */
-  n_hosts = SD_workstation_get_count();
-  hosts = SD_workstation_get_list();
+  n_hosts = sg_host_count();
+  hosts = sg_host_list();
 
   /* sorting hosts by hostname */
 
   /* sorting hosts by hostname */
-  qsort((void *) hosts, n_hosts, sizeof(SD_workstation_t),
+  qsort((void *) hosts, n_hosts, sizeof(sg_host_t),
         nameCompareHosts);
 
   /* creation of the tasks */
         nameCompareHosts);
 
   /* creation of the tasks */
index e8fe7b4..4e29f2c 100644 (file)
@@ -18,14 +18,14 @@ int main(int argc, char **argv)
   int i;
   unsigned int ctr;
   const char *platform_file;
   int i;
   unsigned int ctr;
   const char *platform_file;
-  const SD_workstation_t *workstations;
+  const sg_host_t *workstations;
   SD_task_t task, seq_comp1, e2e_comm, seq_comp2;
   SD_task_t par_comp1, redist, par_comp2, par_comp3;
   xbt_dynar_t changed_tasks;
 
   double computation_amount[4];
   double communication_amount[16] = { 0 };
   SD_task_t task, seq_comp1, e2e_comm, seq_comp2;
   SD_task_t par_comp1, redist, par_comp2, par_comp3;
   xbt_dynar_t changed_tasks;
 
   double computation_amount[4];
   double communication_amount[16] = { 0 };
-  SD_workstation_t workstation_list[4];
+  sg_host_t workstation_list[4];
   
   /* initialization of SD */
   SD_init(&argc, argv);
   
   /* initialization of SD */
   SD_init(&argc, argv);
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
   platform_file = argv[1];
   SD_create_environment(platform_file);
  
   platform_file = argv[1];
   SD_create_environment(platform_file);
  
-  workstations = SD_workstation_get_list();
+  workstations = sg_host_list();
 
   /* creation of some typed tasks and their dependencies */
   seq_comp1 = SD_task_create_comp_seq("Seq. comp. 1", NULL, 1e9);
 
   /* creation of some typed tasks and their dependencies */
   seq_comp1 = SD_task_create_comp_seq("Seq. comp. 1", NULL, 1e9);
index 5929ec6..2e2ee13 100644 (file)
@@ -38,12 +38,6 @@ typedef struct s_msg_host_priv *msg_host_priv_t;
 msg_host_priv_t sg_host_msg(sg_host_t host);
 XBT_PUBLIC(void) sg_host_msg_set(sg_host_t host, msg_host_priv_t priv);
 
 msg_host_priv_t sg_host_msg(sg_host_t host);
 XBT_PUBLIC(void) sg_host_msg_set(sg_host_t host, msg_host_priv_t priv);
 
-// ========== SD Layer ==============
-typedef struct SD_workstation *SD_workstation_priv_t;
-SD_workstation_priv_t sg_host_sd(sg_host_t host);
-XBT_PUBLIC(void) sg_host_sd_set(sg_host_t host, SD_workstation_priv_t priv);
-XBT_PUBLIC(void) sg_host_sd_destroy(sg_host_t host);
-
 // ========== Simix layer =============
 typedef struct s_smx_host_priv *smx_host_priv_t;
 XBT_PUBLIC(smx_host_priv_t) sg_host_simix(sg_host_t host);
 // ========== Simix layer =============
 typedef struct s_smx_host_priv *smx_host_priv_t;
 XBT_PUBLIC(smx_host_priv_t) sg_host_simix(sg_host_t host);
index dbd011f..0e149b0 100644 (file)
 #include "simgrid/link.h"
 
 SG_BEGIN_DECL()
 #include "simgrid/link.h"
 
 SG_BEGIN_DECL()
-/** @brief Workstation datatype
-    @ingroup SD_datatypes_management
-
-    A workstation is a place where a task can be executed.
-    A workstation is represented as a <em>physical
-    resource with computing capabilities</em> and has a <em>name</em>.
-
-    @see SD_workstation_management */
-typedef sg_host_t SD_workstation_t;
 
 /** @brief Link datatype
     @ingroup SD_datatypes_management
 
 /** @brief Link datatype
     @ingroup SD_datatypes_management
@@ -84,7 +75,7 @@ typedef xbt_dictelm_t SD_storage_t;
 
 /************************** Workstation handling ****************************/
 
 
 /************************** Workstation handling ****************************/
 
-/** @defgroup SD_workstation_management Workstations
+/** @defgroup sg_host_management Workstations
  *  @brief Functions for managing the workstations
  *
  *  This section describes the functions for managing the workstations.
  *  @brief Functions for managing the workstations
  *
  *  This section describes the functions for managing the workstations.
@@ -95,48 +86,34 @@ typedef xbt_dictelm_t SD_storage_t;
  *
  *  The workstations are created when you call the function SD_create_environment.
  *
  *
  *  The workstations are created when you call the function SD_create_environment.
  *
- *  @see SD_workstation_t
+ *  @see sg_host_t
  *  @{
  */
  *  @{
  */
-XBT_PUBLIC(SD_workstation_t) SD_workstation_get_by_name(const char *name);
-XBT_PUBLIC(const SD_workstation_t *) SD_workstation_get_list(void);
-XBT_PUBLIC(int) SD_workstation_get_count(void);
-XBT_PUBLIC(void) SD_workstation_set_data(SD_workstation_t workstation,
-                                         void *data);
-XBT_PUBLIC(void *) SD_workstation_get_data(SD_workstation_t workstation);
-XBT_PUBLIC(const char *) SD_workstation_get_name(SD_workstation_t
-                                                 workstation);
-/*property handling functions*/
-XBT_PUBLIC(xbt_dict_t) SD_workstation_get_properties(SD_workstation_t
-                                                     workstation);
-XBT_PUBLIC(const char *) SD_workstation_get_property_value(SD_workstation_t
-                                                           workstation,
-                                                           const char
-                                                           *name);
-XBT_PUBLIC(void) SD_workstation_dump(SD_workstation_t ws);
-XBT_PUBLIC(const SD_link_t *) SD_route_get_list(SD_workstation_t src,
-                                                SD_workstation_t dst);
-XBT_PUBLIC(int) SD_route_get_size(SD_workstation_t src,
-                                  SD_workstation_t dst);
-XBT_PUBLIC(double) SD_workstation_get_speed(SD_workstation_t workstation);
-XBT_PUBLIC(double) SD_workstation_get_available_speed(SD_workstation_t
-                                                      workstation);
-XBT_PUBLIC(int) SD_workstation_get_cores(SD_workstation_t workstation);
-
-XBT_PUBLIC(double) SD_workstation_get_computation_time(SD_workstation_t workstation,
-                                                       double flops_amount);
-XBT_PUBLIC(double) SD_route_get_latency(SD_workstation_t src,
-                                                SD_workstation_t dst);
-XBT_PUBLIC(double) SD_route_get_bandwidth(SD_workstation_t src,
-                                                  SD_workstation_t dst);
-XBT_PUBLIC(double) SD_route_get_communication_time(SD_workstation_t src,
-                                                   SD_workstation_t dst,
-                                                   double bytes_amount);
+XBT_PUBLIC(const sg_host_t *) sg_host_list(void);
 
 
+XBT_PUBLIC(void) sg_host_dump(sg_host_t ws);
+XBT_PUBLIC(double) sg_host_speed(sg_host_t workstation);
+XBT_PUBLIC(int) sg_host_core_count(sg_host_t workstation);
+XBT_PUBLIC(double) sg_host_computation_time(sg_host_t workstation,
+                                                       double flops_amount);
 XBT_PUBLIC(xbt_dict_t)
 XBT_PUBLIC(xbt_dict_t)
-    SD_workstation_get_mounted_storage_list(SD_workstation_t workstation);
+    sg_host_get_mounted_storage_list(sg_host_t workstation);
 XBT_PUBLIC(xbt_dynar_t)
 XBT_PUBLIC(xbt_dynar_t)
-    SD_workstation_get_attached_storage_list(SD_workstation_t workstation);
+    sg_host_get_attached_storage_list(sg_host_t workstation);
+
+XBT_PUBLIC(const SD_link_t *) SD_route_get_list(sg_host_t src,
+                                                sg_host_t dst);
+XBT_PUBLIC(int) SD_route_get_size(sg_host_t src,
+                                  sg_host_t dst);
+
+XBT_PUBLIC(double) SD_route_get_latency(sg_host_t src,
+                                                sg_host_t dst);
+XBT_PUBLIC(double) SD_route_get_bandwidth(sg_host_t src,
+                                                  sg_host_t dst);
+XBT_PUBLIC(double) SD_route_get_communication_time(sg_host_t src,
+                                                   sg_host_t dst,
+                                                   double bytes_amount);
+
 XBT_PUBLIC(const char*) SD_storage_get_host(SD_storage_t storage);
 /** @} */
 
 XBT_PUBLIC(const char*) SD_storage_get_host(SD_storage_t storage);
 /** @} */
 
@@ -173,13 +150,13 @@ XBT_PUBLIC(double) SD_task_get_alpha(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_remaining_amount(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task,
                                               int workstation_nb,
 XBT_PUBLIC(double) SD_task_get_remaining_amount(SD_task_t task);
 XBT_PUBLIC(double) SD_task_get_execution_time(SD_task_t task,
                                               int workstation_nb,
-                                              const SD_workstation_t *
+                                              const sg_host_t *
                                               workstation_list,
                                               const double *flops_amount,
                                               const double *bytes_amount);
 XBT_PUBLIC(e_SD_task_kind_t) SD_task_get_kind(SD_task_t task);
 XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb,
                                               workstation_list,
                                               const double *flops_amount,
                                               const double *bytes_amount);
 XBT_PUBLIC(e_SD_task_kind_t) SD_task_get_kind(SD_task_t task);
 XBT_PUBLIC(void) SD_task_schedule(SD_task_t task, int workstation_nb,
-                                  const SD_workstation_t *
+                                  const sg_host_t *
                                   workstation_list,
                                   const double *flops_amount,
                                   const double *bytes_amount,
                                   workstation_list,
                                   const double *flops_amount,
                                   const double *bytes_amount,
@@ -190,7 +167,7 @@ XBT_PUBLIC(double) SD_task_get_finish_time(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_parents(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_children(SD_task_t task);
 XBT_PUBLIC(int) SD_task_get_workstation_count(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_parents(SD_task_t task);
 XBT_PUBLIC(xbt_dynar_t) SD_task_get_children(SD_task_t task);
 XBT_PUBLIC(int) SD_task_get_workstation_count(SD_task_t task);
-XBT_PUBLIC(SD_workstation_t *) SD_task_get_workstation_list(SD_task_t
+XBT_PUBLIC(sg_host_t *) SD_task_get_workstation_list(SD_task_t
                                                             task);
 XBT_PUBLIC(void) SD_task_destroy(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dump(SD_task_t task);
                                                             task);
 XBT_PUBLIC(void) SD_task_destroy(SD_task_t task);
 XBT_PUBLIC(void) SD_task_dump(SD_task_t task);
@@ -210,7 +187,7 @@ XBT_PUBLIC(SD_task_t) SD_task_create_comm_par_mxn_1d_block(const char *name,
 
 XBT_PUBLIC(void) SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count);
 XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count,
 
 XBT_PUBLIC(void) SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count);
 XBT_PUBLIC(void) SD_task_schedulev(SD_task_t task, int count,
-                                   const SD_workstation_t * list);
+                                   const sg_host_t * list);
 XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
 
 
 XBT_PUBLIC(void) SD_task_schedulel(SD_task_t task, int count, ...);
 
 
index 3be55fd..9333294 100644 (file)
@@ -76,7 +76,7 @@ xbt_dynar_t SD_dotload_with_sched(const char *filename) {
     xbt_dynar_t computer = NULL;
     xbt_dict_cursor_t dict_cursor;
     char *computer_name;
     xbt_dynar_t computer = NULL;
     xbt_dict_cursor_t dict_cursor;
     char *computer_name;
-    const SD_workstation_t *workstations = SD_workstation_get_list ();
+    const sg_host_t *workstations = sg_host_list ();
     xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
       int count_computer = atoi(computer_name);
       unsigned int count=0;
     xbt_dict_foreach(computers,dict_cursor,computer_name,computer){
       int count_computer = atoi(computer_name);
       unsigned int count=0;
index ddd1ce1..79d0cbf 100644 (file)
@@ -50,7 +50,7 @@ void SD_init(int *argc, char **argv)
   xbt_assert(sd_global == NULL, "SD_init() already called");
 
   sd_global = xbt_new(s_SD_global_t, 1);
   xbt_assert(sd_global == NULL, "SD_init() already called");
 
   sd_global = xbt_new(s_SD_global_t, 1);
-  sd_global->workstation_list = NULL;
+  sd_global->host_list = NULL;
   sd_global->link_list = NULL;
   sd_global->recyclable_route = NULL;
   sd_global->watch_point_reached = 0;
   sd_global->link_list = NULL;
   sd_global->recyclable_route = NULL;
   sd_global->watch_point_reached = 0;
@@ -148,12 +148,12 @@ void SD_application_reinit(void)
 /**
  * \brief Creates the environment
  *
 /**
  * \brief Creates the environment
  *
- * The environment (i.e. the \ref SD_workstation_management "workstations"
+ * The environment (i.e. the \ref sg_host_management "hosts"
  * and the \ref SD_link_management "links") is created with the data stored
  * in the given XML platform file.
  *
  * \param platform_file name of an XML file describing the environment to create
  * and the \ref SD_link_management "links") is created with the data stored
  * in the given XML platform file.
  *
  * \param platform_file name of an XML file describing the environment to create
- * \see SD_workstation_management, SD_link_management
+ * \see sg_host_management, SD_link_management
  *
  * The XML file follows this DTD:
  *
  *
  * The XML file follows this DTD:
  *
@@ -380,7 +380,7 @@ void SD_exit(void)
   xbt_mallocator_free(sd_global->task_mallocator);
 
   XBT_DEBUG("Destroying workstation and link arrays...");
   xbt_mallocator_free(sd_global->task_mallocator);
 
   XBT_DEBUG("Destroying workstation and link arrays...");
-  xbt_free(sd_global->workstation_list);
+  xbt_free(sd_global->host_list);
   xbt_free(sd_global->link_list);
   xbt_free(sd_global->recyclable_route);
 
   xbt_free(sd_global->link_list);
   xbt_free(sd_global->recyclable_route);
 
index ec7cc99..970cc7a 100644 (file)
@@ -50,8 +50,8 @@ void SD_task_recycle_f(void *t)
   task->is_not_ready = 0;
 
   /* scheduling parameters */
   task->is_not_ready = 0;
 
   /* scheduling parameters */
-  task->workstation_nb = 0;
-  task->workstation_list = NULL;
+  task->host_count = 0;
+  task->host_list = NULL;
   task->flops_amount = NULL;
   task->bytes_amount = NULL;
   task->rate = -1;
   task->flops_amount = NULL;
   task->bytes_amount = NULL;
   task->rate = -1;
@@ -97,8 +97,8 @@ static XBT_INLINE SD_task_t SD_task_create_sized(const char *name,
   SD_task_t task = SD_task_create(name, data, amount);
   task->bytes_amount = xbt_new0(double, ws_count * ws_count);
   task->flops_amount = xbt_new0(double, ws_count);
   SD_task_t task = SD_task_create(name, data, amount);
   task->bytes_amount = xbt_new0(double, ws_count * ws_count);
   task->flops_amount = xbt_new0(double, ws_count);
-  task->workstation_nb = ws_count;
-  task->workstation_list = xbt_new0(SD_workstation_t, ws_count);
+  task->host_count = ws_count;
+  task->host_list = xbt_new0(sg_host_t, ws_count);
   return task;
 }
 
   return task;
 }
 
@@ -200,7 +200,7 @@ SD_task_t SD_task_create_comm_par_mxn_1d_block(const char *name, void *data,
                                                double amount)
 {
   SD_task_t res = SD_task_create(name, data, amount);
                                                double amount)
 {
   SD_task_t res = SD_task_create(name, data, amount);
-  res->workstation_list=NULL;
+  res->host_list=NULL;
   res->kind = SD_TASK_COMM_PAR_MXN_1D_BLOCK;
 
   return res;
   res->kind = SD_TASK_COMM_PAR_MXN_1D_BLOCK;
 
   return res;
@@ -234,7 +234,7 @@ void SD_task_destroy(SD_task_t task)
   if (task->surf_action != NULL)
     task->surf_action->unref();
 
   if (task->surf_action != NULL)
     task->surf_action->unref();
 
-  xbt_free(task->workstation_list);
+  xbt_free(task->host_list);
   xbt_free(task->bytes_amount);
   xbt_free(task->flops_amount);
 
   xbt_free(task->bytes_amount);
   xbt_free(task->flops_amount);
 
@@ -429,7 +429,7 @@ xbt_dynar_t SD_task_get_children(SD_task_t task)
  */
 int SD_task_get_workstation_count(SD_task_t task)
 {
  */
 int SD_task_get_workstation_count(SD_task_t task)
 {
-  return task->workstation_nb;
+  return task->host_count;
 }
 
 /**
 }
 
 /**
@@ -438,9 +438,9 @@ int SD_task_get_workstation_count(SD_task_t task)
  * Only call this on already scheduled tasks!
  * \param task a task
  */
  * Only call this on already scheduled tasks!
  * \param task a task
  */
-SD_workstation_t *SD_task_get_workstation_list(SD_task_t task)
+sg_host_t *SD_task_get_workstation_list(SD_task_t task)
 {
 {
-  return task->workstation_list;
+  return task->host_list;
 }
 
 /**
 }
 
 /**
@@ -886,7 +886,7 @@ void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state)
  */
 double SD_task_get_execution_time(SD_task_t task,
                                   int workstation_nb,
  */
 double SD_task_get_execution_time(SD_task_t task,
                                   int workstation_nb,
-                                  const SD_workstation_t *
+                                  const sg_host_t *
                                   workstation_list,
                                   const double *flops_amount,
                                   const double *bytes_amount)
                                   workstation_list,
                                   const double *flops_amount,
                                   const double *bytes_amount)
@@ -901,7 +901,7 @@ double SD_task_get_execution_time(SD_task_t task,
     time = 0.0;
     if (flops_amount != NULL)
       time =
     time = 0.0;
     if (flops_amount != NULL)
       time =
-          SD_workstation_get_computation_time(workstation_list[i],
+          sg_host_computation_time(workstation_list[i],
                                               flops_amount[i]);
 
     if (bytes_amount != NULL)
                                               flops_amount[i]);
 
     if (bytes_amount != NULL)
@@ -950,13 +950,13 @@ static XBT_INLINE void SD_task_do_schedule(SD_task_t task)
  * \see SD_task_unschedule()
  */
 void SD_task_schedule(SD_task_t task, int workstation_count,
  * \see SD_task_unschedule()
  */
 void SD_task_schedule(SD_task_t task, int workstation_count,
-                      const SD_workstation_t * workstation_list,
+                      const sg_host_t * workstation_list,
                       const double *flops_amount,
                       const double *bytes_amount, double rate)
 {
   xbt_assert(workstation_count > 0, "workstation_nb must be positive");
 
                       const double *flops_amount,
                       const double *bytes_amount, double rate)
 {
   xbt_assert(workstation_count > 0, "workstation_nb must be positive");
 
-  task->workstation_nb = workstation_count;
+  task->host_count = workstation_count;
   task->rate = rate;
 
   if (flops_amount) {
   task->rate = rate;
 
   if (flops_amount) {
@@ -980,11 +980,11 @@ void SD_task_schedule(SD_task_t task, int workstation_count,
     task->bytes_amount = NULL;
   }
 
     task->bytes_amount = NULL;
   }
 
-  task->workstation_list = (SD_workstation_t*)
-    xbt_realloc(task->workstation_list,
-                sizeof(SD_workstation_t) * workstation_count);
-  memcpy(task->workstation_list, workstation_list,
-         sizeof(SD_workstation_t) * workstation_count);
+  task->host_list = (sg_host_t*)
+    xbt_realloc(task->host_list,
+                sizeof(sg_host_t) * workstation_count);
+  memcpy(task->host_list, workstation_list,
+         sizeof(sg_host_t) * workstation_count);
 
   SD_task_do_schedule(task);
 }
 
   SD_task_do_schedule(task);
 }
@@ -1013,9 +1013,9 @@ void SD_task_unschedule(SD_task_t task)
       && ((task->kind == SD_TASK_COMP_PAR_AMDAHL) ||
           (task->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK))) { /* Don't free scheduling data for typed tasks */
     __SD_task_destroy_scheduling_data(task);
       && ((task->kind == SD_TASK_COMP_PAR_AMDAHL) ||
           (task->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK))) { /* Don't free scheduling data for typed tasks */
     __SD_task_destroy_scheduling_data(task);
-    xbt_free(task->workstation_list);
-    task->workstation_list=NULL;
-    task->workstation_nb = 0;
+    xbt_free(task->host_list);
+    task->host_list=NULL;
+    task->host_count = 0;
   }
 
   if (SD_task_get_state(task) == SD_RUNNING)
   }
 
   if (SD_task_get_state(task) == SD_RUNNING)
@@ -1059,18 +1059,18 @@ void SD_task_run(SD_task_t task)
   xbt_assert(SD_task_get_state(task) == SD_RUNNABLE,
              "Task '%s' is not runnable! Task state: %d",
              SD_task_get_name(task), (int)SD_task_get_state(task));
   xbt_assert(SD_task_get_state(task) == SD_RUNNABLE,
              "Task '%s' is not runnable! Task state: %d",
              SD_task_get_name(task), (int)SD_task_get_state(task));
-  xbt_assert(task->workstation_list != NULL,
+  xbt_assert(task->host_list != NULL,
               "Task '%s': workstation_list is NULL!",
               SD_task_get_name(task));
 
   XBT_DEBUG("Running task '%s'", SD_task_get_name(task));
 
   /* Copy the elements of the task into the action */
               "Task '%s': workstation_list is NULL!",
               SD_task_get_name(task));
 
   XBT_DEBUG("Running task '%s'", SD_task_get_name(task));
 
   /* Copy the elements of the task into the action */
-  int host_nb = task->workstation_nb;
+  int host_nb = task->host_count;
   hosts = xbt_new(sg_host_t, host_nb);
 
   for (i = 0; i < host_nb; i++)
   hosts = xbt_new(sg_host_t, host_nb);
 
   for (i = 0; i < host_nb; i++)
-    hosts[i] =  task->workstation_list[i];
+    hosts[i] =  task->host_list[i];
 
   double *flops_amount = xbt_new0(double, host_nb);
   double *bytes_amount = xbt_new0(double, host_nb * host_nb);
 
   double *flops_amount = xbt_new0(double, host_nb);
   double *bytes_amount = xbt_new0(double, host_nb * host_nb);
@@ -1165,9 +1165,9 @@ void SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count)
               SD_task_get_name(task));  
   task->flops_amount = xbt_new0(double, ws_count);
   task->bytes_amount = xbt_new0(double, ws_count * ws_count);
               SD_task_get_name(task));  
   task->flops_amount = xbt_new0(double, ws_count);
   task->bytes_amount = xbt_new0(double, ws_count * ws_count);
-  xbt_free(task->workstation_list);
-  task->workstation_nb = ws_count;
-  task->workstation_list = xbt_new0(SD_workstation_t, ws_count);
+  xbt_free(task->host_list);
+  task->host_count = ws_count;
+  task->host_list = xbt_new0(sg_host_t, ws_count);
   
   for(i=0;i<ws_count;i++){
     task->flops_amount[i] = 
   
   for(i=0;i<ws_count;i++){
     task->flops_amount[i] = 
@@ -1198,7 +1198,7 @@ void SD_task_distribute_comp_amdahl(SD_task_t task, int ws_count)
  *    comm cost alongside to comp one)
  */
 void SD_task_schedulev(SD_task_t task, int count,
  *    comm cost alongside to comp one)
  */
 void SD_task_schedulev(SD_task_t task, int count,
-                       const SD_workstation_t * list)
+                       const sg_host_t * list)
 {
   int i, j;
   SD_dependency_t dep;
 {
   int i, j;
   SD_dependency_t dep;
@@ -1211,11 +1211,11 @@ void SD_task_schedulev(SD_task_t task, int count,
     SD_task_distribute_comp_amdahl(task, count);
   case SD_TASK_COMM_E2E:
   case SD_TASK_COMP_SEQ:
     SD_task_distribute_comp_amdahl(task, count);
   case SD_TASK_COMM_E2E:
   case SD_TASK_COMP_SEQ:
-    xbt_assert(task->workstation_nb == count,
+    xbt_assert(task->host_count == count,
                "Got %d locations, but were expecting %d locations",
                "Got %d locations, but were expecting %d locations",
-               count,task->workstation_nb);
+               count,task->host_count);
     for (i = 0; i < count; i++)
     for (i = 0; i < count; i++)
-      task->workstation_list[i] = list[i];
+      task->host_list[i] = list[i];
     if (SD_task_get_kind(task)== SD_TASK_COMP_SEQ && !task->flops_amount){
       /*This task has failed and is rescheduled. Reset the flops_amount*/
       task->flops_amount = xbt_new0(double, 1);
     if (SD_task_get_kind(task)== SD_TASK_COMP_SEQ && !task->flops_amount){
       /*This task has failed and is rescheduled. Reset the flops_amount*/
       task->flops_amount = xbt_new0(double, 1);
@@ -1230,8 +1230,8 @@ void SD_task_schedulev(SD_task_t task, int count,
   if (task->kind == SD_TASK_COMM_E2E) {
     XBT_VERB("Schedule comm task %s between %s -> %s. It costs %.f bytes",
           SD_task_get_name(task),
   if (task->kind == SD_TASK_COMM_E2E) {
     XBT_VERB("Schedule comm task %s between %s -> %s. It costs %.f bytes",
           SD_task_get_name(task),
-          sg_host_get_name(task->workstation_list[0]),
-          sg_host_get_name(task->workstation_list[1]),
+          sg_host_get_name(task->host_list[0]),
+          sg_host_get_name(task->host_list[1]),
           task->bytes_amount[2]);
 
   }
           task->bytes_amount[2]);
 
   }
@@ -1241,22 +1241,22 @@ void SD_task_schedulev(SD_task_t task, int count,
   if (task->kind == SD_TASK_COMP_SEQ) {
     XBT_VERB("Schedule computation task %s on %s. It costs %.f flops",
           SD_task_get_name(task),
   if (task->kind == SD_TASK_COMP_SEQ) {
     XBT_VERB("Schedule computation task %s on %s. It costs %.f flops",
           SD_task_get_name(task),
-          sg_host_get_name(task->workstation_list[0]),
+          sg_host_get_name(task->host_list[0]),
           task->flops_amount[0]);
 
     xbt_dynar_foreach(task->tasks_before, cpt, dep) {
       SD_task_t before = dep->src;
       if (before->kind == SD_TASK_COMM_E2E) {
           task->flops_amount[0]);
 
     xbt_dynar_foreach(task->tasks_before, cpt, dep) {
       SD_task_t before = dep->src;
       if (before->kind == SD_TASK_COMM_E2E) {
-        before->workstation_list[1] = task->workstation_list[0];
+        before->host_list[1] = task->host_list[0];
 
 
-        if (before->workstation_list[0] &&
+        if (before->host_list[0] &&
             (SD_task_get_state(before)< SD_SCHEDULED)) {
           SD_task_do_schedule(before);
           XBT_VERB
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(before),
             (SD_task_get_state(before)< SD_SCHEDULED)) {
           SD_task_do_schedule(before);
           XBT_VERB
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(before),
-               sg_host_get_name(before->workstation_list[0]),
-               sg_host_get_name(before->workstation_list[1]),
+               sg_host_get_name(before->host_list[0]),
+               sg_host_get_name(before->host_list[1]),
                before->bytes_amount[2]);
         }
       }
                before->bytes_amount[2]);
         }
       }
@@ -1264,15 +1264,15 @@ void SD_task_schedulev(SD_task_t task, int count,
     xbt_dynar_foreach(task->tasks_after, cpt, dep) {
       SD_task_t after = dep->dst;
       if (after->kind == SD_TASK_COMM_E2E) {
     xbt_dynar_foreach(task->tasks_after, cpt, dep) {
       SD_task_t after = dep->dst;
       if (after->kind == SD_TASK_COMM_E2E) {
-        after->workstation_list[0] = task->workstation_list[0];
-        if (after->workstation_list[1]
+        after->host_list[0] = task->host_list[0];
+        if (after->host_list[1]
             && (SD_task_get_state(after)< SD_SCHEDULED)) {
           SD_task_do_schedule(after);
           XBT_VERB
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(after),
             && (SD_task_get_state(after)< SD_SCHEDULED)) {
           SD_task_do_schedule(after);
           XBT_VERB
               ("Auto-Schedule comm task %s between %s -> %s. It costs %.f bytes",
                SD_task_get_name(after),
-               sg_host_get_name(after->workstation_list[0]),
-               sg_host_get_name(after->workstation_list[1]),
+               sg_host_get_name(after->host_list[0]),
+               sg_host_get_name(after->host_list[1]),
                after->bytes_amount[2]);
 
         }
                after->bytes_amount[2]);
 
         }
@@ -1284,42 +1284,42 @@ void SD_task_schedulev(SD_task_t task, int count,
   if (task->kind == SD_TASK_COMP_PAR_AMDAHL) {
     XBT_VERB("Schedule computation task %s on %d workstations. %.f flops"
              " will be distributed following Amdahl's Law",
   if (task->kind == SD_TASK_COMP_PAR_AMDAHL) {
     XBT_VERB("Schedule computation task %s on %d workstations. %.f flops"
              " will be distributed following Amdahl's Law",
-          SD_task_get_name(task), task->workstation_nb,
+          SD_task_get_name(task), task->host_count,
           task->flops_amount[0]);
     xbt_dynar_foreach(task->tasks_before, cpt, dep) {
       SD_task_t before = dep->src;
       if (before->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
           task->flops_amount[0]);
     xbt_dynar_foreach(task->tasks_before, cpt, dep) {
       SD_task_t before = dep->src;
       if (before->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
-        if (!before->workstation_list){
+        if (!before->host_list){
           XBT_VERB("Sender side of Task %s is not scheduled yet",
              SD_task_get_name(before));
           XBT_VERB("Sender side of Task %s is not scheduled yet",
              SD_task_get_name(before));
-          before->workstation_list = xbt_new0(SD_workstation_t, count);
-          before->workstation_nb = count;
+          before->host_list = xbt_new0(sg_host_t, count);
+          before->host_count = count;
           XBT_VERB("Fill the workstation list with list of Task '%s'",
             SD_task_get_name(task));
           for (i=0;i<count;i++)
           XBT_VERB("Fill the workstation list with list of Task '%s'",
             SD_task_get_name(task));
           for (i=0;i<count;i++)
-            before->workstation_list[i] = task->workstation_list[i];
+            before->host_list[i] = task->host_list[i];
         } else {
           XBT_VERB("Build communication matrix for task '%s'",
              SD_task_get_name(before));
           int src_nb, dst_nb;
           double src_start, src_end, dst_start, dst_end;
         } else {
           XBT_VERB("Build communication matrix for task '%s'",
              SD_task_get_name(before));
           int src_nb, dst_nb;
           double src_start, src_end, dst_start, dst_end;
-          src_nb = before->workstation_nb;
+          src_nb = before->host_count;
           dst_nb = count;
           dst_nb = count;
-          before->workstation_list = (SD_workstation_t*) xbt_realloc(
-             before->workstation_list,
-             (before->workstation_nb+count)*sizeof(s_SD_workstation_t));
+          before->host_list = (sg_host_t*) xbt_realloc(
+             before->host_list,
+             (before->host_count+count)*sizeof(sg_host_t));
           for(i=0; i<count; i++)
           for(i=0; i<count; i++)
-            before->workstation_list[before->workstation_nb+i] =
-               task->workstation_list[i];
+            before->host_list[before->host_count+i] =
+               task->host_list[i];
 
 
-          before->workstation_nb += count;
+          before->host_count += count;
           xbt_free(before->flops_amount);
           xbt_free(before->bytes_amount);
           before->flops_amount = xbt_new0(double,
           xbt_free(before->flops_amount);
           xbt_free(before->bytes_amount);
           before->flops_amount = xbt_new0(double,
-                                                before->workstation_nb);
+                                                before->host_count);
           before->bytes_amount = xbt_new0(double,
           before->bytes_amount = xbt_new0(double,
-                                                  before->workstation_nb*
-                                                  before->workstation_nb);
+                                                  before->host_count*
+                                                  before->host_count);
 
           for(i=0;i<src_nb;i++){
             src_start = i*before->amount/src_nb;
 
           for(i=0;i<src_nb;i++){
             src_start = i*before->amount/src_nb;
@@ -1328,8 +1328,8 @@ void SD_task_schedulev(SD_task_t task, int count,
               dst_start = j*before->amount/dst_nb;
               dst_end = dst_start + before->amount/dst_nb;
               XBT_VERB("(%s->%s): (%.2f, %.2f)-> (%.2f, %.2f)",
               dst_start = j*before->amount/dst_nb;
               dst_end = dst_start + before->amount/dst_nb;
               XBT_VERB("(%s->%s): (%.2f, %.2f)-> (%.2f, %.2f)",
-                  sg_host_get_name(before->workstation_list[i]),
-                  sg_host_get_name(before->workstation_list[src_nb+j]),
+                  sg_host_get_name(before->host_list[i]),
+                  sg_host_get_name(before->host_list[src_nb+j]),
                   src_start, src_end, dst_start, dst_end);
               if ((src_end <= dst_start) || (dst_end <= src_start)) {
                 before->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
                   src_start, src_end, dst_start, dst_end);
               if ((src_end <= dst_start) || (dst_end <= src_start)) {
                 before->bytes_amount[i*(src_nb+dst_nb)+src_nb+j]=0.0;
@@ -1354,37 +1354,37 @@ void SD_task_schedulev(SD_task_t task, int count,
     xbt_dynar_foreach(task->tasks_after, cpt, dep) {
       SD_task_t after = dep->dst;
       if (after->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
     xbt_dynar_foreach(task->tasks_after, cpt, dep) {
       SD_task_t after = dep->dst;
       if (after->kind == SD_TASK_COMM_PAR_MXN_1D_BLOCK){
-        if (!after->workstation_list){
+        if (!after->host_list){
           XBT_VERB("Receiver side of Task '%s' is not scheduled yet",
               SD_task_get_name(after));
           XBT_VERB("Receiver side of Task '%s' is not scheduled yet",
               SD_task_get_name(after));
-          after->workstation_list = xbt_new0(SD_workstation_t, count);
-          after->workstation_nb = count;
+          after->host_list = xbt_new0(sg_host_t, count);
+          after->host_count = count;
           XBT_VERB("Fill the workstation list with list of Task '%s'",
             SD_task_get_name(task));
           for (i=0;i<count;i++)
           XBT_VERB("Fill the workstation list with list of Task '%s'",
             SD_task_get_name(task));
           for (i=0;i<count;i++)
-            after->workstation_list[i] = task->workstation_list[i];
+            after->host_list[i] = task->host_list[i];
         } else {
           int src_nb, dst_nb;
           double src_start, src_end, dst_start, dst_end;
           src_nb = count;
         } else {
           int src_nb, dst_nb;
           double src_start, src_end, dst_start, dst_end;
           src_nb = count;
-          dst_nb = after->workstation_nb;
-          after->workstation_list = (SD_workstation_t*) xbt_realloc(
-            after->workstation_list,
-            (after->workstation_nb+count)*sizeof(s_SD_workstation_t));
-          for(i=after->workstation_nb - 1; i>=0; i--)
-            after->workstation_list[count+i] = after->workstation_list[i];
+          dst_nb = after->host_count;
+          after->host_list = (sg_host_t*) xbt_realloc(
+            after->host_list,
+            (after->host_count+count)*sizeof(sg_host_t));
+          for(i=after->host_count - 1; i>=0; i--)
+            after->host_list[count+i] = after->host_list[i];
           for(i=0; i<count; i++)
           for(i=0; i<count; i++)
-            after->workstation_list[i] = task->workstation_list[i];
+            after->host_list[i] = task->host_list[i];
 
 
-          after->workstation_nb += count;
+          after->host_count += count;
 
           xbt_free(after->flops_amount);
           xbt_free(after->bytes_amount);
 
 
           xbt_free(after->flops_amount);
           xbt_free(after->bytes_amount);
 
-          after->flops_amount = xbt_new0(double, after->workstation_nb);
+          after->flops_amount = xbt_new0(double, after->host_count);
           after->bytes_amount = xbt_new0(double,
           after->bytes_amount = xbt_new0(double,
-                                                 after->workstation_nb*
-                                                 after->workstation_nb);
+                                                 after->host_count*
+                                                 after->host_count);
 
           for(i=0;i<src_nb;i++){
             src_start = i*after->amount/src_nb;
 
           for(i=0;i<src_nb;i++){
             src_start = i*after->amount/src_nb;
@@ -1426,11 +1426,11 @@ void SD_task_schedulev(SD_task_t task, int count,
 void SD_task_schedulel(SD_task_t task, int count, ...)
 {
   va_list ap;
 void SD_task_schedulel(SD_task_t task, int count, ...)
 {
   va_list ap;
-  SD_workstation_t *list = xbt_new(SD_workstation_t, count);
+  sg_host_t *list = xbt_new(sg_host_t, count);
   int i;
   va_start(ap, count);
   for (i = 0; i < count; i++) {
   int i;
   va_start(ap, count);
   for (i = 0; i < count; i++) {
-    list[i] = va_arg(ap, SD_workstation_t);
+    list[i] = va_arg(ap, sg_host_t);
   }
   va_end(ap);
   SD_task_schedulev(task, count, list);
   }
   va_end(ap);
   SD_task_schedulev(task, count, list);
index d037b79..838f731 100644 (file)
@@ -7,6 +7,7 @@
 #include "src/surf/host_interface.hpp"
 #include "src/simdag/simdag_private.h"
 #include "simgrid/simdag.h"
 #include "src/surf/host_interface.hpp"
 #include "src/simdag/simdag_private.h"
 #include "simgrid/simdag.h"
+#include "simgrid/host.h"
 #include <simgrid/s4u/host.hpp>
 #include "xbt/dict.h"
 #include "xbt/lib.h"
 #include <simgrid/s4u/host.hpp>
 #include "xbt/dict.h"
 #include "xbt/lib.h"
@@ -42,114 +43,26 @@ void __SD_storage_destroy(void *storage)
   xbt_free(s);
 }
 
   xbt_free(s);
 }
 
-/**
- * \brief Returns a workstation given its name
- *
- * If there is no such workstation, the function returns \c NULL.
- *
- * \param name workstation name
- * \return the workstation, or \c NULL if there is no such workstation
- */
-SD_workstation_t SD_workstation_get_by_name(const char *name)
-{
-  return sg_host_by_name(name);
-}
-
 /**
  * \brief Returns the workstation list
  *
 /**
  * \brief Returns the workstation list
  *
- * Use SD_workstation_get_count() to know the array size.
+ * Use sg_host_count() to know the array size.
  * 
  * 
- * \return an array of \ref SD_workstation_t containing all workstations
+ * \return an array of \ref sg_host_t containing all workstations
  * \remark The workstation order in the returned array is generally different from the workstation creation/declaration order in the XML platform (we use a hash table internally).
  * \remark The workstation order in the returned array is generally different from the workstation creation/declaration order in the XML platform (we use a hash table internally).
- * \see SD_workstation_get_count()
- */
-const SD_workstation_t *SD_workstation_get_list(void) {
-  xbt_assert(SD_workstation_get_count() > 0, "There is no workstation!");
-
-  if (sd_global->workstation_list == NULL)     /* this is the first time the function is called */
-    sd_global->workstation_list = (SD_workstation_t*)xbt_dynar_to_array(sg_hosts_as_dynar());
-
-  return sd_global->workstation_list;
-}
-
-/**
- * \brief Returns the number of workstations
- *
- * \return the number of existing workstations
- * \see SD_workstation_get_list()
- */
-int SD_workstation_get_count(void)
-{
-  return sg_host_count();
-}
-
-/**
- * \brief Returns the user data of a workstation
- *
- * \param workstation a workstation
- * \return the user data associated with this workstation (can be \c NULL)
- * \see SD_workstation_set_data()
- */
-void *SD_workstation_get_data(SD_workstation_t workstation)
-{
-  return sg_host_user(workstation);
-}
-
-/**
- * \brief Sets the user data of a workstation
- *
- * The new data can be \c NULL. The old data should have been freed first
- * if it was not \c NULL.
- *
- * \param workstation a workstation
- * \param data the new data you want to associate with this workstation
- * \see SD_workstation_get_data()
- */
-void SD_workstation_set_data(SD_workstation_t workstation, void *data)
-{
-       sg_host_user_set(workstation, data);
-}
-
-/**
- * \brief Returns the name of a workstation
- *
- * \param workstation a workstation
- * \return the name of this workstation (cannot be \c NULL)
+ * \see sg_host_count()
  */
  */
-const char *SD_workstation_get_name(SD_workstation_t workstation)
-{
-  return sg_host_get_name(workstation);
-}
-
-/**
- * \brief Returns the value of a given workstation property
- *
- * \param ws a workstation
- * \param name a property name
- * \return value of a property (or NULL if property not set)
- */
-const char *SD_workstation_get_property_value(SD_workstation_t ws,
-                                              const char *name)
-{
-  return (const char*) xbt_dict_get_or_null(sg_host_get_properties(ws), name);
-}
+const sg_host_t *sg_host_list(void) {
+  xbt_assert(sg_host_count() > 0, "There is no workstation!");
 
 
+  if (sd_global->host_list == NULL)     /* this is the first time the function is called */
+    sd_global->host_list = (sg_host_t*)xbt_dynar_to_array(sg_hosts_as_dynar());
 
 
-/**
- * \brief Returns a #xbt_dict_t consisting of the list of properties assigned to this workstation
- *
- * \param workstation a workstation
- * \return the dictionary containing the properties associated with the workstation
- */
-xbt_dict_t SD_workstation_get_properties(SD_workstation_t workstation)
-{
-  return sg_host_get_properties(workstation);
+  return sd_global->host_list;
 }
 
 }
 
-
 /** @brief Displays debugging informations about a workstation */
 /** @brief Displays debugging informations about a workstation */
-void SD_workstation_dump(SD_workstation_t ws)
+void sg_host_dump(sg_host_t ws)
 {
   xbt_dict_t props;
   xbt_dict_cursor_t cursor=NULL;
 {
   xbt_dict_t props;
   xbt_dict_cursor_t cursor=NULL;
@@ -157,7 +70,7 @@ void SD_workstation_dump(SD_workstation_t ws)
 
   XBT_INFO("Displaying workstation %s", sg_host_get_name(ws));
   XBT_INFO("  - speed: %.0f", ws->speed());
 
   XBT_INFO("Displaying workstation %s", sg_host_get_name(ws));
   XBT_INFO("  - speed: %.0f", ws->speed());
-  XBT_INFO("  - available speed: %.2f", surf_host_get_available_speed(ws));
+  XBT_INFO("  - available speed: %.2f", sg_host_get_available_speed(ws));
   props = sg_host_get_properties(ws);
   
   if (!xbt_dict_is_empty(props)){
   props = sg_host_get_properties(ws);
   
   if (!xbt_dict_is_empty(props)){
@@ -179,8 +92,33 @@ void SD_workstation_dump(SD_workstation_t ws)
  * \return a new array of \ref SD_link_t representing the route between these two workstations
  * \see SD_route_get_size(), SD_link_t
  */
  * \return a new array of \ref SD_link_t representing the route between these two workstations
  * \see SD_route_get_size(), SD_link_t
  */
-const SD_link_t *SD_route_get_list(SD_workstation_t src,
-                                   SD_workstation_t dst)
+double sg_host_speed(sg_host_t workstation)
+{
+  return workstation->speed();
+}
+int sg_host_core_count(sg_host_t workstation) {
+  return workstation->core_count();
+}
+
+
+double sg_host_computation_time(sg_host_t workstation,
+                                           double flops_amount)
+{
+  xbt_assert(flops_amount >= 0,
+              "flops_amount must be greater than or equal to zero");
+  return flops_amount / workstation->speed();
+}
+
+xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t workstation){
+  return workstation->extension<simgrid::surf::Host>()->getMountedStorageList();
+}
+
+xbt_dynar_t sg_host_get_attached_storage_list(sg_host_t workstation){
+  return surf_host_get_attached_storage_list(workstation);
+}
+
+const SD_link_t *SD_route_get_list(sg_host_t src,
+                                   sg_host_t dst)
 {
   xbt_dynar_t surf_route;
   void *surf_link;
 {
   xbt_dynar_t surf_route;
   void *surf_link;
@@ -207,7 +145,7 @@ const SD_link_t *SD_route_get_list(SD_workstation_t src,
  * \return the number of links on the route between these two workstations
  * \see SD_route_get_list()
  */
  * \return the number of links on the route between these two workstations
  * \see SD_route_get_list()
  */
-int SD_route_get_size(SD_workstation_t src, SD_workstation_t dst)
+int SD_route_get_size(sg_host_t src, sg_host_t dst)
 {
   return xbt_dynar_length(surf_host_model_get_route(
                    (surf_host_model_t)surf_host_model, src, dst));
 {
   return xbt_dynar_length(surf_host_model_get_route(
                    (surf_host_model_t)surf_host_model, src, dst));
@@ -218,34 +156,14 @@ int SD_route_get_size(SD_workstation_t src, SD_workstation_t dst)
  *
  * \param workstation a workstation
  * \return the total speed of this workstation
  *
  * \param workstation a workstation
  * \return the total speed of this workstation
- * \see SD_workstation_get_available_speed()
+ * \see sg_host_get_available_speed()
  */
  */
-double SD_workstation_get_speed(SD_workstation_t workstation)
-{
-  return workstation->speed();
-}
 /**
  * \brief Returns the amount of cores of a workstation
  *
  * \param workstation a workstation
  * \return the amount of cores of this workstation
  */
 /**
  * \brief Returns the amount of cores of a workstation
  *
  * \param workstation a workstation
  * \return the amount of cores of this workstation
  */
-int SD_workstation_get_cores(SD_workstation_t workstation) {
-  return workstation->core_count();
-}
-
-/**
- * \brief Returns the proportion of available speed in a workstation
- *
- * \param workstation a workstation
- * \return the proportion of speed currently available in this workstation (normally a number between 0 and 1)
- * \see SD_workstation_get_speed()
- */
-double SD_workstation_get_available_speed(SD_workstation_t workstation)
-{
-  return surf_host_get_available_speed(workstation);
-}
-
 /**
  * \brief Returns an approximative estimated time for the given computation amount on a workstation
  *
 /**
  * \brief Returns an approximative estimated time for the given computation amount on a workstation
  *
@@ -253,14 +171,6 @@ double SD_workstation_get_available_speed(SD_workstation_t workstation)
  * \param flops_amount the computation amount you want to evaluate (in flops)
  * \return an approximative estimated computation time for the given computation amount on this workstation (in seconds)
  */
  * \param flops_amount the computation amount you want to evaluate (in flops)
  * \return an approximative estimated computation time for the given computation amount on this workstation (in seconds)
  */
-double SD_workstation_get_computation_time(SD_workstation_t workstation,
-                                           double flops_amount)
-{
-  xbt_assert(flops_amount >= 0,
-              "flops_amount must be greater than or equal to zero");
-  return flops_amount / workstation->speed();
-}
-
 /**
  * \brief Returns the latency of the route between two workstations.
  *
 /**
  * \brief Returns the latency of the route between two workstations.
  *
@@ -269,7 +179,7 @@ double SD_workstation_get_computation_time(SD_workstation_t workstation,
  * \return the latency of the route between the two workstations (in seconds)
  * \see SD_route_get_bandwidth()
  */
  * \return the latency of the route between the two workstations (in seconds)
  * \see SD_route_get_bandwidth()
  */
-double SD_route_get_latency(SD_workstation_t src, SD_workstation_t dst)
+double SD_route_get_latency(sg_host_t src, sg_host_t dst)
 {
   xbt_dynar_t route = NULL;
   double latency = 0;
 {
   xbt_dynar_t route = NULL;
   double latency = 0;
@@ -290,7 +200,7 @@ double SD_route_get_latency(SD_workstation_t src, SD_workstation_t dst)
  * (in bytes/second)
  * \see SD_route_get_latency()
  */
  * (in bytes/second)
  * \see SD_route_get_latency()
  */
-double SD_route_get_bandwidth(SD_workstation_t src, SD_workstation_t dst)
+double SD_route_get_bandwidth(sg_host_t src, sg_host_t dst)
 {
 
   const SD_link_t *links;
 {
 
   const SD_link_t *links;
@@ -322,8 +232,8 @@ double SD_route_get_bandwidth(SD_workstation_t src, SD_workstation_t dst)
  * \return an approximative estimated communication time for the given bytes amount
  * between the workstations (in seconds)
  */
  * \return an approximative estimated communication time for the given bytes amount
  * between the workstations (in seconds)
  */
-double SD_route_get_communication_time(SD_workstation_t src,
-                                       SD_workstation_t dst,
+double SD_route_get_communication_time(sg_host_t src,
+                                       sg_host_t dst,
                                        double bytes_amount)
 {
 
                                        double bytes_amount)
 {
 
@@ -366,20 +276,12 @@ double SD_route_get_communication_time(SD_workstation_t src,
  * \param workstation a workstation
  * \return a dynar containing all mounted storages on the workstation
  */
  * \param workstation a workstation
  * \return a dynar containing all mounted storages on the workstation
  */
-xbt_dict_t SD_workstation_get_mounted_storage_list(SD_workstation_t workstation){
-  return workstation->extension<simgrid::surf::Host>()->getMountedStorageList();
-}
-
 /**
  * \brief Return the list of mounted storages on a workstation.
  *
  * \param workstation a workstation
  * \return a dynar containing all mounted storages on the workstation
  */
 /**
  * \brief Return the list of mounted storages on a workstation.
  *
  * \param workstation a workstation
  * \return a dynar containing all mounted storages on the workstation
  */
-xbt_dynar_t SD_workstation_get_attached_storage_list(SD_workstation_t workstation){
-  return surf_host_get_attached_storage_list(workstation);
-}
-
 /**
  * \brief Returns the host name the storage is attached to
  *
 /**
  * \brief Returns the host name the storage is attached to
  *
index de27e4f..4f50be5 100644 (file)
@@ -20,8 +20,8 @@ SG_BEGIN_DECL()
 /* Global variables */
 
 typedef struct SD_global {
 /* Global variables */
 
 typedef struct SD_global {
-  SD_workstation_t *workstation_list;   /* array of workstations, created only if
-                                           necessary in SD_workstation_get_list */
+  sg_host_t *host_list;   /* array of workstations, created only if
+                             necessary in sg_host_list() */
   SD_link_t *link_list;         /* array of links */
   SD_link_t *recyclable_route;  /* array returned by SD_route_get_list
                                    and mallocated only once */
   SD_link_t *link_list;         /* array of links */
   SD_link_t *recyclable_route;  /* array returned by SD_route_get_list
                                    and mallocated only once */
@@ -41,9 +41,6 @@ typedef struct SD_global {
 
 extern XBT_PRIVATE SD_global_t sd_global;
 
 
 extern XBT_PRIVATE SD_global_t sd_global;
 
-/* Workstation */
-typedef s_xbt_dictelm_t s_SD_workstation_t;
-
 /* Storage */
 typedef s_xbt_dictelm_t s_SD_storage_t;
 typedef struct SD_storage {
 /* Storage */
 typedef s_xbt_dictelm_t s_SD_storage_t;
 typedef struct SD_storage {
@@ -78,8 +75,8 @@ typedef struct SD_task {
   unsigned int is_not_ready;
 
   /* scheduling parameters (only exist in state SD_SCHEDULED) */
   unsigned int is_not_ready;
 
   /* scheduling parameters (only exist in state SD_SCHEDULED) */
-  int workstation_nb;
-  SD_workstation_t *workstation_list;   /* surf workstations */
+  int host_count;
+  sg_host_t *host_list;
   double *flops_amount;
   double *bytes_amount;
   double rate;
   double *flops_amount;
   double *bytes_amount;
   double rate;
@@ -120,13 +117,6 @@ static XBT_INLINE int __SD_task_is_scheduled_or_runnable(SD_task_t task)
 XBT_PRIVATE SD_storage_t __SD_storage_create(void *surf_storage, void *data);
 XBT_PRIVATE void __SD_storage_destroy(void *storage);
 
 XBT_PRIVATE SD_storage_t __SD_storage_create(void *surf_storage, void *data);
 XBT_PRIVATE void __SD_storage_destroy(void *storage);
 
-/********** Tracing **********/
-/* declaration of instrumentation functions from sd_task_instr.c */
-XBT_PRIVATE void TRACE_sd_task_create(SD_task_t task);
-XBT_PRIVATE void TRACE_sd_task_execute_start(SD_task_t task);
-XBT_PRIVATE void TRACE_sd_task_execute_end(SD_task_t task);
-XBT_PRIVATE void TRACE_sd_task_destroy(SD_task_t task);
-
 SG_END_DECL()
 
 #endif
 SG_END_DECL()
 
 #endif
index ab6de0e..b11ac9c 100644 (file)
@@ -96,16 +96,6 @@ msg_host_priv_t sg_host_msg(sg_host_t host) {
 void sg_host_msg_set(sg_host_t host, msg_host_priv_t smx_host) {
   host->extension_set(MSG_HOST_LEVEL, smx_host);
 }
 void sg_host_msg_set(sg_host_t host, msg_host_priv_t smx_host) {
   host->extension_set(MSG_HOST_LEVEL, smx_host);
 }
-// ========== SimDag Layer ==============
-SD_workstation_priv_t sg_host_sd(sg_host_t host) {
-  return (SD_workstation_priv_t) host->extension(SD_HOST_LEVEL);
-}
-void sg_host_sd_set(sg_host_t host, SD_workstation_priv_t smx_host) {
-  host->extension_set(SD_HOST_LEVEL, smx_host);
-}
-void sg_host_sd_destroy(sg_host_t host) {
-  host->extension_set(SD_HOST_LEVEL, nullptr);
-}
 
 // ========== Simix layer =============
 smx_host_priv_t sg_host_simix(sg_host_t host){
 
 // ========== Simix layer =============
 smx_host_priv_t sg_host_simix(sg_host_t host){
index 02a7020..a426e74 100644 (file)
@@ -57,8 +57,8 @@ static void checkParameters(int argc, char *argv[])
 static int name_compare_hosts(const void *n1, const void *n2)
 {
   char name1[80], name2[80];
 static int name_compare_hosts(const void *n1, const void *n2)
 {
   char name1[80], name2[80];
-  strcpy(name1, SD_workstation_get_name(*((SD_workstation_t *) n1)));
-  strcpy(name2, SD_workstation_get_name(*((SD_workstation_t *) n2)));
+  strcpy(name1, sg_host_get_name(*((sg_host_t *) n1)));
+  strcpy(name2, sg_host_get_name(*((sg_host_t *) n2)));
 
   return strcmp(name1, name2);
 }
 
   return strcmp(name1, name2);
 }
@@ -68,9 +68,9 @@ static void scheduleDAX(xbt_dynar_t dax)
   unsigned int cursor;
   SD_task_t task;
 
   unsigned int cursor;
   SD_task_t task;
 
-  const SD_workstation_t *ws_list = SD_workstation_get_list();
-  int totalHosts = SD_workstation_get_count();
-  qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
+  const sg_host_t *ws_list = sg_host_list();
+  int totalHosts = sg_host_count();
+  qsort((void *) ws_list, totalHosts, sizeof(sg_host_t),
         name_compare_hosts);
 
   //fprintf(stdout, "No. workstations: %d, %d\n", totalHosts, (dax != NULL));
         name_compare_hosts);
 
   //fprintf(stdout, "No. workstations: %d, %d\n", totalHosts, (dax != NULL));
@@ -80,11 +80,11 @@ static void scheduleDAX(xbt_dynar_t dax)
       if (!strcmp(SD_task_get_name(task), "end")
           || !strcmp(SD_task_get_name(task), "root")) {
         fprintf(stdout, "Scheduling %s to node: %s\n", SD_task_get_name(task),
       if (!strcmp(SD_task_get_name(task), "end")
           || !strcmp(SD_task_get_name(task), "root")) {
         fprintf(stdout, "Scheduling %s to node: %s\n", SD_task_get_name(task),
-                SD_workstation_get_name(ws_list[0]));
+                sg_host_get_name(ws_list[0]));
         SD_task_schedulel(task, 1, ws_list[0]);
       } else {
         fprintf(stdout, "Scheduling %s to node: %s\n", SD_task_get_name(task),
         SD_task_schedulel(task, 1, ws_list[0]);
       } else {
         fprintf(stdout, "Scheduling %s to node: %s\n", SD_task_get_name(task),
-                SD_workstation_get_name(ws_list[(cursor) % totalHosts]));
+                sg_host_get_name(ws_list[(cursor) % totalHosts]));
         SD_task_schedulel(task, 1, ws_list[(cursor) % totalHosts]);
       }
     }
         SD_task_schedulel(task, 1, ws_list[(cursor) % totalHosts]);
       }
     }
index 65efcbc..b14c08c 100644 (file)
@@ -48,11 +48,11 @@ int main(int argc, char **argv)
 
   /* let's launch the simulation! */
 
 
   /* let's launch the simulation! */
 
-  SD_task_schedule(taskInit, 1, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(taskInit, 1, sg_host_list(), no_cost,
                    no_cost, -1.0);
                    no_cost, -1.0);
-  SD_task_schedule(taskA, 2, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(taskA, 2, sg_host_list(), no_cost,
                    communication_amount1, -1.0);
                    communication_amount1, -1.0);
-  SD_task_schedule(taskB, 2, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(taskB, 2, sg_host_list(), no_cost,
                    communication_amount2, -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
                    communication_amount2, -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
index 3b965ea..851a53e 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
   double communication_amount2 = 1e9;
   double no_cost = 0.0;
 
   double communication_amount2 = 1e9;
   double no_cost = 0.0;
 
-  const SD_workstation_t *workstation;
+  const sg_host_t *workstation;
 
   /* initialization of SD */
   SD_init(&argc, argv);
 
   /* initialization of SD */
   SD_init(&argc, argv);
@@ -49,10 +49,10 @@ int main(int argc, char **argv)
   /* scheduling parameters */
 
 
   /* scheduling parameters */
 
 
-  workstation = SD_workstation_get_list();
+  workstation = sg_host_list();
 
   /* let's launch the simulation! */
 
   /* let's launch the simulation! */
-  SD_task_schedule(taskInit, 1, SD_workstation_get_list(), &no_cost,
+  SD_task_schedule(taskInit, 1, sg_host_list(), &no_cost,
                    &no_cost, -1.0);
   SD_task_schedule(taskA, 1, &workstation[0], &no_cost,
                    &communication_amount1, -1.0);
                    &no_cost, -1.0);
   SD_task_schedule(taskA, 1, &workstation[0], &no_cost,
                    &communication_amount1, -1.0);
index 032fbe1..74edbe7 100644 (file)
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
   SD_task_t taskA;
   SD_task_t taskB;
 
   SD_task_t taskA;
   SD_task_t taskB;
 
-  const SD_workstation_t *workstation;
+  const sg_host_t *workstation;
 
   double communication_amount1 = 1e9;
   double communication_amount2 = 1e8;
 
   double communication_amount1 = 1e9;
   double communication_amount2 = 1e8;
@@ -48,10 +48,10 @@ int main(int argc, char **argv)
 
   /* scheduling parameters */
 
 
   /* scheduling parameters */
 
-  workstation = SD_workstation_get_list();
+  workstation = sg_host_list();
 
   /* let's launch the simulation! */
 
   /* let's launch the simulation! */
-  SD_task_schedule(taskInit, 1, SD_workstation_get_list(), &no_cost,
+  SD_task_schedule(taskInit, 1, sg_host_list(), &no_cost,
                    &no_cost, -1.0);
   SD_task_schedule(taskA, 1, &workstation[0], &no_cost,
                    &communication_amount1, -1.0);
                    &no_cost, -1.0);
   SD_task_schedule(taskA, 1, &workstation[0], &no_cost,
                    &communication_amount1, -1.0);
index 1e288c5..94690ac 100644 (file)
@@ -39,11 +39,11 @@ int main(int argc, char **argv)
   taskFin = SD_task_create("Task Fin", NULL, 1.0);
 
   /* let's launch the simulation! */
   taskFin = SD_task_create("Task Fin", NULL, 1.0);
 
   /* let's launch the simulation! */
-  SD_task_schedule(taskInit, 1, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(taskInit, 1, sg_host_list(), no_cost,
                    no_cost, -1.0);
                    no_cost, -1.0);
-  SD_task_schedule(taskA, 2, SD_workstation_get_list(), no_cost, no_cost,
+  SD_task_schedule(taskA, 2, sg_host_list(), no_cost, no_cost,
                    -1.0);
                    -1.0);
-  SD_task_schedule(taskFin, 1, SD_workstation_get_list(), no_cost, no_cost,
+  SD_task_schedule(taskFin, 1, sg_host_list(), no_cost, no_cost,
                    -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
                    -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
index fcfbb91..a3ab2e3 100644 (file)
@@ -44,11 +44,11 @@ int main(int argc, char **argv)
 
 
   /* let's launch the simulation! */
 
 
   /* let's launch the simulation! */
-  SD_task_schedule(taskInit, 1, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(taskInit, 1, sg_host_list(), no_cost,
                    no_cost, -1.0);
                    no_cost, -1.0);
-  SD_task_schedule(taskA, 2, SD_workstation_get_list(), no_cost, amount,
+  SD_task_schedule(taskA, 2, sg_host_list(), no_cost, amount,
                    -1.0);
                    -1.0);
-  SD_task_schedule(taskFin, 1, SD_workstation_get_list(), no_cost, no_cost,
+  SD_task_schedule(taskFin, 1, sg_host_list(), no_cost, no_cost,
                    -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
                    -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
index 1d60d95..7ca6bb1 100644 (file)
@@ -46,11 +46,11 @@ int main(int argc, char **argv)
   taskB = SD_task_create("Task B", NULL, 1.0);
 
   /* let's launch the simulation! */
   taskB = SD_task_create("Task B", NULL, 1.0);
 
   /* let's launch the simulation! */
-  SD_task_schedule(taskInit, 1, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(taskInit, 1, sg_host_list(), no_cost,
                    no_cost, -1.0);
                    no_cost, -1.0);
-  SD_task_schedule(taskA, 2, SD_workstation_get_list(), no_cost, amount,
+  SD_task_schedule(taskA, 2, sg_host_list(), no_cost, amount,
                    -1.0);
                    -1.0);
-  SD_task_schedule(taskB, 1, SD_workstation_get_list(), comput, no_cost,
+  SD_task_schedule(taskB, 1, sg_host_list(), comput, no_cost,
                    -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
                    -1.0);
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
index e02c47b..7b5582f 100644 (file)
@@ -35,9 +35,9 @@ int main(int argc, char **argv)
   taskA = SD_task_create("Task A", NULL, 1.0);
   taskB = SD_task_create("Task B", NULL, 1.0);
 
   taskA = SD_task_create("Task A", NULL, 1.0);
   taskB = SD_task_create("Task B", NULL, 1.0);
 
-  SD_task_schedule(taskA, 1, SD_workstation_get_list(), comp_cost,
+  SD_task_schedule(taskA, 1, sg_host_list(), comp_cost,
                    comm_cost, -1.0);
                    comm_cost, -1.0);
-  SD_task_schedule(taskB, 1, SD_workstation_get_list(), comp_cost,
+  SD_task_schedule(taskB, 1, sg_host_list(), comp_cost,
                    comm_cost, -1.0);
 
   ret = SD_simulate(-1.0);
                    comm_cost, -1.0);
 
   ret = SD_simulate(-1.0);
index 4f25f38..d108d09 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
   SD_task_t taskInit;
   SD_task_t taskA, taskB, taskC, taskD;
 
   SD_task_t taskInit;
   SD_task_t taskA, taskB, taskC, taskD;
 
-  const SD_workstation_t *workstation;
+  const sg_host_t *workstation;
 
   double communication_amount1 = 1e9;
   double no_cost = 0.0;
 
   double communication_amount1 = 1e9;
   double no_cost = 0.0;
@@ -48,14 +48,14 @@ int main(int argc, char **argv)
 
   /* scheduling parameters */
 
 
   /* scheduling parameters */
 
-  workstation = SD_workstation_get_list();
+  workstation = sg_host_list();
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
   SD_task_dependency_add(NULL, NULL, taskInit, taskB);
   SD_task_dependency_add(NULL, NULL, taskC, taskD);
 
   /* let's launch the simulation! */
 
   SD_task_dependency_add(NULL, NULL, taskInit, taskA);
   SD_task_dependency_add(NULL, NULL, taskInit, taskB);
   SD_task_dependency_add(NULL, NULL, taskC, taskD);
 
   /* let's launch the simulation! */
-  SD_task_schedule(taskInit, 1, SD_workstation_get_list(), &no_cost,
+  SD_task_schedule(taskInit, 1, sg_host_list(), &no_cost,
                    &no_cost, -1.0);
   SD_task_schedule(taskA, 1, &workstation[0], &no_cost,
                      &communication_amount1, -1.0);
                    &no_cost, -1.0);
   SD_task_schedule(taskA, 1, &workstation[0], &no_cost,
                      &communication_amount1, -1.0);
index d5b56d3..06f52ed 100644 (file)
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
 
   task = SD_task_create("All2all task", NULL, 1.0);
 
 
   task = SD_task_create("All2all task", NULL, 1.0);
 
-  SD_task_schedule(task, 4, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task, 4, sg_host_list(), no_cost,
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
index 18b8d9d..158f6f9 100644 (file)
@@ -42,7 +42,7 @@ int main(int argc, char **argv)
 
   task = SD_task_create("Comm 1", NULL, 1.0);
 
 
   task = SD_task_create("Comm 1", NULL, 1.0);
 
-  SD_task_schedule(task, 4, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task, 4, sg_host_list(), no_cost,
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
index 5b28563..65174d4 100644 (file)
@@ -43,7 +43,7 @@ int main(int argc, char **argv)
 
   task = SD_task_create("Scatter task", NULL, 1.0);
 
 
   task = SD_task_create("Scatter task", NULL, 1.0);
 
-  SD_task_schedule(task, 4, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task, 4, sg_host_list(), no_cost,
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
index 7116e60..bf73f7d 100644 (file)
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
 
   task = SD_task_create("Comm 1", NULL, 1.0);
 
 
   task = SD_task_create("Comm 1", NULL, 1.0);
 
-  SD_task_schedule(task, 2, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task, 2, sg_host_list(), no_cost,
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
                    communication_amount, -1.0);
 
   SD_simulate(-1.0);
index 608b0be..5a22fa0 100644 (file)
@@ -36,11 +36,11 @@ int main(int argc, char **argv)
   task1 = SD_task_create("Comm 1", NULL, 1.0);
   task2 = SD_task_create("Comm 2", NULL, 1.0);
 
   task1 = SD_task_create("Comm 1", NULL, 1.0);
   task2 = SD_task_create("Comm 2", NULL, 1.0);
 
-  SD_task_schedule(root, 1, SD_workstation_get_list(), no_cost1, no_cost1,
+  SD_task_schedule(root, 1, sg_host_list(), no_cost1, no_cost1,
                    -1.0);
                    -1.0);
-  SD_task_schedule(task1, 2, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task1, 2, sg_host_list(), no_cost,
                    communication_amount1, -1.0);
                    communication_amount1, -1.0);
-  SD_task_schedule(task2, 2, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task2, 2, sg_host_list(), no_cost,
                    communication_amount2, -1.0);
 
   SD_task_dependency_add(NULL, NULL, root, task1);
                    communication_amount2, -1.0);
 
   SD_task_dependency_add(NULL, NULL, root, task1);
index fb26ed9..22b491f 100644 (file)
@@ -37,11 +37,11 @@ int main(int argc, char **argv)
   task1 = SD_task_create("Comm 1", NULL, 1.0);
   task2 = SD_task_create("Comm 2", NULL, 1.0);
 
   task1 = SD_task_create("Comm 1", NULL, 1.0);
   task2 = SD_task_create("Comm 2", NULL, 1.0);
 
-  SD_task_schedule(root, 1, SD_workstation_get_list(), no_cost1,
+  SD_task_schedule(root, 1, sg_host_list(), no_cost1,
                    no_cost1, -1.0);
                    no_cost1, -1.0);
-  SD_task_schedule(task1, 2, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task1, 2, sg_host_list(), no_cost,
                    communication_amount1, -1.0);
                    communication_amount1, -1.0);
-  SD_task_schedule(task2, 2, SD_workstation_get_list(), no_cost,
+  SD_task_schedule(task2, 2, sg_host_list(), no_cost,
                    communication_amount2, -1.0);
 
   SD_task_dependency_add(NULL, NULL, root, task1);
                    communication_amount2, -1.0);
 
   SD_task_dependency_add(NULL, NULL, root, task1);
index 0563bed..234a3e3 100644 (file)
@@ -39,12 +39,12 @@ int main(int argc, char **argv)
   // xbt_assert( check max tcp win size, "MAX TCP WIN SIZE is 20000");
 
   root = SD_task_create("Root", NULL, 1.0);
   // xbt_assert( check max tcp win size, "MAX TCP WIN SIZE is 20000");
 
   root = SD_task_create("Root", NULL, 1.0);
-  SD_task_schedule(root, 1, SD_workstation_get_list(), no_cost, no_cost,
+  SD_task_schedule(root, 1, sg_host_list(), no_cost, no_cost,
                    -1.0);
 
   for (i = 0; i < TASK_NUM; i++) {
     task[i] = SD_task_create("Comm", NULL, 1.0);
                    -1.0);
 
   for (i = 0; i < TASK_NUM; i++) {
     task[i] = SD_task_create("Comm", NULL, 1.0);
-    SD_task_schedule(task[i], 2, SD_workstation_get_list(), no_cost,
+    SD_task_schedule(task[i], 2, sg_host_list(), no_cost,
                      communication_amount, -1.0);
     SD_task_dependency_add(NULL, NULL, root, task[i]);
   }
                      communication_amount, -1.0);
     SD_task_dependency_add(NULL, NULL, root, task[i]);
   }
index 584bd62..55b6ded 100644 (file)
@@ -28,7 +28,7 @@ static SD_task_t create_empty_cost_root()
   SD_task_t root;
 
   root = SD_task_create("Root", NULL, 1.0);
   SD_task_t root;
 
   root = SD_task_create("Root", NULL, 1.0);
-  SD_task_schedule(root, 1, SD_workstation_get_list(), no_cost, no_cost,
+  SD_task_schedule(root, 1, sg_host_list(), no_cost, no_cost,
                    -1.0);
 
   return root;
                    -1.0);
 
   return root;
@@ -68,7 +68,7 @@ static SD_task_t create_root_with_costs()
   SD_task_t root;
 
   root = SD_task_create("Root", NULL, 1.0);
   SD_task_t root;
 
   root = SD_task_create("Root", NULL, 1.0);
-  SD_task_schedule(root, 2, SD_workstation_get_list(), comp_cost,
+  SD_task_schedule(root, 2, sg_host_list(), comp_cost,
                    comm_cost, -1.0);
 
   return root;
                    comm_cost, -1.0);
 
   return root;
index 53b823f..6ad02ee 100644 (file)
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   task = SD_task_create("partask", NULL, 1.0);
   SD_create_environment(argv[1]);
 
   task = SD_task_create("partask", NULL, 1.0);
-  SD_task_schedule(task, 2, SD_workstation_get_list(), comp_cost,
+  SD_task_schedule(task, 2, sg_host_list(), comp_cost,
                    comm_amount, -1.0);
 
   SD_simulate(-1.0);
                    comm_amount, -1.0);
 
   SD_simulate(-1.0);
index 875db67..9b17ca0 100644 (file)
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   task = SD_task_create("seqtask", NULL, 1.0);
   SD_create_environment(argv[1]);
 
   task = SD_task_create("seqtask", NULL, 1.0);
-  SD_task_schedule(task, 1, SD_workstation_get_list(), comp_cost,
+  SD_task_schedule(task, 1, sg_host_list(), comp_cost,
                    comm_amount, -1.0);
 
   SD_simulate(-1.0);
                    comm_amount, -1.0);
 
   SD_simulate(-1.0);
index 5eb24b3..835fed2 100644 (file)
@@ -18,8 +18,8 @@ extern routing_platf_t routing_platf;
 
 int main(int argc, char **argv)
 {
 
 int main(int argc, char **argv)
 {
-  SD_workstation_t w1, w2;
-  const SD_workstation_t *workstations;
+  sg_host_t w1, w2;
+  const sg_host_t *workstations;
   int i, j;
   int list_size;
   xbt_os_timer_t timer = xbt_os_timer_new();
   int i, j;
   int list_size;
   xbt_os_timer_t timer = xbt_os_timer_new();
@@ -30,8 +30,8 @@ int main(int argc, char **argv)
   /* creation of the environment */
   SD_create_environment(argv[1]);
 
   /* creation of the environment */
   SD_create_environment(argv[1]);
 
-  workstations = SD_workstation_get_list();
-  list_size = SD_workstation_get_count();
+  workstations = sg_host_list();
+  list_size = sg_host_count();
 
   /* Random number initialization */
   srand( (int) (xbt_os_time()*1000) );
 
   /* Random number initialization */
   srand( (int) (xbt_os_time()*1000) );
index 0a96873..cbf827e 100644 (file)
@@ -28,8 +28,8 @@ int main(int argc, char **argv)
 
   /* Display the result and exit after cleanup */
   printf( "%f\n", xbt_os_timer_elapsed(timer) );
 
   /* Display the result and exit after cleanup */
   printf( "%f\n", xbt_os_timer_elapsed(timer) );
-    printf("Workstation number: %d, link number: %d\n",
-           SD_workstation_get_count(), sg_link_count());
+    printf("Workstation number: %zu, link number: %d\n",
+           sg_host_count(), sg_link_count());
   if(argv[2]){
     printf("Wait for %ss\n",argv[2]);
     sleep(atoi(argv[2]));
   if(argv[2]){
     printf("Wait for %ss\n",argv[2]);
     sleep(atoi(argv[2]));
index 8998c09..e7cbf0b 100644 (file)
@@ -12,8 +12,8 @@ int main(int argc, char **argv)
 {
   /* SD initialization */
 
 {
   /* SD initialization */
 
-  SD_workstation_t w1, w2;
-  const SD_workstation_t *workstations;
+  sg_host_t w1, w2;
+  const sg_host_t *workstations;
   const SD_link_t *route;
   const char *name1;
   const char *name2;
   const SD_link_t *route;
   const char *name1;
   const char *name2;
@@ -31,16 +31,16 @@ int main(int argc, char **argv)
 
   /* creation of the environment */
   SD_create_environment(argv[1]);
 
   /* creation of the environment */
   SD_create_environment(argv[1]);
-  printf("Workstation number: %d, link number: %d\n",
-         SD_workstation_get_count(), sg_link_count());
+  printf("Workstation number: %zu, link number: %d\n",
+         sg_host_count(), sg_link_count());
 
   if (argc >= 3) {
     if (!strcmp(argv[2], "ONE_LINK")) {
 
   if (argc >= 3) {
     if (!strcmp(argv[2], "ONE_LINK")) {
-      workstations = SD_workstation_get_list();
+      workstations = sg_host_list();
       w1 = workstations[0];
       w2 = workstations[1];
       w1 = workstations[0];
       w2 = workstations[1];
-      name1 = SD_workstation_get_name(w1);
-      name2 = SD_workstation_get_name(w2);
+      name1 = sg_host_get_name(w1);
+      name2 = sg_host_get_name(w2);
 
       printf("Route between %s and %s\n", name1, name2);
       route = SD_route_get_list(w1, w2);
 
       printf("Route between %s and %s\n", name1, name2);
       route = SD_route_get_list(w1, w2);
@@ -57,14 +57,14 @@ int main(int argc, char **argv)
          SD_route_get_bandwidth(w1, w2));
     }
     if (!strcmp(argv[2], "FULL_LINK")) {
          SD_route_get_bandwidth(w1, w2));
     }
     if (!strcmp(argv[2], "FULL_LINK")) {
-      workstations = SD_workstation_get_list();
-      list_size = SD_workstation_get_count();
+      workstations = sg_host_list();
+      list_size = sg_host_count();
       for (i = 0; i < list_size; i++) {
       w1 = workstations[i];
       for (i = 0; i < list_size; i++) {
       w1 = workstations[i];
-      name1 = SD_workstation_get_name(w1);
+      name1 = sg_host_get_name(w1);
       for (j = 0; j < list_size; j++) {
         w2 = workstations[j];
       for (j = 0; j < list_size; j++) {
         w2 = workstations[j];
-        name2 = SD_workstation_get_name(w2);
+        name2 = sg_host_get_name(w2);
         printf("Route between %s and %s\n", name1, name2);
         route = SD_route_get_list(w1, w2);
         route_size = SD_route_get_size(w1, w2);
         printf("Route between %s and %s\n", name1, name2);
         route = SD_route_get_list(w1, w2);
         route_size = SD_route_get_size(w1, w2);
@@ -83,7 +83,7 @@ int main(int argc, char **argv)
     }
     if (!strcmp(argv[2], "PROP")) {
       printf("SG_TEST_mem: %s\n",
     }
     if (!strcmp(argv[2], "PROP")) {
       printf("SG_TEST_mem: %s\n",
-          SD_workstation_get_property_value(SD_workstation_get_by_name("host1"),
+          sg_host_get_property_value(sg_host_by_name("host1"),
           "SG_TEST_mem"));
     }
   }
           "SG_TEST_mem"));
     }
   }
index a217844..a3c3cba 100644 (file)
@@ -32,8 +32,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(flatifier,
 static int name_compare_hosts(const void *n1, const void *n2)
 {
   char name1[80], name2[80];
 static int name_compare_hosts(const void *n1, const void *n2)
 {
   char name1[80], name2[80];
-  strcpy(name1, SD_workstation_get_name(*((SD_workstation_t *) n1)));
-  strcpy(name2, SD_workstation_get_name(*((SD_workstation_t *) n2)));
+  strcpy(name1, sg_host_get_name(*((sg_host_t *) n1)));
+  strcpy(name2, sg_host_get_name(*((sg_host_t *) n2)));
 
   return strcmp(name1, name2);
 }
 
   return strcmp(name1, name2);
 }
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
   sg_netcard_t value1;
   sg_netcard_t value2;
 
   sg_netcard_t value1;
   sg_netcard_t value2;
 
-  const SD_workstation_t *hosts;
+  const sg_host_t *hosts;
   const SD_link_t *links;
   xbt_os_timer_t parse_time = xbt_os_timer_new();
 
   const SD_link_t *links;
   xbt_os_timer_t parse_time = xbt_os_timer_new();
 
@@ -127,8 +127,8 @@ int main(int argc, char **argv)
   create_environment(parse_time, platformFile);
 
   if (timings) {
   create_environment(parse_time, platformFile);
 
   if (timings) {
-    XBT_INFO("Parsing time: %fs (%d hosts, %d links)",
-          xbt_os_timer_elapsed(parse_time),SD_workstation_get_count(),
+    XBT_INFO("Parsing time: %fs (%zu hosts, %d links)",
+          xbt_os_timer_elapsed(parse_time),sg_host_count(),
           sg_link_count());
   } else {
     printf("<?xml version='1.0'?>\n");
           sg_link_count());
   } else {
     printf("<?xml version='1.0'?>\n");
@@ -138,18 +138,18 @@ int main(int argc, char **argv)
       printf("<AS id=\"AS0\" routing=\"Full\">\n");
 
     // Hosts
       printf("<AS id=\"AS0\" routing=\"Full\">\n");
 
     // Hosts
-    totalHosts = SD_workstation_get_count();
-    hosts = SD_workstation_get_list();
-    qsort((void *) hosts, totalHosts, sizeof(SD_workstation_t),
+    totalHosts = sg_host_count();
+    hosts = sg_host_list();
+    qsort((void *) hosts, totalHosts, sizeof(sg_host_t),
         name_compare_hosts);
 
     for (i = 0; i < totalHosts; i++) {
       printf("  <host id=\"%s\" power=\"%.0f\"",
         name_compare_hosts);
 
     for (i = 0; i < totalHosts; i++) {
       printf("  <host id=\"%s\" power=\"%.0f\"",
-          SD_workstation_get_name(hosts[i]),
-          SD_workstation_get_speed(hosts[i]));
-      props = SD_workstation_get_properties(hosts[i]);
-      if (SD_workstation_get_cores(hosts[i])>1) {
-        printf(" core=\"%d\"", SD_workstation_get_cores(hosts[i]));
+          sg_host_get_name(hosts[i]),
+          sg_host_speed(hosts[i]));
+      props = sg_host_get_properties(hosts[i]);
+      if (sg_host_core_count(hosts[i])>1) {
+        printf(" core=\"%d\"", sg_host_core_count(hosts[i]));
       }
       if (props && !xbt_dict_is_empty(props)) {
         printf(">\n");
       }
       if (props && !xbt_dict_is_empty(props)) {
         printf(">\n");
index 5014b76..41209c6 100644 (file)
@@ -29,8 +29,8 @@ int main(int argc, char **argv)
 
   size = xbt_dict_length(host_list) + xbt_lib_length(as_router_lib);
 
 
   size = xbt_dict_length(host_list) + xbt_lib_length(as_router_lib);
 
-  printf("Workstation number: %d, link number: %d, elmts number: %d\n",
-         SD_workstation_get_count(), sg_link_count(), size);
+  printf("Workstation number: %zu, link number: %d, elmts number: %d\n",
+         sg_host_count(), sg_link_count(), size);
 
   xbt_dict_foreach(host_list, cursor, key, data) {
     printf("   - Seen: \"%s\" is type : %d\n", key,
 
   xbt_dict_foreach(host_list, cursor, key, data) {
     printf("   - Seen: \"%s\" is type : %d\n", key,