Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Start the SimDag revolution: function renaming
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 19 Jan 2016 13:19:24 +0000 (14:19 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 19 Jan 2016 14:05:35 +0000 (15:05 +0100)
  + number -> count (workstation/link lists)
  + remove 'current' in bandwidth/latency getters

20 files changed:
examples/simdag/dax/dax_test.c
examples/simdag/dot/dot_test.c
examples/simdag/dot/ptg_test.c
examples/simdag/goal/goal_test.c
examples/simdag/io/sd_io.c
examples/simdag/metaxml/sd_meta.c
examples/simdag/scheduling/minmin_test.c
examples/simdag/sd_avail.c
examples/simdag/sd_test.c
examples/simdag/sd_test2.c
include/simgrid/simdag.h
src/simdag/sd_global.cpp
src/simdag/sd_workstation.cpp
teshsuite/simdag/availability/availability_test.c
teshsuite/simdag/platforms/Evaluate_get_route_time.c
teshsuite/simdag/platforms/Evaluate_parse_time.c
teshsuite/simdag/platforms/basic_link_test.c
teshsuite/simdag/platforms/basic_parsing_test.c
teshsuite/simdag/platforms/flatifier.cpp
teshsuite/simdag/platforms/is_router_test.c

index 6bc8f25..92b035d 100644 (file)
@@ -84,11 +84,11 @@ int main(int argc, char **argv)
   /* Schedule them all on the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
   const SD_workstation_t *ws_list = SD_workstation_get_list();
   /* 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_number();
+  int totalHosts = SD_workstation_get_count();
   qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
         name_compare_hosts);
 
   qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
         name_compare_hosts);
 
-  int count = SD_workstation_get_number();
+  int count = SD_workstation_get_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"))
index f263870..382c921 100644 (file)
@@ -75,7 +75,7 @@ int main(int argc, char **argv)
   XBT_INFO("------------------- Schedule tasks ---------------------------");
   const SD_workstation_t *ws_list = SD_workstation_get_list();
 
   XBT_INFO("------------------- Schedule tasks ---------------------------");
   const SD_workstation_t *ws_list = SD_workstation_get_list();
 
-  int count = SD_workstation_get_number();
+  int count = SD_workstation_get_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"))
index ab2fc09..623e461 100644 (file)
@@ -59,7 +59,7 @@ int main(int argc, char **argv){
   /* Schedule them all on all the first workstation */
   XBT_INFO("------------------- Schedule tasks ---------------------------");
   const SD_workstation_t *ws_list = SD_workstation_get_list();
   /* 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_number();
+  int count = SD_workstation_get_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 bba9ac7..1b2e514 100644 (file)
@@ -73,7 +73,7 @@ int main(int argc, char **argv) {
   xbt_dynar_t done = NULL;
 
   xbt_os_cputimer_start(timer);
   xbt_dynar_t done = NULL;
 
   xbt_os_cputimer_start(timer);
-  send_one(0,SD_workstation_get_number());
+  send_one(0,SD_workstation_get_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 c215a23..5dc9a57 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
   SD_config("host/model", "default");
   SD_create_environment(argv[1]);
   workstations = SD_workstation_get_list();
   SD_config("host/model", "default");
   SD_create_environment(argv[1]);
   workstations = SD_workstation_get_list();
-  total_nworkstations = SD_workstation_get_number();
+  total_nworkstations = SD_workstation_get_count();
 
   for (ctr=0; ctr<total_nworkstations;ctr++){
     current_storage_list = SD_workstation_get_mounted_storage_list(workstations[ctr]);
 
   for (ctr=0; ctr<total_nworkstations;ctr++){
     current_storage_list = SD_workstation_get_mounted_storage_list(workstations[ctr]);
index 0f2f339..34f7d2e 100644 (file)
@@ -47,7 +47,7 @@ int main(int argc, char **argv)
 
   /* test the estimation functions */
   workstations = SD_workstation_get_list();
 
   /* test the estimation functions */
   workstations = SD_workstation_get_list();
-  ws_nr = SD_workstation_get_number();
+  ws_nr = SD_workstation_get_count();
 
 
   /* Show routes between all workstation */
 
 
   /* Show routes between all workstation */
@@ -66,8 +66,8 @@ int main(int argc, char **argv)
       for (k = 0; k < route_size; k++) {
         XBT_INFO("\tLink %s: latency = %f, bandwidth = %f",
               SD_link_get_name(route[k]),
       for (k = 0; k < route_size; k++) {
         XBT_INFO("\tLink %s: latency = %f, bandwidth = %f",
               SD_link_get_name(route[k]),
-              SD_link_get_current_latency(route[k]),
-              SD_link_get_current_bandwidth(route[k]));
+              SD_link_get_latency(route[k]),
+              SD_link_get_bandwidth(route[k]));
       }
     }
   }
       }
     }
   }
