Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
test of sd_test
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 28 Sep 2010 08:53:11 +0000 (08:53 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 28 Sep 2010 08:53:11 +0000 (08:53 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8258 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simdag/sd_workstation.c
testsuite/simdag/sd_test.c

index d2a00e1..b38c3d9 100644 (file)
@@ -73,8 +73,6 @@ const SD_workstation_t *SD_workstation_get_list(void)
   SD_CHECK_INIT_DONE();
   xbt_assert0(SD_workstation_get_number() > 0, "There is no workstation!");
 
-
-
   if (sd_global->workstation_list == NULL) {    /* this is the first time the function is called */
     sd_global->workstation_list =
       xbt_new(SD_workstation_t, sd_global->workstation_count);
@@ -199,19 +197,22 @@ const SD_link_t *SD_route_get_list(SD_workstation_t src, SD_workstation_t dst)
     sd_global->recyclable_route = xbt_new(SD_link_t, SD_link_get_number());
   }
 
-  surf_src = src->surf_workstation;
-  surf_dst = dst->surf_workstation;
+  surf_src = &src->surf_workstation;
+  surf_dst = &dst->surf_workstation;
 
-  surf_route =
-    surf_workstation_model->extension.workstation.get_route(surf_src,
-                                                            surf_dst);
+  surf_route = surf_workstation_model->extension.workstation.get_route(surf_src,surf_dst);
+
+  if(surf_route == NULL)
+  {
+         INFO0("PBLM1 surf_route == NULL");
+  }
 
   xbt_dynar_foreach(surf_route, cpt, surf_link) {
     link_name = surf_resource_name(surf_link);
     sd_global->recyclable_route[cpt] =
       xbt_dict_get(sd_global->links, link_name);
   }
-
+  INFO0("FIN");
   return sd_global->recyclable_route;
 }
 
index f3453b7..3031f31 100644 (file)
@@ -21,8 +21,8 @@ int main(int argc, char **argv)
   const SD_workstation_t *workstations;
   SD_workstation_t w1;
   SD_workstation_t w2;
-  const char *name1;
-  const char *name2;
+  const char *name1 = NULL;
+  const char *name2 = NULL;
   const double computation_amount1 = 2000000;
   const double computation_amount2 = 1000000;
   const double communication_amount12 = 2000000;
@@ -52,12 +52,22 @@ int main(int argc, char **argv)
 
   /* test the estimation functions (use small_platform.xml) */
   workstations = SD_workstation_get_list();
+
+
+  for(i=0 ; i < SD_workstation_get_number() ; i++)
+  {
+         INFO1("name : %s",SD_workstation_get_name(workstations[i]) );
+  }
+
   w1 = workstations[0];
   w2 = workstations[1];
   name1 = SD_workstation_get_name(w1);
   name2 = SD_workstation_get_name(w2);
+
   route = SD_route_get_list(w1, w2);
+
   route_size = SD_route_get_size(w1, w2);
+
   taskA = SD_task_create("Task A", NULL, 10.0);
   taskB = SD_task_create("Task B", NULL, 40.0);
   taskC = SD_task_create("Task C", NULL, 30.0);