From: mquinson Date: Mon, 27 Jun 2005 22:17:43 +0000 (+0000) Subject: cleanups X-Git-Tag: v3.3~3924 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a6aeb73952c9aad1e8fc1aa5738d8daf693dd32a cleanups git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1431 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/amok/bandwidth/Makefile.am b/examples/amok/bandwidth/Makefile.am index f172e6c350..3562b3705c 100644 --- a/examples/amok/bandwidth/Makefile.am +++ b/examples/amok/bandwidth/Makefile.am @@ -1,7 +1,7 @@ INCLUDES= -I$(top_srcdir)/include AM_CFLAGS=-g TESTS=test_rl test_sg -EXTRA_DIST=bandwidth_deployment.txt $(TESTS) +EXTRA_DIST=bandwidth_deployment.xml $(TESTS) noinst_PROGRAMS=bandwidth_maestro bandwidth_sensor bandwidth_simulator diff --git a/examples/amok/bandwidth/bandwidth.c b/examples/amok/bandwidth/bandwidth.c index 59033b68fb..b231c72b20 100644 --- a/examples/amok/bandwidth/bandwidth.c +++ b/examples/amok/bandwidth/bandwidth.c @@ -38,13 +38,12 @@ int sensor (int argc,char *argv[]) { xbt_error_t errcode; sensor_data_t g; - gras_init(&argc, argv, NULL); + gras_init(&argc, argv); g=gras_userdata_new(s_sensor_data_t); - amok_bw_init(); if ((errcode=gras_socket_server(atoi(argv[1]),&(g->sock)))) { - ERROR1("Sensor: Error %s encountered while opening the server socket",xbt_error_name(errcode)); + ERROR1("Error %s encountered while opening the server socket",xbt_error_name(errcode)); return 1; } g->done = 0; @@ -55,8 +54,7 @@ int sensor (int argc,char *argv[]) { while (! g->done ) { errcode=gras_msg_handle(60.0); if (errcode != no_error) { - ERROR1("Sensor: Error '%s' while handling message",xbt_error_name(errcode)); - gras_socket_close(g->sock); + ERROR1("Error '%s' while handling message",xbt_error_name(errcode)); return errcode; } } @@ -83,36 +81,30 @@ int maestro(int argc,char *argv[]) { double sec, bw; int buf_size=32; int exp_size=1024*50; - int msg_size=1024; + int msg_size=512; gras_socket_t peer; - gras_init(&argc, argv, NULL); + gras_init(&argc, argv); g=gras_userdata_new(s_maestro_data_t); amok_bw_init(); - - if ((errcode=gras_socket_server(6000,&(g->sock)))) { - ERROR1("Maestro: Error %s encountered while opening the server socket",xbt_error_name(errcode)); - return 1; - } - - + if (argc != 5) { ERROR0("Usage: maestro host port host port\n"); return 1; } /* wait to ensure that all server sockets are there before starting the experiment */ - gras_os_sleep(1.0); + gras_os_sleep(0.5); if ((errcode=gras_socket_client(argv[1],atoi(argv[2]),&peer))) { - ERROR3("Client: Unable to connect to my peer on %s:%s. Got %s", + ERROR3("Unable to connect to my peer on %s:%s. Got %s", argv[1],argv[2],xbt_error_name(errcode)); return 1; } INFO0("Test the BW between me and one of the sensors"); TRY(amok_bw_test(peer,buf_size,exp_size,msg_size,&sec,&bw)); - INFO6("maestro: Experience between me and %s:%d (%d kb in msgs of %d kb) took %f sec, achieving %f kb/s", + INFO6("Experience between me and %s:%d (%d kb in msgs of %d kb) took %f sec, achieving %f kb/s", argv[1],atoi(argv[2]), exp_size,msg_size, sec,bw); @@ -120,6 +112,8 @@ int maestro(int argc,char *argv[]) { INFO0("Test the BW between the two sensors"); TRY(amok_bw_request(argv[1],atoi(argv[2]),argv[3],atoi(argv[4]), buf_size,exp_size,msg_size,&sec,&bw)); + INFO2("Experience took took %f sec, achieving %f kb/s", + sec,bw); /* ask sensors to quit */ gras_msgtype_declare("quit",NULL); diff --git a/examples/amok/bandwidth/bandwidth_deployment.xml b/examples/amok/bandwidth/bandwidth_deployment.xml index 5947ac1da5..87ba7c7eb5 100644 --- a/examples/amok/bandwidth/bandwidth_deployment.xml +++ b/examples/amok/bandwidth/bandwidth_deployment.xml @@ -4,13 +4,13 @@ - + - + diff --git a/examples/amok/bandwidth/test_rl.in b/examples/amok/bandwidth/test_rl.in index dc09c1e29f..1aa3b83605 100755 --- a/examples/amok/bandwidth/test_rl.in +++ b/examples/amok/bandwidth/test_rl.in @@ -1,10 +1,11 @@ #! @BASH@ -e if [ x@EXEEXT@ = x ] ; then - exenv="libtool --mode=execute valgrind --run-libc-freeres=no " +# exenv="libtool --mode=execute valgrind --run-libc-freeres=no " + exenv= else exenv=wine fi $exenv ./bandwidth_sensor@EXEEXT@ 4000 $@& -#$exenv ./bandwidth_sensor@EXEEXT@ 5000 $@& +$exenv ./bandwidth_sensor@EXEEXT@ 5000 $@& $exenv ./bandwidth_maestro@EXEEXT@ 127.0.0.1 4000 127.0.0.1 5000 $@ diff --git a/examples/amok/bandwidth/test_sg.in b/examples/amok/bandwidth/test_sg.in index b82ca1e6d7..0a93f975f7 100755 --- a/examples/amok/bandwidth/test_sg.in +++ b/examples/amok/bandwidth/test_sg.in @@ -1,6 +1,7 @@ #! @BASH@ if [ x@EXEEXT@ = x ] ; then - exenv="libtool --mode=execute valgrind" +# exenv="libtool --mode=execute valgrind" + exenv= else exenv=wine fi