<!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>
/** 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);
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;
/* 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 */
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
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