Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
revalidate the NS3 tests
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 14:09:48 +0000 (15:09 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 14:09:48 +0000 (15:09 +0100)
examples/msg/ns3/Two_clusters-d.xml
examples/msg/ns3/ns3.c
examples/msg/ns3/ns3.tesh

index 5132ff1..b7d2b0f 100644 (file)
@@ -2,13 +2,13 @@
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
 
-  <process host="node3.acme.org" function="master">
+  <process host="node-3.acme.org" function="master">
       <argument value="100"/>
-      <argument value="node3.acme.org"/>
+      <argument value="node-16.acme.org"/>
       <argument value="1"/>
   </process>
 
-  <process host="node16.acme.org" function="slave">
+  <process host="node-16.acme.org" function="slave">
     <argument value="1"/>
   </process>
      
index fecc41c..ac1b6ad 100644 (file)
@@ -56,12 +56,8 @@ int count_finished = 0;
 /** master */
 int master(int argc, char *argv[])
 {
-  char *slavename = NULL;
   double task_comm_size = 0;
   msg_task_t todo;
-  char id_alias[10];
-  //unique id to control statistics
-  int id = -1;
 
   xbt_assert(argc==4,"Strange number of arguments expected 3 got %d", argc - 1);
 
@@ -73,17 +69,16 @@ int master(int argc, char *argv[])
   xbt_assert(read, "Invalid argument %s\n", argv[1]);
 
   /* slave name */
-  slavename = argv[2];
-  id = atoi(argv[3]);
-  sprintf(id_alias, "flow_%d", id);
+  char *slavename = argv[2];
+  int id = atoi(argv[3]);   //unique id to control statistics
+  char *id_alias = bprintf("flow_%d", id);
   slavenames[id] = slavename;
   TRACE_category(id_alias);
 
   masternames[id] = MSG_host_get_name(MSG_host_self());
 
   {                             /*  Task creation.  */
-    char sprintf_buffer[64] = "Task_0";
-    todo = MSG_task_create(sprintf_buffer, 100*task_comm_size, task_comm_size, NULL);
+    todo = MSG_task_create("Task_0", 100*task_comm_size, task_comm_size, NULL);
     MSG_task_set_category(todo, id_alias);
     //keep track of running tasks
     gl_task_array[id] = todo;
@@ -100,11 +95,11 @@ int master(int argc, char *argv[])
   /* time measurement */
   sprintf(id_alias, "%d", id);
   start_time = MSG_get_clock();
-  //MSG_task_execute(todo);
   MSG_task_send(todo, id_alias);
   end_time = MSG_get_clock();
 
   XBT_DEBUG ("Finished");
+  xbt_free(id_alias);
   return 0;
 }                               /* end_of_master */
 
index 06aea56..0574d33 100644 (file)
@@ -8,19 +8,19 @@ p throughoutly test NS3.
 p 3hosts 2links
 
 $ ns3/ns3 ${srcdir:=.}/examples/platforms/small_platform_one_link_routes.xml ${srcdir:=.}/examples/msg/ns3/3hosts_2links_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
 > [Jupiter:slave(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from Tremblay to Jupiter
 
 p 6hosts 3links
 
 $ ns3/ns3 ${srcdir:=.}/examples/platforms/small_platform_one_link_routes.xml ${srcdir:=.}/examples/msg/ns3/3links-d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
 > [Jupiter:slave(2)] [msg_test/INFO] FLOW[1] : Receive 100000 bytes from Tremblay to Jupiter
 > [Ginette:slave(4)] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from Fafard to Ginette
 > [Lovelace:slave(6)] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from Bourassa to Lovelace
 
 $ ns3/ns3 ${srcdir:=.}/examples/platforms/small_platform_one_link_routes.xml ${srcdir:=.}/examples/msg/ns3/3links-d-timer.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
 > [Jupiter:slave(2)] [msg_test/INFO] FLOW[1] : Receive 100000 bytes from Tremblay to Jupiter
 > [Ginette:slave(4)] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from Fafard to Ginette
 > [Lovelace:slave(6)] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from Bourassa to Lovelace
@@ -29,11 +29,11 @@ $ ns3/ns3 ${srcdir:=.}/examples/platforms/small_platform_one_link_routes.xml ${s
 p One cluster
 
 $ ns3/ns3 ${srcdir:=.}/examples/platforms/cluster.xml ${srcdir:=.}/examples/msg/ns3/One_cluster-d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
 > [node-6.acme.org:slave(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from node-2.acme.org to node-6.acme.org
 
 p Two clusters
 
 $ ns3/ns3 ${srcdir:=.}/examples/platforms/clusters_routing_full.xml ${srcdir:=.}/examples/msg/ns3/Two_clusters-d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
-> [:(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
-> [node16.acme.org:slave(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from node3.acme.org to node16.acme.org
+> [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+> [node-16.acme.org:slave(2)] [msg_test/INFO] FLOW[1] : Receive 100 bytes from node-3.acme.org to node-16.acme.org