Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into xbt_random
[simgrid.git] / examples / deprecated / simdag / scheduling / sd_scheduling.c
index be2963a..c7cd717 100644 (file)
@@ -24,26 +24,26 @@ struct _HostAttribute {
 
 static double sg_host_get_available_at(sg_host_t host)
 {
-  HostAttribute attr = (HostAttribute)sg_host_get_data(host);
+  HostAttribute attr = (HostAttribute)sg_host_data(host);
   return attr->available_at;
 }
 
 static void sg_host_set_available_at(sg_host_t host, double time)
 {
-  HostAttribute attr = (HostAttribute)sg_host_get_data(host);
+  HostAttribute attr = (HostAttribute)sg_host_data(host);
   attr->available_at = time;
-  sg_host_set_data(host, attr);
+  sg_host_data_set(host, attr);
 }
 
 static SD_task_t sg_host_get_last_scheduled_task( sg_host_t host){
-  HostAttribute attr = (HostAttribute)sg_host_get_data(host);
+  HostAttribute attr = (HostAttribute)sg_host_data(host);
   return attr->last_scheduled_task;
 }
 
 static void sg_host_set_last_scheduled_task(sg_host_t host, SD_task_t task){
-  HostAttribute attr       = (HostAttribute)sg_host_get_data(host);
+  HostAttribute attr       = (HostAttribute)sg_host_data(host);
   attr->last_scheduled_task=task;
-  sg_host_set_data(host, attr);
+  sg_host_data_set(host, attr);
 }
 
 static xbt_dynar_t get_ready_tasks(xbt_dynar_t dax)
@@ -72,7 +72,6 @@ static double finish_on_at(SD_task_t task, sg_host_t host)
   if (!xbt_dynar_is_empty(parents)) {
     unsigned int i;
     double data_available = 0.;
-    double redist_time    = 0;
     double last_data_available;
     /* compute last_data_available */
     SD_task_t parent;
@@ -82,6 +81,7 @@ static double finish_on_at(SD_task_t task, sg_host_t host)
       if (SD_task_get_kind(parent) == SD_TASK_COMM_E2E) {
         sg_host_t * parent_host= SD_task_get_workstation_list(parent);
         /* Estimate the redistribution time from this parent */
+        double redist_time;
         if (SD_task_get_amount(parent) <= 1e-6){
           redist_time= 0;
         } else {
@@ -159,7 +159,7 @@ int main(int argc, char **argv)
   sg_host_t *hosts = sg_host_list();
 
   for (cursor = 0; cursor < total_nhosts; cursor++)
-    sg_host_set_data(hosts[cursor], xbt_new0(struct _HostAttribute, 1));
+    sg_host_data_set(hosts[cursor], xbt_new0(struct _HostAttribute, 1));
 
   /* load the DAX file */
   xbt_dynar_t dax = SD_daxload(argv[2]);
@@ -246,8 +246,8 @@ int main(int argc, char **argv)
   xbt_dynar_free_container(&dax);
 
   for (cursor = 0; cursor < total_nhosts; cursor++) {
-    free(sg_host_get_data(hosts[cursor]));
-    sg_host_set_data(hosts[cursor], NULL);
+    free(sg_host_data(hosts[cursor]));
+    sg_host_data_set(hosts[cursor], NULL);
   }
 
   xbt_free(hosts);