Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revival of the bandwidth test to help me ensuring that the current hacking in the...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Jun 2005 22:15:51 +0000 (22:15 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 6 Jun 2005 22:15:51 +0000 (22:15 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1358 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/amok/Makefile.am
examples/bandwidth/Makefile.am
examples/bandwidth/bandwidth.c
examples/bandwidth/bandwidth_deployment.txt [deleted file]
examples/bandwidth/bandwidth_deployment.xml [new file with mode: 0644]
examples/bandwidth/test_sg.in

index 9f652b8..33bff8e 100644 (file)
@@ -1,3 +1,3 @@
-SUBDIRS= # bandwidth alnem saturate
+SUBDIRS= bandwidth # alnem saturate
 
 include $(top_srcdir)/acmacro/dist-files.mk
index 7c836b8..4a3d360 100644 (file)
@@ -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
index 9069985..db872ad 100644 (file)
@@ -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 (file)
index 274919f..0000000
+++ /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 (file)
index 0000000..abb89b6
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform_description SYSTEM "surfxml.dtd">
+<platform_description>
+  <process host="Tremblay" function="sensor">
+     <argument value="4000"/>       <!-- port number -->
+  </process>
+  <process host="Ginette" function="sensor">
+     <argument value="4000"/>       <!-- port number -->
+  </process>
+  <process host="Fafard" function="maestro">
+     <argument value="Tremblay"/>   <!-- server host -->
+     <argument value="4000"/>       <!-- port number -->
+     <argument value="Ginette"/>   <!-- server host -->
+     <argument value="4000"/>       <!-- port number -->
+  </process>
+</platform_description>
index 81a0265..b82ca1e 100755 (executable)
@@ -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 $@