From e744b1ef9431d71b562caa0163c7d31e72dfcf64 Mon Sep 17 00:00:00 2001 From: mquinson Date: Mon, 6 Jun 2005 22:15:51 +0000 Subject: [PATCH] Revival of the bandwidth test to help me ensuring that the current hacking in the corresponding module of amok is ok; the given module is there to help me ensuring that current hacking with measurement sockets is ok. Oh, damn. Time to sleeeeep git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1358 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/amok/Makefile.am | 2 +- examples/bandwidth/Makefile.am | 33 +++++++++++++-------- examples/bandwidth/bandwidth.c | 6 ++-- examples/bandwidth/bandwidth_deployment.txt | 3 -- examples/bandwidth/bandwidth_deployment.xml | 16 ++++++++++ examples/bandwidth/test_sg.in | 8 +++-- 6 files changed, 45 insertions(+), 23 deletions(-) delete mode 100644 examples/bandwidth/bandwidth_deployment.txt create mode 100644 examples/bandwidth/bandwidth_deployment.xml diff --git a/examples/amok/Makefile.am b/examples/amok/Makefile.am index 9f652b895e..33bff8e7e2 100644 --- a/examples/amok/Makefile.am +++ b/examples/amok/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS= # bandwidth alnem saturate +SUBDIRS= bandwidth # alnem saturate include $(top_srcdir)/acmacro/dist-files.mk diff --git a/examples/bandwidth/Makefile.am b/examples/bandwidth/Makefile.am index 7c836b8a9f..4a3d360530 100644 --- a/examples/bandwidth/Makefile.am +++ b/examples/bandwidth/Makefile.am @@ -3,24 +3,31 @@ AM_CFLAGS=-g TESTS=test_rl test_sg EXTRA_DIST=bandwidth_deployment.txt $(TESTS) -if HAVE_SG - check_PROGRAMS=bandwidth_maestro bandwidth_sensor bandwidth_simulator +noinst_PROGRAMS=bandwidth_maestro bandwidth_sensor bandwidth_simulator - bandwidth_simulator_SOURCES= _bandwidth_simulator.c bandwidth.c - bandwidth_simulator_LDADD= $(top_builddir)/src/libgrassg.la $(top_builddir)/src/amok/libamok.la @LIBS_SimGrid@ -else - check_PROGRAMS=bandwidth_maestro bandwidth_sensor -endif +bandwidth_simulator_SOURCES= _bandwidth_simulator.c bandwidth.c +bandwidth_simulator_LDADD= $(top_builddir)/src/libsimgrid.la $(top_builddir)/src/amok/libamok.la bandwidth_maestro_SOURCES= _bandwidth_maestro.c bandwidth.c -bandwidth_sensor_SOURCES= _bandwidth_sensor.c bandwidth.c +bandwidth_maestro_LDADD= $(top_builddir)/src/libgras.la $(top_builddir)/src/amok/libamok.la -bandwidth_maestro_LDADD= $(top_builddir)/src/libgrasrl.la $(top_builddir)/src/amok/libamok.la -bandwidth_sensor_LDADD= $(top_builddir)/src/libgrasrl.la $(top_builddir)/src/amok/libamok.la +bandwidth_sensor_SOURCES= _bandwidth_sensor.c bandwidth.c +bandwidth_sensor_LDADD= $(top_builddir)/src/libgras.la $(top_builddir)/src/amok/libamok.la # cleanup temps -MAINTAINERCLEANFILES=_bandwidth_simulator.c _bandwidth_maestro.c _bandwidth_sensor.c +CLEANFILES=_bandwidth_simulator.c _bandwidth_maestro.c _bandwidth_sensor.c \ + bandwidth.Makefile.local bandwidth.Makefile.remote bandwidth.deploy.sh + +MOSTLYCLEANFILES = bandwidth.trace # generate temps -_bandwidth_maestro.c _bandwidth_sensor.c _bandwidth_simulator.c: bandwidth_deployment.txt - $(top_srcdir)/examples/gras_stub_generator bandwidth bandwidth_deployment.txt >/dev/null +NAME=bandwidth +PROCESSES= maestro sensor + +$(foreach proc, $(PROCESSES), _$(NAME)_$(proc).c) _$(NAME)_simulator.c: $(srcdir)/$(NAME)_deployment.xml ../../../tools/gras/gras_stub_generator@EXEEXT@ + [ x@EXEEXT@ = x ] || exenv=wine; $$exenv ../../../tools/gras/gras_stub_generator@EXEEXT@ $(NAME) $(srcdir)/$(NAME)_deployment.xml >/dev/null + +../../../tools/gras/gras_stub_generator@EXEEXT@: + make -C ../../../tools/gras/ gras_stub_generator@EXEEXT@ + +include $(top_srcdir)/acmacro/dist-files.mk diff --git a/examples/bandwidth/bandwidth.c b/examples/bandwidth/bandwidth.c index 9069985d44..db872ad7c5 100644 --- a/examples/bandwidth/bandwidth.c +++ b/examples/bandwidth/bandwidth.c @@ -29,7 +29,7 @@ int sensor (int argc,char *argv[]) { xbt_error_t errcode; sensor_data_t g; - xbt_init(&argc,argv); + gras_init(&argc, argv, NULL); g=gras_userdata_new(s_sensor_data_t); amok_bw_init(); @@ -71,10 +71,10 @@ int maestro(int argc,char *argv[]) { int msg_size=64; gras_socket_t peer; - xbt_init(&argc,argv); + gras_init(&argc, argv, NULL); g=gras_userdata_new(s_maestro_data_t); amok_bw_init(); - gras_os_sleep(1,0); + gras_os_sleep(1.0); if ((errcode=gras_socket_server(6000,&(g->sock)))) { ERROR1("Maestro: Error %s encountered while opening the server socket",xbt_error_name(errcode)); diff --git a/examples/bandwidth/bandwidth_deployment.txt b/examples/bandwidth/bandwidth_deployment.txt deleted file mode 100644 index 274919f983..0000000000 --- a/examples/bandwidth/bandwidth_deployment.txt +++ /dev/null @@ -1,3 +0,0 @@ -125 sensor 4000 -95 sensor 5000 -109 maestro 125 4000 95 5000 diff --git a/examples/bandwidth/bandwidth_deployment.xml b/examples/bandwidth/bandwidth_deployment.xml new file mode 100644 index 0000000000..abb89b6312 --- /dev/null +++ b/examples/bandwidth/bandwidth_deployment.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/examples/bandwidth/test_sg.in b/examples/bandwidth/test_sg.in index 81a0265c4e..b82ca1e6d7 100755 --- a/examples/bandwidth/test_sg.in +++ b/examples/bandwidth/test_sg.in @@ -1,5 +1,7 @@ #! @BASH@ -if test -x ./bandwidth_simulator ; then - exec ./bandwidth_simulator @srcdir@/../WAN_3.platform.txt @srcdir@/bandwidth_deployment.txt +if [ x@EXEEXT@ = x ] ; then + exenv="libtool --mode=execute valgrind" +else + exenv=wine fi -exit 77 +exec $exenv ./bandwidth_simulator@EXEEXT@ @top_srcdir@/examples/msg/small_platform.xml @srcdir@/bandwidth_deployment.xml $@ -- 2.20.1