- kill_buddy(argv[5],atoi(argv[6]));
- kill_buddy(argv[7],atoi(argv[8]));
-
- amok_bw_saturate_start(argv[1],atoi(argv[2]),argv[3],atoi(argv[4]),
- sat_size*5,5);
- gras_os_sleep(3);
+ /* where are the sensors */
+ xbt_dynar_t peers;
+ xbt_peer_t h1,h2;
+ /* results */
+ double duration,bw;
+
+ /* Init the group */
+ peers=amok_pm_group_new("saturate");
+ /* wait for dudes */
+ gras_msg_handleall(5);
+
+ /* Stop all sensors but two of them */
+ while (xbt_dynar_length(peers) > 2) {
+ xbt_dynar_pop(peers,&h1);
+ amok_pm_kill_hp(h1->name,h1->port);
+ xbt_peer_free(h1);
+ }
+
+ /* get 2 friends */
+ xbt_dynar_get_cpy(peers,0,&h1);
+ xbt_dynar_get_cpy(peers,1,&h2);
+
+ /* Start saturation */
+ INFO4("Start saturation between %s:%d and %s:%d",
+ h1->name,h1->port,
+ h2->name,h2->port);
+
+ amok_bw_saturate_start(h1->name,h1->port,
+ h2->name,h2->port,
+ 0, /* Be a nice boy, compute msg_size yourself */
+ 30 /* 5 sec timeout */);
+
+ /* Stop it after a while */
+ INFO0("Have a rest");
+ gras_os_sleep(1);