index 5f1c3a6..2d60522 100644 (file)
@@ -157,7 +157,7 @@ static SD_workstation_t SD_task_get_best_workstation(SD_task_t task)
   int i;
   double EFT, min_EFT = -1.0;
   const SD_workstation_t *workstations = SD_workstation_get_list();
   int i;
   double EFT, min_EFT = -1.0;
   const SD_workstation_t *workstations = SD_workstation_get_list();
-  int nworkstations = SD_workstation_get_number();
+  int nworkstations = SD_workstation_get_count();
   SD_workstation_t best_workstation;
 
   best_workstation = workstations[0];
   SD_workstation_t best_workstation;
 
   best_workstation = workstations[0];
@@ -182,7 +182,7 @@ 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_number();
+  const int nworkstations = SD_workstation_get_count();
   const SD_workstation_t *workstations = SD_workstation_get_list();
   SD_task_t task;
   SD_workstation_t *list;
   const SD_workstation_t *workstations = SD_workstation_get_list();
   SD_task_t task;
   SD_workstation_t *list;
@@ -284,7 +284,7 @@ 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_number();
+  total_nworkstations = SD_workstation_get_count();
   workstations = SD_workstation_get_list();
 
   for (cursor = 0; cursor < total_nworkstations; cursor++)
   workstations = SD_workstation_get_list();
 
   for (cursor = 0; cursor < total_nworkstations; cursor++)
index 231a780..d9af2ee 100644 (file)
@@ -87,8 +87,8 @@ int main(int argc, char **argv)
 
   while (!xbt_dynar_is_empty((changed_tasks = SD_simulate(-1.0)))) {    
     XBT_INFO("link1: bw=%.0f, lat=%f",
 
   while (!xbt_dynar_is_empty((changed_tasks = SD_simulate(-1.0)))) {    
     XBT_INFO("link1: bw=%.0f, lat=%f",
-             SD_route_get_current_bandwidth(workstations[0], workstations[1]),
-             SD_route_get_current_latency(workstations[0], workstations[1]));
+             SD_route_get_bandwidth(workstations[0], workstations[1]),
+             SD_route_get_latency(workstations[0], workstations[1]));
     XBT_INFO("Jupiter: power=%.0f",
              SD_workstation_get_power(workstations[0])*
              SD_workstation_get_available_power(workstations[0]));
     XBT_INFO("Jupiter: power=%.0f",
              SD_workstation_get_power(workstations[0])*
              SD_workstation_get_available_power(workstations[0]));
index 0f4220f..ce59643 100644 (file)
@@ -76,12 +76,12 @@ int main(int argc, char **argv)
   for (i = 0; i < route_size; i++) {
     XBT_INFO("   Link %s: latency = %f, bandwidth = %f",
           SD_link_get_name(route[i]),
   for (i = 0; i < route_size; i++) {
     XBT_INFO("   Link %s: latency = %f, bandwidth = %f",
           SD_link_get_name(route[i]),
-          SD_link_get_current_latency(route[i]),
-          SD_link_get_current_bandwidth(route[i]));
+          SD_link_get_latency(route[i]),
+          SD_link_get_bandwidth(route[i]));
   }
   XBT_INFO("Route latency = %f, route bandwidth = %f",
   }
   XBT_INFO("Route latency = %f, route bandwidth = %f",
-        SD_route_get_current_latency(w1, w2),
-        SD_route_get_current_bandwidth(w1, w2));
+        SD_route_get_latency(w1, w2),
+        SD_route_get_bandwidth(w1, w2));
   XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount12, name1, name2,
         SD_route_get_communication_time(w1, w2, communication_amount12));
   XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount12, name1, name2,
         SD_route_get_communication_time(w1, w2, communication_amount12));
index aaa60fd..0a9bf56 100644 (file)
@@ -67,7 +67,7 @@ int main(int argc, char **argv)
             argv[1]);
 
   /* getting platform infos */
             argv[1]);
 
   /* getting platform infos */
