--- /dev/null
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
+<platform version="3">
+
+ <process host="S1" function="master">
+ <argument value="100000"/>
+ <argument value="C1"/>
+ <argument value="1"/>
+ </process>
+
+ <process host="C1" function="slave">
+ <argument value="1"/>
+ </process>
+
+ <process host="S2" function="master">
+ <argument value="1000000"/>
+ <argument value="C2"/>
+ <argument value="2"/>
+ </process>
+
+ <process host="C2" function="slave">
+ <argument value="2"/>
+ </process>
+
+
+ <process host="S3" function="master">
+ <argument value="2000000"/>
+ <argument value="C3"/>
+ <argument value="3"/>
+ </process>
+
+ <process host="C3" function="slave">
+ <argument value="3"/>
+ </process>
+
+ <process host="S3" function="master" start_time="2.0">
+ <argument value="2000000"/>
+ <argument value="C3"/>
+ <argument value="4"/>
+ </process>
+
+ <process host="C3" function="slave">
+ <argument value="4"/>
+ </process>
+
+ <process host="C3" function="timer">
+ <argument value="0"/>
+ <argument value=".1"/>
+ </process>
+
+ <process host="C3" function="timer" start_time="2.0">
+ <argument value="0"/>
+ <argument value=".1"/>
+ </process>
+</platform>
<platform version="3">
<process host="S1" function="master">
- <argument value="100"/>
+ <argument value="100000"/>
<argument value="C1"/>
<argument value="1"/>
</process>
</process>
<process host="S2" function="master">
- <argument value="1000"/>
+ <argument value="1000000"/>
<argument value="C2"/>
<argument value="2"/>
</process>
<process host="C2" function="slave">
<argument value="2"/>
</process>
+
-
- <process host="S3" function="master">
- <argument value="2000"/>
+ <process host="S3" function="master">
+ <argument value="2000000"/>
<argument value="C3"/>
<argument value="3"/>
</process>
<process host="C3" function="slave">
<argument value="3"/>
</process>
-
+
+<!-- <process host="C3" function="timer">
+ <argument value="0"/>
+ <argument value=".1"/>
+ </process>
+ -->
</platform>
<host id="S3" power="1000000000"/>
<host id="C3" power="1000000000"/>
- <link id="1" bandwidth="1000" latency="0.01"/>
- <link id="2" bandwidth="1000" latency="0.01"/>
- <link id="3" bandwidth="1000" latency="0.01"/>
+ <link id="1" bandwidth="1000000" latency="0.00001"/>
+ <link id="2" bandwidth="1000000" latency="0.00001"/>
+ <link id="3" bandwidth="1000000" latency="0.00001"/>
<route src="S1" dst="C1">
<link_ctn id="1"/>
MSG_error_t test_all(const char *platform_file,
const char *application_file);
-int timer_start = 1;
+int timer_start; //set as 1 in the master process
typedef enum {
PORT_22 = 0,
//unique id to control statistics
int id = -1;
- if (argc != 4) {
- XBT_INFO("Strange number of arguments expected 3 got %d", argc - 1);
- }
+ xbt_assert(argc==4,"Strange number of arguments expected 3 got %d", argc - 1);
+
+ XBT_DEBUG ("Master started");
/* data size */
int read;
}
count_finished++;
+ timer_start = 1 ;
/* time measurement */
sprintf(id_alias, "%d", id);
MSG_task_send(todo, id_alias);
end_time = MSG_get_clock();
-
+ XBT_DEBUG ("Finished");
return 0;
} /* end_of_master */
/** Timer function */
int timer(int argc, char *argv[])
{
- int sleep_time;
- int first_sleep;
+ double sleep_time;
+ double first_sleep;
- if (argc != 3) {
- XBT_INFO("Strange number of arguments expected 2 got %d", argc - 1);
- }
+ xbt_assert(argc==3,"Strange number of arguments expected 2 got %d", argc - 1);
+
+ sscanf(argv[1], "%lf", &first_sleep);
+ sscanf(argv[2], "%lf", &sleep_time);
- sscanf(argv[1], "%d", &first_sleep);
- sscanf(argv[2], "%d", &sleep_time);
+ XBT_DEBUG ("Timer started");
if(first_sleep){
MSG_process_sleep(first_sleep);
}
- while(timer_start){
+ do {
+ XBT_DEBUG ("Get sleep");
MSG_process_sleep(sleep_time);
- }
+ } while(timer_start);
+ XBT_DEBUG ("Finished");
return 0;
}
int id = 0;
char id_alias[10];
- if (argc != 2) {
- XBT_INFO("Strange number of arguments expected 1 got %d", argc - 1);
- }
+ xbt_assert(argc==2,"Strange number of arguments expected 1 got %d", argc - 1);
+
+ XBT_DEBUG ("Slave started");
id = atoi(argv[1]);
sprintf(id_alias, "%d", id);
MSG_task_get_data_size(task),
masternames[id],
slavenames[id]);
-
+// MSG_task_execute(task);
MSG_task_destroy(task);
+ XBT_DEBUG ("Finished");
return 0;
} /* end_of_slave */
$ ns3/ns3 ${srcdir:=.}/ns3/3links-p.xml ${srcdir:=.}/ns3/3links-d.xml --cfg=network/model:NS3
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [C1:slave:(2) 0.392000] [msg_test/INFO] FLOW[1] : Receive 100 bytes from S1 to C1
-> [C2:slave:(4) 1.354000] [msg_test/INFO] FLOW[2] : Receive 1000 bytes from S2 to C2
-> [C3:slave:(6) 2.438000] [msg_test/INFO] FLOW[3] : Receive 2000 bytes from S3 to C3
+> [C1:slave:(2) 0.108460] [msg_test/INFO] FLOW[1] : Receive 100000 bytes from S1 to C1
+> [C2:slave:(4) 1.074465] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from S2 to C2
+> [C3:slave:(6) 2.116464] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from S3 to C3
+
+$ ns3/ns3 ${srcdir:=.}/ns3/3links-p.xml ${srcdir:=.}/ns3/3links-d-timer.xml --cfg=network/model:NS3
+> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
+> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
+> [C1:slave:(2) 0.108460] [msg_test/INFO] FLOW[1] : Receive 100000 bytes from S1 to C1
+> [C2:slave:(4) 1.074465] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from S2 to C2
+> [C3:slave:(6) 2.116506] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from S3 to C3
+> [C3:slave:(7) 4.232762] [msg_test/INFO] FLOW[4] : Receive 2000000 bytes from S3 to C3
p One cluster
$ ns3/ns3 ${srcdir:=.}/ns3/Two_clusters.xml ${srcdir:=.}/ns3/Two_clusters-d.xml --cfg=network/model:NS3
> [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
> [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [c-16.me:slave:(2) 0.012453] [msg_test/INFO] FLOW[1] : Receive 100 bytes from c-3.me to c-16.me
\ No newline at end of file
+> [c-16.me:slave:(2) 0.012453] [msg_test/INFO] FLOW[1] : Receive 100 bytes from c-3.me to c-16.me