Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add gras prop tests to the make check
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Nov 2007 12:27:19 +0000 (12:27 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Nov 2007 12:27:19 +0000 (12:27 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4976 48e7efb5-ca39-0410-a469-dd3cf9ba447f

configure
configure.ac
examples/gras/Makefile.am
examples/gras/Makefile.in
examples/gras/properties/Makefile.am [new file with mode: 0644]
examples/gras/properties/gras_prop_deployment.xml [deleted file]
examples/gras/properties/properties.c [moved from examples/gras/properties/gras_prop.c with 74% similarity]
examples/gras/properties/properties.xml [new file with mode: 0644]
examples/gras/properties/test_rl [new file with mode: 0755]
examples/gras/properties/test_sg_32 [new file with mode: 0755]
examples/gras/properties/test_sg_64 [new file with mode: 0755]

index 2264e96..f038506 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,7 +1,7 @@
 #! /bin/sh
 #! /bin/sh
-# From configure.ac Revision: 4915 .
+# From configure.ac Revision: 4930 .
 # Guess values for system-dependent variables and create Makefiles.
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for simgrid 3.3-cvs.
+# Generated by GNU Autoconf 2.61 for simgrid 3.3-svn.
 #
 # Report bugs to <simgrid-devel@lists.gforge.inria.fr>.
 #
 #
 # Report bugs to <simgrid-devel@lists.gforge.inria.fr>.
 #
@@ -731,8 +731,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='simgrid'
 PACKAGE_TARNAME='simgrid'
 # Identity of this package.
 PACKAGE_NAME='simgrid'
 PACKAGE_TARNAME='simgrid'
-PACKAGE_VERSION='3.3-cvs'
-PACKAGE_STRING='simgrid 3.3-cvs'
+PACKAGE_VERSION='3.3-svn'
+PACKAGE_STRING='simgrid 3.3-svn'
 PACKAGE_BUGREPORT='simgrid-devel@lists.gforge.inria.fr'
 
 ac_unique_file="include/gras.h"
 PACKAGE_BUGREPORT='simgrid-devel@lists.gforge.inria.fr'
 
 ac_unique_file="include/gras.h"
@@ -1447,7 +1447,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures simgrid 3.3-cvs to adapt to many kinds of systems.
+\`configure' configures simgrid 3.3-svn to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1518,7 +1518,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of simgrid 3.3-cvs:";;
+     short | recursive ) echo "Configuration of simgrid 3.3-svn:";;
    esac
   cat <<\_ACEOF
 
    esac
   cat <<\_ACEOF
 
@@ -1636,7 +1636,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-simgrid configure 3.3-cvs
+simgrid configure 3.3-svn
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1650,7 +1650,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by simgrid $as_me 3.3-cvs, which was
+It was created by simgrid $as_me 3.3-svn, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2702,7 +2702,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='simgrid'
 
 # Define the identity of the package.
  PACKAGE='simgrid'
- VERSION='3.3-cvs'
+ VERSION='3.3-svn'
 
 
 cat >>confdefs.h <<_ACEOF
 
 
 cat >>confdefs.h <<_ACEOF
@@ -19445,6 +19445,15 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
 
 
 
 
 
 
+
+###############
+## SVN version check
+##
+if test -e .svn ; then
+  VERSION="$VERSION-r`svnversion`"
+  PACKAGE_VERSION="$PACKAGE_VERSION-r`svnversion`"
+  PACKAGE_STRING="PACKAGE_STRING r`svnversion`"
+fi
 
 ###############
 ## System checks
 
 ###############
 ## System checks
@@ -26963,7 +26972,7 @@ fi
 
 
 if test x$MD5SUM != xno ; then
 
 
 if test x$MD5SUM != xno ; then
-  build_version=`find -name '*.ch' |grep -v src/ucontext_stack.h | grep -v src/gras_config.h |\
+  build_version=`find -name '*.ch' |grep -v src/ucontext_stack.h | grep -v src/gras_config.h |\
                  xargs cat| $MD5SUM | sed 's/ .*$//'`
 else
   build_version="no_md5sum_binary"
                  xargs cat| $MD5SUM | sed 's/ .*$//'`
 else
   build_version="no_md5sum_binary"
@@ -27025,7 +27034,7 @@ ac_config_files="$ac_config_files doc/Makefile doc/Doxyfile"
 ac_config_files="$ac_config_files examples/java/Makefile examples/java/basic/Makefile examples/java/comm_time/Makefile examples/java/suspend/Makefile examples/java/ping_pong/Makefile"
 
 
 ac_config_files="$ac_config_files examples/java/Makefile examples/java/basic/Makefile examples/java/comm_time/Makefile examples/java/suspend/Makefile examples/java/ping_pong/Makefile"
 
 
-ac_config_files="$ac_config_files examples/Makefile examples/msg/Makefile examples/simdag/Makefile examples/gras/Makefile examples/gras/ping/Makefile examples/gras/rpc/Makefile examples/gras/spawn/Makefile examples/gras/synchro/Makefile examples/gras/timer/Makefile examples/gras/chrono/Makefile examples/gras/mutual_exclusion/simple_token/Makefile examples/gras/mmrpc/Makefile examples/gras/pmm/Makefile examples/gras/all2all/Makefile examples/amok/Makefile"
+ac_config_files="$ac_config_files examples/Makefile examples/msg/Makefile examples/simdag/Makefile examples/gras/Makefile examples/gras/ping/Makefile examples/gras/rpc/Makefile examples/gras/spawn/Makefile examples/gras/synchro/Makefile examples/gras/timer/Makefile examples/gras/properties/Makefile examples/gras/chrono/Makefile examples/gras/mutual_exclusion/simple_token/Makefile examples/gras/mmrpc/Makefile examples/gras/pmm/Makefile examples/gras/all2all/Makefile examples/amok/Makefile"
 
 
 ac_config_files="$ac_config_files src/smpi/smpicc src/smpi/smpirun"
 
 
 ac_config_files="$ac_config_files src/smpi/smpicc src/smpi/smpirun"
@@ -27534,7 +27543,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by simgrid $as_me 3.3-cvs, which was
+This file was extended by simgrid $as_me 3.3-svn, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -27587,7 +27596,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-simgrid config.status 3.3-cvs
+simgrid config.status 3.3-svn
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -27730,6 +27739,7 @@ do
     "examples/gras/spawn/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/spawn/Makefile" ;;
     "examples/gras/synchro/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/synchro/Makefile" ;;
     "examples/gras/timer/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/timer/Makefile" ;;
     "examples/gras/spawn/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/spawn/Makefile" ;;
     "examples/gras/synchro/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/synchro/Makefile" ;;
     "examples/gras/timer/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/timer/Makefile" ;;
+    "examples/gras/properties/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/properties/Makefile" ;;
     "examples/gras/chrono/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/chrono/Makefile" ;;
     "examples/gras/mutual_exclusion/simple_token/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/mutual_exclusion/simple_token/Makefile" ;;
     "examples/gras/mmrpc/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/mmrpc/Makefile" ;;
     "examples/gras/chrono/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/chrono/Makefile" ;;
     "examples/gras/mutual_exclusion/simple_token/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/mutual_exclusion/simple_token/Makefile" ;;
     "examples/gras/mmrpc/Makefile") CONFIG_FILES="$CONFIG_FILES examples/gras/mmrpc/Makefile" ;;
index 0f22453..fad588c 100644 (file)
@@ -570,6 +570,7 @@ AC_CONFIG_FILES([
       examples/gras/spawn/Makefile
       examples/gras/synchro/Makefile
       examples/gras/timer/Makefile
       examples/gras/spawn/Makefile
       examples/gras/synchro/Makefile
       examples/gras/timer/Makefile
+      examples/gras/properties/Makefile
       examples/gras/chrono/Makefile
       examples/gras/mutual_exclusion/simple_token/Makefile
       examples/gras/mmrpc/Makefile
       examples/gras/chrono/Makefile
       examples/gras/mutual_exclusion/simple_token/Makefile
       examples/gras/mmrpc/Makefile
index 87a7c0c..b686017 100644 (file)
@@ -5,7 +5,7 @@
 # GNU LGPL (v2.1) licence.
 
 
 # GNU LGPL (v2.1) licence.
 
 
-SUBDIRS= ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro
+SUBDIRS= ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro properties
 # p2p
 
 include $(top_srcdir)/acmacro/dist-files.mk
 # p2p
 
 include $(top_srcdir)/acmacro/dist-files.mk
index 9c7e589..938ec15 100644 (file)
@@ -210,7 +210,7 @@ target_os = @target_os@
 target_vendor = @target_vendor@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 target_vendor = @target_vendor@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro
+SUBDIRS = ping rpc spawn timer chrono mutual_exclusion/simple_token mmrpc all2all pmm synchro properties
 all: all-recursive
 
 .SUFFIXES:
 all: all-recursive
 
 .SUFFIXES:
diff --git a/examples/gras/properties/Makefile.am b/examples/gras/properties/Makefile.am
new file mode 100644 (file)
index 0000000..bd4d471
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (c) 2004-2007. The SimGrid team. All right reserved.
+
+# This file is part of the SimGrid project. This is free software:
+# You can redistribute and/or modify it under the terms of the
+# GNU LGPL (v2.1) licence.
+
+
+INCLUDES= -I$(top_srcdir)/include
+
+EXTRA_DIST=properties.xml properties.h
+include $(top_srcdir)/examples/gras/tests.mk
+
+# AUTOMAKE variable definition
+noinst_PROGRAMS=properties_slave properties_master properties_simulator
+
+properties_simulator_SOURCES=  _properties_simulator.c properties.c
+properties_simulator_LDADD=    $(top_builddir)/src/libsimgrid.la
+
+properties_slave_SOURCES=      _properties_slave.c    properties.c
+properties_slave_LDADD=        $(top_builddir)/src/libgras.la
+
+properties_master_SOURCES=     _properties_master.c    properties.c
+properties_master_LDADD=       $(top_builddir)/src/libgras.la
+
+# Take care of generatated sources
+NAME=properties
+PROCESSES= slave master
+include $(top_srcdir)/examples/temps-gras-stub.mk
+
+# Cruft
+include $(top_srcdir)/acmacro/dist-files.mk
diff --git a/examples/gras/properties/gras_prop_deployment.xml b/examples/gras/properties/gras_prop_deployment.xml
deleted file mode 100644 (file)
index fb30f00..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "surfxml.dtd">
-<platform version="2">
-  <process host="C1-01" function="server">
-    <prop id="someprop" value="somevalue"/>
-  </process>
-  <process host="C1-00" function="client">
-    <prop id="otherprop" value="othervalue"/>
-  </process>
-</platform>
similarity index 74%
rename from examples/gras/properties/gras_prop.c
rename to examples/gras/properties/properties.c
index 6ad2d41..2315240 100644 (file)
@@ -4,8 +4,11 @@
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test,"Simple Property example");
 
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test,"Simple Property example");
 
+int master(int argc, char *argv[]);
+int slave(int argc, char *argv[]);
 
 
-int client(int argc, char *argv[]) {
+
+int slave(int argc, char *argv[]) {
   gras_init(&argc,argv);
 
   /* Get the properties */
   gras_init(&argc,argv);
 
   /* Get the properties */
@@ -19,36 +22,37 @@ int client(int argc, char *argv[]) {
   }
  
   /* Try to get a property that does not exist */
   }
  
   /* Try to get a property that does not exist */
-  char noexist[]="Nonexisent";
+  const char *noexist="Nonexisting";
   const char *value = gras_process_property_value(noexist);
   if ( value == NULL) 
     INFO1("Process property: %s is undefined", noexist);
   else
     INFO2("Process property: %s has value: %s", noexist, value);
  
   const char *value = gras_process_property_value(noexist);
   if ( value == NULL) 
     INFO1("Process property: %s is undefined", noexist);
   else
     INFO2("Process property: %s has value: %s", noexist, value);
  
-   /* Modify an existing property. First check it exists */\
+   /* Modify an existing property. First check it exists */
     INFO0("Trying to modify a process property");
     INFO0("Trying to modify a process property");
-    char exist[]="otherprop";
+    const char *exist="otherprop";
     value = gras_process_property_value(exist);
     value = gras_process_property_value(exist);
-    if ( value == NULL) 
+    if (value == NULL) 
       INFO1("\tProperty: %s is undefined", exist);
     else {
       INFO2("\tProperty: %s old value: %s", exist, value);
       INFO1("\tProperty: %s is undefined", exist);
     else {
       INFO2("\tProperty: %s old value: %s", exist, value);
-      xbt_dict_set(props, exist, strdup("newValue"), free);  
+      xbt_dict_set(props, exist, xbt_strdup("newValue"), free);  
     }
  
     /* Test if we have changed the value */
     value = gras_process_property_value(exist);
     }
  
     /* Test if we have changed the value */
     value = gras_process_property_value(exist);
-    if ( value == NULL) 
+    if (value == NULL) 
       INFO1("\tProperty: %s is undefined", exist);
     else
       INFO2("\tProperty: %s new value: %s", exist, value);
       INFO1("\tProperty: %s is undefined", exist);
     else
       INFO2("\tProperty: %s new value: %s", exist, value);
+
+  gras_os_sleep(1);
   gras_exit();
   return 0;
 }
 
   gras_exit();
   return 0;
 }
 
-int server(int argc, char *argv[]) {
+int master(int argc, char *argv[]) {
   gras_init(&argc,argv);
 
   /* Get the properties */
   gras_init(&argc,argv);
 
   /* Get the properties */
@@ -62,13 +66,11 @@ int server(int argc, char *argv[]) {
   }
  
   /* Try to get a property that does not exist */
   }
  
   /* Try to get a property that does not exist */
-  char noexist[]="Nonexisent";
+  const char *noexist="Nonexisting";
   const char *value = gras_os_host_property_value(noexist);
   const char *value = gras_os_host_property_value(noexist);
-  if ( value == NULL) 
-    INFO1("Host property: %s is undefined", noexist);
-  else
-    INFO2("Host property: %s has value: %s", noexist, value);
+  xbt_assert2(value == NULL, "Host property: %s has value: %s", noexist, value);
   
   
+  gras_os_sleep(1);
   gras_exit();
   return 0;
 }
   gras_exit();
   return 0;
 }
diff --git a/examples/gras/properties/properties.xml b/examples/gras/properties/properties.xml
new file mode 100644 (file)
index 0000000..65e37b3
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version='1.0'?>
+<!DOCTYPE platform SYSTEM "surfxml.dtd">
+<platform version="2">
+  <!-- The master process (with some arguments) -->
+  <process host="C1-01" function="master">
+     <argument value="1"/>       <!-- Number of tasks -->
+     <argument value="50000000"/>  <!-- Computation size of tasks -->
+     <argument value="1000000"/>   <!-- Communication size of tasks -->
+     <argument value="C1-00"/>  <!-- First slave -->
+  </process>
+  <!-- The slave process (with no argument) -->
+  <process host="C1-00" function="slave">
+    <prop id="SomeProp" value="SomeValue"/>
+  </process>
+</platform>
diff --git a/examples/gras/properties/test_rl b/examples/gras/properties/test_rl
new file mode 100755 (executable)
index 0000000..3abcda8
--- /dev/null
@@ -0,0 +1,6 @@
+
+! timeout 20
+& $SG_TEST_ENV ./properties_master$EXEEXT 4002 --log=root.fmt=%P:%t%e%m%n $ARGS
+
+! timeout 20
+& $SG_TEST_ENV ./properties_slave$EXEEXT 127.0.0.1 4002 --log=root.fmt=%P:%t%e%m%n $ARGS
diff --git a/examples/gras/properties/test_sg_32 b/examples/gras/properties/test_sg_32
new file mode 100755 (executable)
index 0000000..4af7ca9
--- /dev/null
@@ -0,0 +1,12 @@
+p Runs the 'properties' test within the simulator (simulation times valid for 32bits architectures)
+
+$ $SG_TEST_EXENV ./properties_simulator${EXEEXT:=} ${srcdir:=.}/../../platforms/prop.xml ${srcdir:=.}/properties.xml
+> [C1-01:master:(1) 0.000000] [test/INFO] Host property: mem has value: 4
+> [C1-01:master:(1) 0.000000] [test/INFO] Host property: Hdd has value: 180
+> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: SomeProp has value: SomeValue
+> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: Nonexisting is undefined
+> [C1-00:slave:(2) 0.000000] [test/INFO] Trying to modify a process property
+> [C1-00:slave:(2) 0.000000] [test/INFO]  Property: otherprop is undefined
+> [C1-00:slave:(2) 0.000000] [test/INFO]  Property: otherprop is undefined
+> [C1-01:master:(1) 1.000000] [gras/INFO] Exiting GRAS
+> [C1-00:slave:(2) 1.000000] [gras/INFO] Exiting GRAS
diff --git a/examples/gras/properties/test_sg_64 b/examples/gras/properties/test_sg_64
new file mode 100755 (executable)
index 0000000..4af7ca9
--- /dev/null
@@ -0,0 +1,12 @@
+p Runs the 'properties' test within the simulator (simulation times valid for 32bits architectures)
+
+$ $SG_TEST_EXENV ./properties_simulator${EXEEXT:=} ${srcdir:=.}/../../platforms/prop.xml ${srcdir:=.}/properties.xml
+> [C1-01:master:(1) 0.000000] [test/INFO] Host property: mem has value: 4
+> [C1-01:master:(1) 0.000000] [test/INFO] Host property: Hdd has value: 180
+> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: SomeProp has value: SomeValue
+> [C1-00:slave:(2) 0.000000] [test/INFO] Process property: Nonexisting is undefined
+> [C1-00:slave:(2) 0.000000] [test/INFO] Trying to modify a process property
+> [C1-00:slave:(2) 0.000000] [test/INFO]  Property: otherprop is undefined
+> [C1-00:slave:(2) 0.000000] [test/INFO]  Property: otherprop is undefined
+> [C1-01:master:(1) 1.000000] [gras/INFO] Exiting GRAS
+> [C1-00:slave:(2) 1.000000] [gras/INFO] Exiting GRAS