-  n_hosts = SD_workstation_get_number();
+  n_hosts = SD_workstation_get_count();
   hosts = SD_workstation_get_list();
 
   /* sorting hosts by hostname */
   hosts = SD_workstation_get_list();
 
   /* sorting hosts by hostname */
index c6cab06..0dfb6d5 100644 (file)
@@ -113,7 +113,7 @@ typedef xbt_dictelm_t SD_storage_t;
  */
 XBT_PUBLIC(const SD_link_t *) SD_link_get_list(void);
 /** @brief Returns the number of links in the whole platform */
  */
 XBT_PUBLIC(const SD_link_t *) SD_link_get_list(void);
 /** @brief Returns the number of links in the whole platform */
-static inline int SD_link_get_number(void) {
+static inline int SD_link_get_count(void) {
   return sg_link_count();
 }
 
   return sg_link_count();
 }
 
@@ -135,11 +135,11 @@ static inline const char *SD_link_get_name(SD_link_t link) {
   return sg_link_name(link);
 }
 /** @brief Returns the current bandwidth of a link (in bytes per second) */
   return sg_link_name(link);
 }
 /** @brief Returns the current bandwidth of a link (in bytes per second) */
-static inline double SD_link_get_current_bandwidth(SD_link_t link) {
+static inline double SD_link_get_bandwidth(SD_link_t link) {
   return sg_link_bandwidth(link);
 }
 /** @brief Returns the current latency of a link (in seconds) */
   return sg_link_bandwidth(link);
 }
 /** @brief Returns the current latency of a link (in seconds) */
