Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Hacking my previous hack to bypass surfxml.
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 16 Aug 2007 12:08:32 +0000 (12:08 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 16 Aug 2007 12:08:32 +0000 (12:08 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4094 48e7efb5-ca39-0410-a469-dd3cf9ba447f

examples/msg/Makefile.am
examples/msg/Makefile.in
examples/msg/masterslave/masterslave_bypass.c
examples/msg/masterslave/masterslave_bypass.tesh

index ad5163a..3cf664f 100644 (file)
@@ -24,8 +24,8 @@ TESTS = sendrecv/sendrecv_KCCFLN05.tesh \
         sendrecv/sendrecv_Reno.tesh \
         suspend/suspend.tesh \
        masterslave/masterslave.tesh \
-       masterslave/masterslave_forwarder.tesh
-        #masterslave/masterslave_bypass.tesh
+       masterslave/masterslave_forwarder.tesh \
+        masterslave/masterslave_bypass.tesh
 
 if HAVE_SDP
   BROKEN_TESTS = sendrecv/sendrecv_SDP.tesh
@@ -39,8 +39,8 @@ CLEANFILES = sendrecv/*~ \
              suspend/suspend \
              masterslave/*~ \
              masterslave/masterslave \
-             masterslave/masterslave_forwarder 
-             #masterslave/masterslave_bypass
+             masterslave/masterslave_forwarder \
+             masterslave/masterslave_bypass
 
 if HAVE_GTNETS
              CLEANFILES += gtnets/gtnets 
@@ -53,8 +53,8 @@ bin_PROGRAMS = sendrecv/sendrecv \
                suspend/suspend \
                masterslave/masterslave \
                masterslave/masterslave_forwarder \
-               masterslave/masterslave_failure
-               #masterslave/masterslave_bypass
+               masterslave/masterslave_failure \
+               masterslave/masterslave_bypass
 
 if HAVE_GTNETS
                bin_PROGRAMS += gtnets/gtnets 
@@ -83,8 +83,8 @@ masterslave_masterslave_failure_SOURCES = masterslave/masterslave_failure.c
 masterslave_masterslave_failure_LDADD   = $(top_builddir)/src/libsimgrid.la
 
 # bypass the surf xml parser
-#masterslave_masterslave_bypass_SOURCES = masterslave/masterslave_bypass.c
-#masterslave_masterslave_bypass_LDADD   = $(top_builddir)/src/libsimgrid.la
+masterslave_masterslave_bypass_SOURCES = masterslave/masterslave_bypass.c
+masterslave_masterslave_bypass_LDADD   = $(top_builddir)/src/libsimgrid.la
 
 # verify if the GTNETS feature is working
 if HAVE_GTNETS
index ffd27d1..1dee639 100644 (file)
@@ -41,7 +41,9 @@ target_triplet = @target@
 @HAVE_GTNETS_TRUE@am__append_1 = gtnets/gtnets 
 bin_PROGRAMS = sendrecv/sendrecv$(EXEEXT) suspend/suspend$(EXEEXT) \
        masterslave/masterslave$(EXEEXT) \
-       masterslave/masterslave_forwarder$(EXEEXT) $(am__EXEEXT_1)
+       masterslave/masterslave_forwarder$(EXEEXT) \
+       masterslave/masterslave_failure$(EXEEXT) \
+       masterslave/masterslave_bypass$(EXEEXT) $(am__EXEEXT_1)
 @HAVE_GTNETS_TRUE@am__append_2 = gtnets/gtnets 
 @HAVE_GTNETS_FALSE@am__append_3 = gtnets/gtnets.c
 DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@@ -76,6 +78,18 @@ masterslave_masterslave_OBJECTS =  \
        $(am_masterslave_masterslave_OBJECTS)
 masterslave_masterslave_DEPENDENCIES =  \
        $(top_builddir)/src/libsimgrid.la
+am_masterslave_masterslave_bypass_OBJECTS =  \
+       masterslave_bypass.$(OBJEXT)
+masterslave_masterslave_bypass_OBJECTS =  \
+       $(am_masterslave_masterslave_bypass_OBJECTS)
+masterslave_masterslave_bypass_DEPENDENCIES =  \
+       $(top_builddir)/src/libsimgrid.la
+am_masterslave_masterslave_failure_OBJECTS =  \
+       masterslave_failure.$(OBJEXT)
+masterslave_masterslave_failure_OBJECTS =  \
+       $(am_masterslave_masterslave_failure_OBJECTS)
+masterslave_masterslave_failure_DEPENDENCIES =  \
+       $(top_builddir)/src/libsimgrid.la
 am_masterslave_masterslave_forwarder_OBJECTS =  \
        masterslave_forwarder.$(OBJEXT)
 masterslave_masterslave_forwarder_OBJECTS =  \
@@ -101,10 +115,14 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
 SOURCES = $(gtnets_gtnets_SOURCES) $(masterslave_masterslave_SOURCES) \
+       $(masterslave_masterslave_bypass_SOURCES) \
+       $(masterslave_masterslave_failure_SOURCES) \
        $(masterslave_masterslave_forwarder_SOURCES) \
        $(sendrecv_sendrecv_SOURCES) $(suspend_suspend_SOURCES)
 DIST_SOURCES = $(am__gtnets_gtnets_SOURCES_DIST) \
        $(masterslave_masterslave_SOURCES) \
+       $(masterslave_masterslave_bypass_SOURCES) \
+       $(masterslave_masterslave_failure_SOURCES) \
        $(masterslave_masterslave_forwarder_SOURCES) \
        $(sendrecv_sendrecv_SOURCES) $(suspend_suspend_SOURCES)
 ETAGS = etags
@@ -262,12 +280,14 @@ TESTS = sendrecv/sendrecv_KCCFLN05.tesh \
         sendrecv/sendrecv_Reno.tesh \
         suspend/suspend.tesh \
        masterslave/masterslave.tesh \
-       masterslave/masterslave_forwarder.tesh
+       masterslave/masterslave_forwarder.tesh \
+        masterslave/masterslave_bypass.tesh
 
 @HAVE_SDP_TRUE@BROKEN_TESTS = sendrecv/sendrecv_SDP.tesh
 CLEANFILES = sendrecv/*~ sendrecv/sendrecv suspend/*~ suspend/suspend \
        masterslave/*~ masterslave/masterslave \
-       masterslave/masterslave_forwarder $(am__append_1)
+       masterslave/masterslave_forwarder \
+       masterslave/masterslave_bypass $(am__append_1)
 
 # sendrecv simple example
 sendrecv_sendrecv_SOURCES = sendrecv/sendrecv.c
@@ -277,17 +297,21 @@ sendrecv_sendrecv_LDADD = $(top_builddir)/src/libsimgrid.la
 suspend_suspend_SOURCES = suspend/suspend.c
 suspend_suspend_LDADD = $(top_builddir)/src/libsimgrid.la
 
-# master/slave application example using a forwarder module
+# master/slave application example
 masterslave_masterslave_SOURCES = masterslave/masterslave.c
 masterslave_masterslave_LDADD = $(top_builddir)/src/libsimgrid.la
 
-# verify the communication time of a simple simulation
+# master/slave application example using a forwarder module
 masterslave_masterslave_forwarder_SOURCES = masterslave/masterslave_forwarder.c
 masterslave_masterslave_forwarder_LDADD = $(top_builddir)/src/libsimgrid.la
 
+# master/slave application example with failures
+masterslave_masterslave_failure_SOURCES = masterslave/masterslave_failure.c
+masterslave_masterslave_failure_LDADD = $(top_builddir)/src/libsimgrid.la
+
 # bypass the surf xml parser
-#masterslave_masterslave_bypass_SOURCES = masterslave/masterslave_bypass.c
-#masterslave_masterslave_bypass_LDADD   = $(top_builddir)/src/libsimgrid.la
+masterslave_masterslave_bypass_SOURCES = masterslave/masterslave_bypass.c
+masterslave_masterslave_bypass_LDADD = $(top_builddir)/src/libsimgrid.la
 
 # verify if the GTNETS feature is working
 @HAVE_GTNETS_TRUE@gtnets_gtnets_SOURCES = gtnets/gtnets.c
@@ -365,6 +389,12 @@ masterslave/$(am__dirstamp):
 masterslave/masterslave$(EXEEXT): $(masterslave_masterslave_OBJECTS) $(masterslave_masterslave_DEPENDENCIES) masterslave/$(am__dirstamp)
        @rm -f masterslave/masterslave$(EXEEXT)
        $(LINK) $(masterslave_masterslave_OBJECTS) $(masterslave_masterslave_LDADD) $(LIBS)
+masterslave/masterslave_bypass$(EXEEXT): $(masterslave_masterslave_bypass_OBJECTS) $(masterslave_masterslave_bypass_DEPENDENCIES) masterslave/$(am__dirstamp)
+       @rm -f masterslave/masterslave_bypass$(EXEEXT)
+       $(LINK) $(masterslave_masterslave_bypass_OBJECTS) $(masterslave_masterslave_bypass_LDADD) $(LIBS)
+masterslave/masterslave_failure$(EXEEXT): $(masterslave_masterslave_failure_OBJECTS) $(masterslave_masterslave_failure_DEPENDENCIES) masterslave/$(am__dirstamp)
+       @rm -f masterslave/masterslave_failure$(EXEEXT)
+       $(LINK) $(masterslave_masterslave_failure_OBJECTS) $(masterslave_masterslave_failure_LDADD) $(LIBS)
 masterslave/masterslave_forwarder$(EXEEXT): $(masterslave_masterslave_forwarder_OBJECTS) $(masterslave_masterslave_forwarder_DEPENDENCIES) masterslave/$(am__dirstamp)
        @rm -f masterslave/masterslave_forwarder$(EXEEXT)
        $(LINK) $(masterslave_masterslave_forwarder_OBJECTS) $(masterslave_masterslave_forwarder_LDADD) $(LIBS)
@@ -389,6 +419,8 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gtnets.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masterslave.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masterslave_bypass.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masterslave_failure.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/masterslave_forwarder.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendrecv.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/suspend.Po@am__quote@
@@ -442,6 +474,34 @@ masterslave.obj: masterslave/masterslave.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o masterslave.obj `if test -f 'masterslave/masterslave.c'; then $(CYGPATH_W) 'masterslave/masterslave.c'; else $(CYGPATH_W) '$(srcdir)/masterslave/masterslave.c'; fi`
 
+masterslave_bypass.o: masterslave/masterslave_bypass.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT masterslave_bypass.o -MD -MP -MF $(DEPDIR)/masterslave_bypass.Tpo -c -o masterslave_bypass.o `test -f 'masterslave/masterslave_bypass.c' || echo '$(srcdir)/'`masterslave/masterslave_bypass.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/masterslave_bypass.Tpo $(DEPDIR)/masterslave_bypass.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='masterslave/masterslave_bypass.c' object='masterslave_bypass.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o masterslave_bypass.o `test -f 'masterslave/masterslave_bypass.c' || echo '$(srcdir)/'`masterslave/masterslave_bypass.c
+
+masterslave_bypass.obj: masterslave/masterslave_bypass.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT masterslave_bypass.obj -MD -MP -MF $(DEPDIR)/masterslave_bypass.Tpo -c -o masterslave_bypass.obj `if test -f 'masterslave/masterslave_bypass.c'; then $(CYGPATH_W) 'masterslave/masterslave_bypass.c'; else $(CYGPATH_W) '$(srcdir)/masterslave/masterslave_bypass.c'; fi`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/masterslave_bypass.Tpo $(DEPDIR)/masterslave_bypass.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='masterslave/masterslave_bypass.c' object='masterslave_bypass.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o masterslave_bypass.obj `if test -f 'masterslave/masterslave_bypass.c'; then $(CYGPATH_W) 'masterslave/masterslave_bypass.c'; else $(CYGPATH_W) '$(srcdir)/masterslave/masterslave_bypass.c'; fi`
+
+masterslave_failure.o: masterslave/masterslave_failure.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT masterslave_failure.o -MD -MP -MF $(DEPDIR)/masterslave_failure.Tpo -c -o masterslave_failure.o `test -f 'masterslave/masterslave_failure.c' || echo '$(srcdir)/'`masterslave/masterslave_failure.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/masterslave_failure.Tpo $(DEPDIR)/masterslave_failure.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='masterslave/masterslave_failure.c' object='masterslave_failure.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o masterslave_failure.o `test -f 'masterslave/masterslave_failure.c' || echo '$(srcdir)/'`masterslave/masterslave_failure.c
+
+masterslave_failure.obj: masterslave/masterslave_failure.c
+@am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT masterslave_failure.obj -MD -MP -MF $(DEPDIR)/masterslave_failure.Tpo -c -o masterslave_failure.obj `if test -f 'masterslave/masterslave_failure.c'; then $(CYGPATH_W) 'masterslave/masterslave_failure.c'; else $(CYGPATH_W) '$(srcdir)/masterslave/masterslave_failure.c'; fi`
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/masterslave_failure.Tpo $(DEPDIR)/masterslave_failure.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='masterslave/masterslave_failure.c' object='masterslave_failure.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o masterslave_failure.obj `if test -f 'masterslave/masterslave_failure.c'; then $(CYGPATH_W) 'masterslave/masterslave_failure.c'; else $(CYGPATH_W) '$(srcdir)/masterslave/masterslave_failure.c'; fi`
+
 masterslave_forwarder.o: masterslave/masterslave_forwarder.c
 @am__fastdepCC_TRUE@   $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT masterslave_forwarder.o -MD -MP -MF $(DEPDIR)/masterslave_forwarder.Tpo -c -o masterslave_forwarder.o `test -f 'masterslave/masterslave_forwarder.c' || echo '$(srcdir)/'`masterslave/masterslave_forwarder.c
 @am__fastdepCC_TRUE@   mv -f $(DEPDIR)/masterslave_forwarder.Tpo $(DEPDIR)/masterslave_forwarder.Po
@@ -748,9 +808,6 @@ uninstall-am: uninstall-binPROGRAMS
        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
        tags uninstall uninstall-am uninstall-binPROGRAMS
 
-        #masterslave/masterslave_bypass.tesh
-             #masterslave/masterslave_bypass
-               #masterslave/masterslave_bypass
 
 dist-files:
        @for n in $(DISTFILES) ; do echo $(SRCFILE)$$n; done
index f440db9..d881c4c 100644 (file)
 XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,"Messages specific for this msg example");
 #define FINALIZE ((void*)221297) /* a magic number to tell people to stop working */
 
+#define SURFXML_BUFFER_SET(key,val) do { \
+  AX_surfxml_##key=AX_ptr; \
+  strcpy(A_surfxml_##key,val); \
+  AX_ptr+=strlen(val)+1; } while(0)
+
+#define SURFXML_BUFFER_RESET() do { \
+  AX_ptr = 0; \
+  memset(surfxml_bufferstack,0,surfxml_bufferstack_size); } while(0)
+     
+
 static int surf_parse_bypass(void)
 {
+  static int AX_ptr;
+  static int surfxml_bufferstack_size = 2048;
 
   /* allocating memory to the buffer, I think 2MB should be enough */
-  surfxml_buffer = xbt_new0(char, 2048);
+  surfxml_bufferstack = xbt_new0(char, surfxml_bufferstack_size);
   
   /* <platform_description> */
-  strcpy(A_surfxml_platform_description_version, "1");
-  STag_surfxml_platform_description();
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(platform_description_version,"1");
 
+  STag_surfxml_platform_description();
 
-/*   <cpu name="Cpu A" power="100000000.00" availability_file="trace_A.txt"/> */
-  strcpy(A_surfxml_cpu_name,"Cpu A");
-  strcpy(A_surfxml_cpu_power, "100000000.00");
-  strcpy(A_surfxml_cpu_availability, "1.0");
-  strcpy(A_surfxml_cpu_availability_file, "");
+/*   <cpu name="Cpu A" power="100000000.00"/> */
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(cpu_name,"Cpu A");
+  SURFXML_BUFFER_SET(cpu_power, "100000000.00");
+  SURFXML_BUFFER_SET(cpu_availability, "1.0");
+  SURFXML_BUFFER_SET(cpu_availability_file, "");
   A_surfxml_cpu_state = A_surfxml_cpu_state_ON;
-  //bypassing the parser file
-  AX_surfxml_cpu_state_file = 0;
-  strcpy(A_surfxml_cpu_interference_send, "1.0");
-  strcpy(A_surfxml_cpu_interference_recv, "1.0");
-  strcpy(A_surfxml_cpu_interference_send_recv, "1.0");
-  strcpy(A_surfxml_cpu_max_outgoing_rate, "-1.0");
+  SURFXML_BUFFER_SET(cpu_state_file, "");
+  SURFXML_BUFFER_SET(cpu_interference_send, "1.0");
+  SURFXML_BUFFER_SET(cpu_interference_recv, "1.0");
+  SURFXML_BUFFER_SET(cpu_interference_send_recv, "1.0");
+  SURFXML_BUFFER_SET(cpu_max_outgoing_rate, "-1.0");
 
   STag_surfxml_cpu();
   ETag_surfxml_cpu();
 
-/*   <cpu name="Cpu B" power="100000000.00" availability_file="trace_B.txt"/> */
-  strcpy(A_surfxml_cpu_name, "Cpu B");
-  strcpy(A_surfxml_cpu_power, "100000000.00");
-  strcpy(A_surfxml_cpu_availability, "1.0");
-  strcpy(A_surfxml_cpu_availability_file, "");
+/*   <cpu name="Cpu B" power="100000000.00"/> */
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(cpu_name, "Cpu B");
+  SURFXML_BUFFER_SET(cpu_power, "100000000.00");
+  SURFXML_BUFFER_SET(cpu_availability, "1.0");
+  SURFXML_BUFFER_SET(cpu_availability_file, "");
   A_surfxml_cpu_state = A_surfxml_cpu_state_ON;
-  //bypassing the parser file
-  AX_surfxml_cpu_state_file = 0;
-  strcpy(A_surfxml_cpu_interference_send, "1.0");
-  strcpy(A_surfxml_cpu_interference_recv, "1.0");
-  strcpy(A_surfxml_cpu_interference_send_recv, "1.0");
-  strcpy(A_surfxml_cpu_max_outgoing_rate, "-1.0");
+  SURFXML_BUFFER_SET(cpu_state_file, "");
+  SURFXML_BUFFER_SET(cpu_interference_send, "1.0");
+  SURFXML_BUFFER_SET(cpu_interference_recv, "1.0");
+  SURFXML_BUFFER_SET(cpu_interference_send_recv, "1.0");
+  SURFXML_BUFFER_SET(cpu_max_outgoing_rate, "-1.0");
 
   STag_surfxml_cpu();
   ETag_surfxml_cpu();
 
 /*   <network_link name="LinkA" bandwidth="10000000.0" latency="0.2"/> */
-  strcpy(A_surfxml_network_link_name, "LinkA");
-  strcpy(A_surfxml_network_link_bandwidth, "10000000.0");
-  AX_surfxml_network_link_bandwidth_file = 0;
-  strcpy(A_surfxml_network_link_latency, "0.2");
-  AX_surfxml_network_link_latency_file = 0;
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(network_link_name, "LinkA");
+  SURFXML_BUFFER_SET(network_link_bandwidth, "10000000.0");
+  SURFXML_BUFFER_SET(network_link_bandwidth_file, "");
+  SURFXML_BUFFER_SET(network_link_latency, "0.2");
+  SURFXML_BUFFER_SET(network_link_latency_file, "");
   A_surfxml_network_link_state = A_surfxml_network_link_state_ON;
-  AX_surfxml_network_link_state_file = 0;
+  SURFXML_BUFFER_SET(network_link_state_file, "");
   A_surfxml_network_link_sharing_policy = A_surfxml_network_link_sharing_policy_SHARED;
   STag_surfxml_network_link();
   ETag_surfxml_network_link();
 
 /*   <route src="Cpu A" dst="Cpu B"><route_element name="LinkA"/></route> */
-  strcpy(A_surfxml_route_src, "Cpu A");
-  strcpy(A_surfxml_route_dst, "Cpu B");
-  strcpy(A_surfxml_route_impact_on_src, "0.0");
-  strcpy(A_surfxml_route_impact_on_dst, "0.0");
-  strcpy(A_surfxml_route_impact_on_src_with_other_recv, "0.0");
-  strcpy(A_surfxml_route_impact_on_dst_with_other_send, "0.0");
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(route_src, "Cpu A");
+  SURFXML_BUFFER_SET(route_dst, "Cpu B");
+  SURFXML_BUFFER_SET(route_impact_on_src, "0.0");
+  SURFXML_BUFFER_SET(route_impact_on_dst, "0.0");
+  SURFXML_BUFFER_SET(route_impact_on_src_with_other_recv, "0.0");
+  SURFXML_BUFFER_SET(route_impact_on_dst_with_other_send, "0.0");
 
   STag_surfxml_route();
 
-  strcpy(A_surfxml_route_element_name, "LinkA");
+  SURFXML_BUFFER_SET(route_element_name, "LinkA");
   STag_surfxml_route_element();
   ETag_surfxml_route_element();
 
   ETag_surfxml_route();
 
 /*   <route src="Cpu B" dst="Cpu A"><route_element name="LinkA"/></route> */
-  strcpy(A_surfxml_route_src, "Cpu B");
-  strcpy(A_surfxml_route_dst, "Cpu A");
-  strcpy(A_surfxml_route_impact_on_src, "0.0");
-  strcpy(A_surfxml_route_impact_on_dst, "0.0");
-  strcpy(A_surfxml_route_impact_on_src_with_other_recv, "0.0");
-  strcpy(A_surfxml_route_impact_on_dst_with_other_send, "0.0");
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(route_src, "Cpu B");
+  SURFXML_BUFFER_SET(route_dst, "Cpu A");
+  SURFXML_BUFFER_SET(route_impact_on_src, "0.0");
+  SURFXML_BUFFER_SET(route_impact_on_dst, "0.0");
+  SURFXML_BUFFER_SET(route_impact_on_src_with_other_recv, "0.0");
+  SURFXML_BUFFER_SET(route_impact_on_dst_with_other_send, "0.0");
 
   STag_surfxml_route();
 
-  strcpy(A_surfxml_route_element_name, "LinkA");
+  SURFXML_BUFFER_SET(route_element_name, "LinkA");
   STag_surfxml_route_element();
   ETag_surfxml_route_element();
 
   ETag_surfxml_route();
 
 /*   <process host="Cpu A" function="master"> */
-  strcpy(A_surfxml_process_host, "Cpu A");
-  strcpy(A_surfxml_process_function, "master");
-  strcpy(A_surfxml_process_start_time, "-1.0");
-  strcpy(A_surfxml_process_kill_time, "-1.0");
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(process_host, "Cpu A");
+  SURFXML_BUFFER_SET(process_function, "master");
+  SURFXML_BUFFER_SET(process_start_time, "-1.0");
+  SURFXML_BUFFER_SET(process_kill_time, "-1.0");
   STag_surfxml_process();
 
 /*      <argument value="20"/> */
-  strcpy(A_surfxml_argument_value, "20");
+  SURFXML_BUFFER_SET(argument_value, "20");
   STag_surfxml_argument();
   ETag_surfxml_argument();
 
 /*      <argument value="5000000"/> */
-  strcpy(A_surfxml_argument_value, "5000000");
+  SURFXML_BUFFER_SET(argument_value, "5000000");
   STag_surfxml_argument();
   ETag_surfxml_argument();
 
 /*      <argument value="100000"/> */
-  strcpy(A_surfxml_argument_value, "100000");
+  SURFXML_BUFFER_SET(argument_value, "100000");
   STag_surfxml_argument();
   ETag_surfxml_argument();
 
 /*      <argument value="Cpu B"/> */
-  strcpy(A_surfxml_argument_value, "Cpu B");
+  SURFXML_BUFFER_SET(argument_value, "Cpu B");
   STag_surfxml_argument();
   ETag_surfxml_argument();
 
@@ -133,16 +150,18 @@ static int surf_parse_bypass(void)
   ETag_surfxml_process();
 
 /*   <process host="Cpu B" function="slave"/> */
-  strcpy(A_surfxml_process_host, "Cpu B");
-  strcpy(A_surfxml_process_function, "slave");
-  strcpy(A_surfxml_process_start_time, "-1.0");
-  strcpy(A_surfxml_process_kill_time, "-1.0");
+  SURFXML_BUFFER_RESET();
+  SURFXML_BUFFER_SET(process_host, "Cpu B");
+  SURFXML_BUFFER_SET(process_function, "slave");
+  SURFXML_BUFFER_SET(process_start_time, "-1.0");
+  SURFXML_BUFFER_SET(process_kill_time, "-1.0");
   STag_surfxml_process();
   ETag_surfxml_process();
 
 /* </platform_description> */
   ETag_surfxml_platform_description();
 
+  free(surfxml_bufferstack);
   return 0;
 }
 
index fc58ce9..1604eed 100644 (file)
@@ -2,8 +2,8 @@
 p Testing the bypassing of the flexml parser
 
 
-$ $SG_TEST_EXENV master_slave/masterslaves_bypass
-> [0.000000] surf/surfxml_parse.c:188: [parse/WARNING] Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
+$ $SG_TEST_EXENV masterslave/masterslave_bypass
+> [0.000000] surf/surfxml_parse.c:193: [parse/WARNING] Bypassing the XML parser since surf_parse_open received a NULL pointer. If it is not what you want, go fix your code.
 > [Cpu A:master:(1) 0.000000] [msg_test/INFO] Got 1 slave(s) :
 > [Cpu A:master:(1) 0.000000] [msg_test/INFO]   Cpu B
 > [Cpu A:master:(1) 0.000000] [msg_test/INFO] Got 20 task to process :