-static inline double SD_link_get_current_latency(SD_link_t link){
+static inline double SD_link_get_latency(SD_link_t link){
   return sg_link_latency(link);
 }
 /** @brief Returns the sharing policy of this workstation.
   return sg_link_latency(link);
 }
 /** @brief Returns the sharing policy of this workstation.
@@ -168,7 +168,7 @@ static inline int SD_link_is_shared(SD_link_t link) {
  */
 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(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_number(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(void) SD_workstation_set_data(SD_workstation_t workstation,
                                          void *data);
 XBT_PUBLIC(void *) SD_workstation_get_data(SD_workstation_t workstation);
@@ -199,9 +199,9 @@ XBT_PUBLIC(void) SD_workstation_set_access_mode(SD_workstation_t
 
 XBT_PUBLIC(double) SD_workstation_get_computation_time(SD_workstation_t workstation,
                                                        double flops_amount);
 
 XBT_PUBLIC(double) SD_workstation_get_computation_time(SD_workstation_t workstation,
                                                        double flops_amount);
-XBT_PUBLIC(double) SD_route_get_current_latency(SD_workstation_t src,
+XBT_PUBLIC(double) SD_route_get_latency(SD_workstation_t src,
                                                 SD_workstation_t dst);
                                                 SD_workstation_t dst);
-XBT_PUBLIC(double) SD_route_get_current_bandwidth(SD_workstation_t src,
+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,
                                                   SD_workstation_t dst);
 XBT_PUBLIC(double) SD_route_get_communication_time(SD_workstation_t src,
                                                    SD_workstation_t dst,
index bd067f6..f83e9a0 100644 (file)
@@ -187,7 +187,7 @@ void SD_create_environment(const char *platform_file)
 
 
   XBT_DEBUG("Workstation number: %d, link number: %d",
 
 
   XBT_DEBUG("Workstation number: %d, link number: %d",
-         SD_workstation_get_number(), SD_link_get_number());
+         SD_workstation_get_count(), SD_link_get_count());
 #ifdef HAVE_JEDULE
   jedule_setup_platform();
 #endif
 #ifdef HAVE_JEDULE
   jedule_setup_platform();
 #endif
index d40c185..06eb2bd 100644 (file)
@@ -83,7 +83,7 @@ SD_workstation_t SD_workstation_get_by_name(const char *name)
  * \see SD_workstation_get_number()
  */
 const SD_workstation_t *SD_workstation_get_list(void) {
  * \see SD_workstation_get_number()
  */
 const SD_workstation_t *SD_workstation_get_list(void) {
-  xbt_assert(SD_workstation_get_number() > 0, "There is no workstation!");
+  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());
 
   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());
@@ -97,7 +97,7 @@ const SD_workstation_t *SD_workstation_get_list(void) {
  * \return the number of existing workstations
  * \see SD_workstation_get_list()
  */
  * \return the number of existing workstations
  * \see SD_workstation_get_list()
  */
-int SD_workstation_get_number(void)
+int SD_workstation_get_count(void)
 {
   return sg_host_count();
 }
 {
   return sg_host_count();
 }
@@ -222,7 +222,7 @@ const SD_link_t *SD_route_get_list(SD_workstation_t src,
 
   if (sd_global->recyclable_route == NULL) {
     /* first run */
 
   if (sd_global->recyclable_route == NULL) {
     /* first run */
-    sd_global->recyclable_route = xbt_new(SD_link_t, SD_link_get_number());
+    sd_global->recyclable_route = xbt_new(SD_link_t, SD_link_get_count());
   }
 
   surf_route = surf_host_model_get_route((surf_host_model_t)surf_host_model, src, dst);
   }
 
   surf_route = surf_host_model_get_route((surf_host_model_t)surf_host_model, src, dst);
@@ -301,9 +301,9 @@ double SD_workstation_get_computation_time(SD_workstation_t workstation,
  * \param src the first workstation
  * \param dst the second workstation
  * \return the latency of the route between the two workstations (in seconds)
  * \param src the first workstation
  * \param dst the second workstation
  * \return the latency of the route between the two workstations (in seconds)
- * \see SD_route_get_current_bandwidth()
+ * \see SD_route_get_bandwidth()
  */
  */
-double SD_route_get_current_latency(SD_workstation_t src, SD_workstation_t dst)
+double SD_route_get_latency(SD_workstation_t src, SD_workstation_t dst)
 {
   xbt_dynar_t route = NULL;
   double latency;
 {
   xbt_dynar_t route = NULL;
   double latency;
@@ -315,16 +315,16 @@ double SD_route_get_current_latency(SD_workstation_t src, SD_workstation_t dst)
 }
 
 /**
 }
 
 /**
- * \brief Returns the bandwidth of the route between two workstations, i.e. the minimum link bandwidth of all
- * between the workstations.
+ * \brief Returns the bandwidth of the route between two workstations,
+ * i.e. the minimum link bandwidth of all between the workstations.
  *
  * \param src the first workstation
  * \param dst the second workstation
  *
  * \param src the first workstation
  * \param dst the second workstation
- * \return the bandwidth of the route between the two workstations (in bytes/second)
- * \see SD_route_get_current_latency()
+ * \return the bandwidth of the route between the two workstations
+ * (in bytes/second)
+ * \see SD_route_get_latency()
  */
  */
-double SD_route_get_current_bandwidth(SD_workstation_t src,
-                                      SD_workstation_t dst)
+double SD_route_get_bandwidth(SD_workstation_t src, SD_workstation_t dst)
 {
 
   const SD_link_t *links;
 {
 
   const SD_link_t *links;
@@ -338,7 +338,7 @@ double SD_route_get_current_bandwidth(SD_workstation_t src,
   min_bandwidth = -1.0;
 
   for (i = 0; i < nb_links; i++) {
   min_bandwidth = -1.0;
 
   for (i = 0; i < nb_links; i++) {
-    bandwidth = SD_link_get_current_bandwidth(links[i]);
+    bandwidth = SD_link_get_bandwidth(links[i]);
     if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
       min_bandwidth = bandwidth;
   }
     if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
       min_bandwidth = bandwidth;
   }
@@ -386,7 +386,7 @@ double SD_route_get_communication_time(SD_workstation_t src,
   min_bandwidth = -1.0;
 
   for (i = 0; i < nb_links; i++) {
   min_bandwidth = -1.0;
 
   for (i = 0; i < nb_links; i++) {
-    bandwidth = SD_link_get_current_bandwidth(links[i]);
+    bandwidth = SD_link_get_bandwidth(links[i]);
     if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
       min_bandwidth = bandwidth;
   }
     if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
       min_bandwidth = bandwidth;
   }
index d4fd48f..02a7020 100644 (file)
@@ -69,12 +69,11 @@ static void scheduleDAX(xbt_dynar_t dax)
   SD_task_t task;
 
   const SD_workstation_t *ws_list = SD_workstation_get_list();
   SD_task_t task;
 
   const SD_workstation_t *ws_list = SD_workstation_get_list();
-  int totalHosts = SD_workstation_get_number();
+  int totalHosts = SD_workstation_get_count();
   qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
         name_compare_hosts);
 
   qsort((void *) ws_list, totalHosts, sizeof(SD_workstation_t),
         name_compare_hosts);
 
-  int count = SD_workstation_get_number();
-  //fprintf(stdout, "No. workstations: %d, %d\n", count, (dax != NULL));
+  //fprintf(stdout, "No. workstations: %d, %d\n", totalHosts, (dax != NULL));
 
   xbt_dynar_foreach(dax, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
 
   xbt_dynar_foreach(dax, cursor, task) {
     if (SD_task_get_kind(task) == SD_TASK_COMP_SEQ) {
@@ -85,8 +84,8 @@ static void scheduleDAX(xbt_dynar_t dax)
         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) % count]));
-        SD_task_schedulel(task, 1, ws_list[(cursor) % count]);
+                SD_workstation_get_name(ws_list[(cursor) % totalHosts]));
+        SD_task_schedulel(task, 1, ws_list[(cursor) % totalHosts]);
       }
     }
   }
       }
     }
   }
index 7bc2794..5eb24b3 100644 (file)
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   workstations = SD_workstation_get_list();
   SD_create_environment(argv[1]);
 
   workstations = SD_workstation_get_list();
-  list_size = SD_workstation_get_number();
+  list_size = SD_workstation_get_count();
 
   /* Random number initialization */
   srand( (int) (xbt_os_time()*1000) );
 
   /* Random number initialization */
   srand( (int) (xbt_os_time()*1000) );
index 33ea0cc..3256886 100644 (file)
@@ -29,7 +29,7 @@ int main(int argc, char **argv)
   /* Display the result and exit after cleanup */
   printf( "%f\n", xbt_os_timer_elapsed(timer) );
     printf("Workstation number: %d, link number: %d\n",
   /* 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_number(), SD_link_get_number());
+           SD_workstation_get_count(), SD_link_get_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 04a3566..2493e63 100644 (file)
@@ -30,15 +30,15 @@ int main(int argc, char **argv)
   /* creation of the environment */
   SD_create_environment(argv[1]);
   links = SD_link_get_list();
   /* creation of the environment */
   SD_create_environment(argv[1]);
   links = SD_link_get_list();
-  int count = SD_link_get_number();
+  int count = SD_link_get_count();
   XBT_INFO("Link count: %d", count);
   qsort((void *)links, count, sizeof(SD_link_t), cmp_link);
    
   XBT_INFO("Link count: %d", count);
   qsort((void *)links, count, sizeof(SD_link_t), cmp_link);
    
-  for(i=0; i<SD_link_get_number();i++){
+  for(i=0; i < count; i++){
     XBT_INFO("%s: latency = %.5f, bandwidth = %f",
              SD_link_get_name(links[i]),
     XBT_INFO("%s: latency = %.5f, bandwidth = %f",
              SD_link_get_name(links[i]),
-             SD_link_get_current_latency(links[i]),
-             SD_link_get_current_bandwidth(links[i]));
+             SD_link_get_latency(links[i]),
+             SD_link_get_bandwidth(links[i]));
     SD_link_set_data(links[i], (void*) user_data);
     if(strcmp(user_data, (const char*)SD_link_get_data(links[i]))){
       XBT_ERROR("User data was corrupted.");
     SD_link_set_data(links[i], (void*) user_data);
     if(strcmp(user_data, (const char*)SD_link_get_data(links[i]))){
       XBT_ERROR("User data was corrupted.");
index 76bd393..9f6b022 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
   /* creation of the environment */
   SD_create_environment(argv[1]);
   printf("Workstation number: %d, link number: %d\n",
   /* creation of the environment */
   SD_create_environment(argv[1]);
   printf("Workstation number: %d, link number: %d\n",
-         SD_workstation_get_number(), SD_link_get_number());
+         SD_workstation_get_count(), SD_link_get_count());
 
   if (argc >= 3) {
     if (!strcmp(argv[2], "ONE_LINK")) {
 
   if (argc >= 3) {
     if (!strcmp(argv[2], "ONE_LINK")) {
@@ -49,16 +49,16 @@ int main(int argc, char **argv)
       for (i = 0; i < route_size; i++) {
       printf("  Link %s: latency = %f, bandwidth = %f\n",
            SD_link_get_name(route[i]),
       for (i = 0; i < route_size; i++) {
       printf("  Link %s: latency = %f, bandwidth = %f\n",
            SD_link_get_name(route[i]),
-           SD_link_get_current_latency(route[i]),
-           SD_link_get_current_bandwidth(route[i]));
+           SD_link_get_latency(route[i]),
+           SD_link_get_bandwidth(route[i]));
       }
       printf("Route latency = %f, route bandwidth = %f\n",
       }
       printf("Route latency = %f, route bandwidth = %f\n",
-         SD_route_get_current_latency(w1, w2),
-         SD_route_get_current_bandwidth(w1, w2));
+         SD_route_get_latency(w1, w2),
+         SD_route_get_bandwidth(w1, w2));
     }
     if (!strcmp(argv[2], "FULL_LINK")) {
       workstations = SD_workstation_get_list();
     }
     if (!strcmp(argv[2], "FULL_LINK")) {
       workstations = SD_workstation_get_list();
-      list_size = SD_workstation_get_number();
+      list_size = SD_workstation_get_count();
       for (i = 0; i < list_size; i++) {
       w1 = workstations[i];
       name1 = SD_workstation_get_name(w1);
       for (i = 0; i < list_size; i++) {
       w1 = workstations[i];
       name1 = SD_workstation_get_name(w1);
@@ -72,12 +72,12 @@ int main(int argc, char **argv)
         for (k = 0; k < route_size; k++) {
         printf("  Link %s: latency = %f, bandwidth = %f\n",
              SD_link_get_name(route[k]),
         for (k = 0; k < route_size; k++) {
         printf("  Link %s: latency = %f, bandwidth = %f\n",
              SD_link_get_name(route[k]),
-             SD_link_get_current_latency(route[k]),
-             SD_link_get_current_bandwidth(route[k]));
+             SD_link_get_latency(route[k]),
+             SD_link_get_bandwidth(route[k]));
         }
         printf("  Route latency = %f, route bandwidth = %f\n",
         }
         printf("  Route latency = %f, route bandwidth = %f\n",
-           SD_route_get_current_latency(w1, w2),
-           SD_route_get_current_bandwidth(w1, w2));
+           SD_route_get_latency(w1, w2),
+           SD_route_get_bandwidth(w1, w2));
       }
       }
     }
       }
       }
     }
index 1adbc2c..34c2888 100644 (file)
@@ -128,7 +128,8 @@ int main(int argc, char **argv)
 
   if (timings) {
     XBT_INFO("Parsing time: %fs (%d hosts, %d links)",
 
   if (timings) {
     XBT_INFO("Parsing time: %fs (%d hosts, %d links)",
-          xbt_os_timer_elapsed(parse_time),SD_workstation_get_number(),SD_link_get_number());
+          xbt_os_timer_elapsed(parse_time),SD_workstation_get_count(),
+          SD_link_get_count());
   } else {
     printf("<?xml version='1.0'?>\n");
     printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n");
   } else {
     printf("<?xml version='1.0'?>\n");
     printf("<!DOCTYPE platform SYSTEM \"http://simgrid.gforge.inria.fr/simgrid.dtd\">\n");
@@ -137,7 +138,7 @@ 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_number();
+    totalHosts = SD_workstation_get_count();
     hosts = SD_workstation_get_list();
     qsort((void *) hosts, totalHosts, sizeof(SD_workstation_t),
         name_compare_hosts);
     hosts = SD_workstation_get_list();
     qsort((void *) hosts, totalHosts, sizeof(SD_workstation_t),
         name_compare_hosts);
@@ -171,7 +172,7 @@ int main(int argc, char **argv)
     }
 
     // Links
     }
 
     // Links
-    totalLinks = SD_link_get_number();
+    totalLinks = SD_link_get_count();
     links = SD_link_get_list();
 
     qsort((void *) links, totalLinks, sizeof(SD_link_t), name_compare_links);
     links = SD_link_get_list();
 
     qsort((void *) links, totalLinks, sizeof(SD_link_t), name_compare_links);
@@ -181,8 +182,8 @@ int main(int argc, char **argv)
 
       printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"",
           SD_link_get_name(links[i]),
 
       printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"",
           SD_link_get_name(links[i]),
-          SD_link_get_current_bandwidth(links[i]),
-          SD_link_get_current_latency(links[i]));
+          SD_link_get_bandwidth(links[i]),
+          SD_link_get_latency(links[i]));
       if (SD_link_is_shared(links[i])) {
         printf("/>\n");
       } else {
       if (SD_link_is_shared(links[i])) {
         printf("/>\n");
       } else {
index 9d87429..f6abd93 100644 (file)
@@ -30,7 +30,7 @@ int main(int argc, char **argv)
   size = xbt_dict_length(host_list) + xbt_lib_length(as_router_lib);
 
   printf("Workstation number: %d, link number: %d, elmts number: %d\n",
   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_number(), SD_link_get_number(), size);
+         SD_workstation_get_count(), SD_link_get_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,