Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 21 Apr 2011 12:55:00 +0000 (14:55 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 21 Apr 2011 12:55:00 +0000 (14:55 +0200)
14 files changed:
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/Modules/FindNS3.cmake
buildtools/Cmake/gras_config.h.in
buildtools/pipol/Experimental.sh
buildtools/pipol/Nightly_simgrid.sh
buildtools/pipol/deploy.sh
examples/msg/chord/chord.tesh
src/include/surf/surf.h
src/surf/network_ns3.c [new file with mode: 0644]
src/surf/ns3/ns3_interface.cc [new file with mode: 0644]
src/surf/ns3/ns3_interface.h [new file with mode: 0644]
src/surf/surf.c
src/surf/surf_private.h
src/surf/surf_routing.c

index 3371adb..db5d97f 100644 (file)
@@ -184,6 +184,11 @@ set(GTNETS_SRC
        src/surf/network_gtnets.c
 )
 
+set(NS3_SRC
+       src/surf/network_ns3.c
+       src/surf/ns3/ns3_interface.cc
+       )
+
 set(SURF_SRC 
        src/surf/surf_model.c
        src/surf/surf_action.c
@@ -478,6 +483,13 @@ if(HAVE_MC)
                )
 endif(HAVE_MC)
 
+if(HAVE_NS3)
+       set(simgrid_sources
+               ${simgrid_sources}
+               ${NS3_SRC}
+       )
+endif(HAVE_NS3)
+
 # WINDOWS
 if(WIN32)
        set(simgrid_sources
index 8906d1f..aca50fd 100644 (file)
@@ -59,6 +59,11 @@ if(HAVE_NS3_LIB AND HAVE_CORE_MODULE_H)
                if(NOT operation1)
                        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-L${HAVE_NS3_LIB} ")
                endif(NOT operation1)
+               
+               string(REGEX MATCH "-I${HAVE_CORE_MODULE_H} " operation1 "${CMAKE_C_FLAGS}")
+               if(NOT operation1)
+                       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-I${HAVE_CORE_MODULE_H} ")
+               endif(NOT operation1)
        
                SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-I${HAVE_CORE_MODULE_H} -L${HAVE_NS3_LIB} ")
        endif(NOT operation)            
index a39a90f..4777ae1 100644 (file)
 /* Indicates that we have GTNETS support */
 #cmakedefine HAVE_GTNETS @HAVE_GTNETS@
 
+/* Indicates that we have NS3 support */
+#cmakedefine HAVE_NS3 @HAVE_NS3@
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
 
index ced8ddd..25b44da 100644 (file)
@@ -35,50 +35,73 @@ if [ x$PIPOL_IMAGE == "xamd64-windows-server-2008-64bits.dd.gz" ] ; then
        ctest -D ExperimentalBuild
        ctest -D ExperimentalSubmit
 else
-
-       sh ./buildtools/pipol/install_gtnets.sh ./gtnets_install
-       SIMGRID_ROOT=`pwd`
-       export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SIMGRID_ROOT/gtnets_install/lib
        perl ./buildtools/pipol/cmake.pl
        perl ./buildtools/pipol/ruby.pl
        
-       #supernovae
-       cmake \
-       -Denable_lua=on \
-       -Denable_ruby=on \
-       -Denable_java=on \
-       -Denable_tracing=on \
-       -Denable_smpi=on \
-       -Denable_supernovae=on \
-       -Denable_compile_optimizations=on \
-       -Denable_compile_warnings=on \
-       -Denable_lib_static=off \
-       -Denable_model-checking=off \
-       -Denable_latency_bound_tracking=off \
-       -Denable_gtnets=off .
-       ctest -D ExperimentalStart
-       ctest -D ExperimentalConfigure
-       ctest -D ExperimentalBuild
-       ctest -D ExperimentalTest
-       ctest -D ExperimentalSubmit
-       make clean
        
-       #MC
-       cmake \
-       -Denable_latency_bound_tracking=on \
-       -Denable_gtnets=on \
-       -Dgtnets_path=./gtnets_install \
-       -Denable_coverage=on \
-       -Denable_model-checking=on \
-       -Denable_compile_optimizations=off \
-       -Denable_auto_install=on \
-       -DCMAKE_INSTALL_PREFIX=./simgrid_install \
-       -Denable_supernovae=off .
-       ctest -D ExperimentalStart
-       ctest -D ExperimentalConfigure
-       ctest -D ExperimentalBuild
-       ctest -D ExperimentalTest
-       ctest -D ExperimentalCoverage
-       ctest -D ExperimentalSubmit
-       make clean
-fi
\ No newline at end of file
+       if [ x$PIPOL_IMAGE == "xamd64_2010-linux-ubuntu-maverick.dd.gz" ] ; then
+               #mem-check
+               cmake \
+               -Denable_lua=off \
+               -Denable_tracing=off \
+               -Denable_smpi=off \
+               -Denable_supernovae=off \
+               -Denable_compile_optimizations=off \
+               -Denable_compile_warnings=on \
+               -Denable_lib_static=off \
+               -Denable_model-checking=off \
+               -Denable_latency_bound_tracking=off \
+               -Denable_gtnets=off \
+               -Denable_jedule=off \
+               -Denable_memcheck=on ./
+               ctest -D ExperimentalStart
+               ctest -D ExperimentalConfigure
+               ctest -D ExperimentalBuild
+               ctest -D ExperimentalMemCheck
+               ctest -D ExperimentalSubmit
+       else
+               sh ./buildtools/pipol/install_gtnets.sh ./gtnets_install
+               SIMGRID_ROOT=`pwd`
+               export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SIMGRID_ROOT/gtnets_install/lib
+
+               #supernovae
+               cmake \
+               -Denable_lua=on \
+               -Denable_ruby=on \
+               -Denable_java=on \
+               -Denable_tracing=on \
+               -Denable_smpi=on \
+               -Denable_supernovae=on \
+               -Denable_compile_optimizations=on \
+               -Denable_compile_warnings=on \
+               -Denable_lib_static=off \
+               -Denable_model-checking=off \
+               -Denable_latency_bound_tracking=off \
+               -Denable_gtnets=off .
+               ctest -D ExperimentalStart
+               ctest -D ExperimentalConfigure
+               ctest -D ExperimentalBuild
+               ctest -D ExperimentalTest
+               ctest -D ExperimentalSubmit
+               make clean
+               
+               #MC
+               cmake \
+               -Denable_latency_bound_tracking=on \
+               -Denable_gtnets=on \
+               -Dgtnets_path=./gtnets_install \
+               -Denable_coverage=on \
+               -Denable_model-checking=on \
+               -Denable_compile_optimizations=off \
+               -Denable_auto_install=on \
+               -DCMAKE_INSTALL_PREFIX=./simgrid_install \
+               -Denable_supernovae=off .
+               ctest -D ExperimentalStart
+               ctest -D ExperimentalConfigure
+               ctest -D ExperimentalBuild
+               ctest -D ExperimentalTest
+               ctest -D ExperimentalCoverage
+               ctest -D ExperimentalSubmit
+               make clean
+       fi
+fi
index ab54c64..e5b1bc6 100644 (file)
@@ -18,6 +18,9 @@
 #PIPOL esn i386_kvm-linux-debian-testing none 02:00 --user --silent
 #PIPOL esn amd64_kvm-linux-debian-testing none 02:00 --user --silent
 
+#PIPOL  esn x86_64_mac-mac-osx-server-snow-leopard.dd.gz none 02:00 --user --silent
+#PIPOL  esn x86_mac-mac-osx-server-snow-leopard.dd.gz none 02:00 --user --silent
+
 #PIPOL esn amd64-windows-server-2008-64bits.dd.gz none 02:00 --root
 
 if [ -e ./pipol ] ; then
index ab7080b..feb83b1 100644 (file)
@@ -10,7 +10,7 @@ ssh pipol pipol-sub esn i386-linux-ubuntu-lucid.dd.gz none 02:00 "~/Experimental
 ssh pipol pipol-sub esn amd64-linux-ubuntu-lucid.dd.gz none 02:00 "~/Experimental.sh"
 
 #Ubuntu 10.10
-ssh pipol pipol-sub esn amd64_2010-linux-ubuntu-maverick.dd.gz none 02:00 "~/Experimental.sh"
+ssh pipol pipol-sub esn amd64_2010-linux-ubuntu-maverick.dd.gz none 02:00 "~/Experimental.sh"  # PASSE PAS
 
 #___________________________________________________________________________________________________
 #Fedora 12__________________________________________________________________________________________
@@ -32,9 +32,9 @@ ssh pipol pipol-sub esn amd64_kvm-linux-debian-testing none 02:00 "~/Experimenta
 
 #___________________________________________________________________________________________________
 #MacOS Snow Leopard 10.6____________________________________________________________________________
-#ssh pipol pipol-sub esn x86_64_mac-mac-osx-server-snow-leopard.dd.gz none 02:00 "~/Experimental.sh"
-#ssh pipol pipol-sub esn x86_mac-mac-osx-server-snow-leopard.dd.gz none 02:00 "~/Experimental.sh"
+ssh pipol pipol-sub esn x86_64_mac-mac-osx-server-snow-leopard.dd.gz none 02:00 "~/Experimental.sh" # PASSE PAS
+ssh pipol pipol-sub esn x86_mac-mac-osx-server-snow-leopard.dd.gz none 02:00 "~/Experimental.sh"
 
 #___________________________________________________________________________________________________
 #windows-server-2008-64bits_________________________________________________________________________
-#ssh pipol pipol-sub esn amd64-windows-server-2008-64bits-navarro-2011-03-15-122256.dd.gz none 02:00 "~/Experimental.sh"
\ No newline at end of file
+ssh pipol pipol-sub esn amd64-windows-server-2008-64bits.dd.gz none 02:00 "~/Experimental.sh"
\ No newline at end of file
index 77e9cf3..98fabad 100644 (file)
@@ -3,7 +3,7 @@
 p Testing the Chord implementation with MSG
 
 ! output sort
-$ $SG_TEST_EXENV ./chord$EXEEXT -nb_bits=6 ${srcdir:=.}/../msg_platform.xml ${srcdir:=.}/chord.xml --log=msg_chord.thres:verbose "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir}/chord$EXEEXT -nb_bits=6 ${srcdir:=.}/../msg_platform.xml ${srcdir:=.}/chord.xml --log=msg_chord.thres:verbose "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:node@Gatien) Joining the ring with id 48, knowing node 1
 > [  0.000000] (2:node@McGee) Joining the ring with id 42, knowing node 1
 > [  0.000000] (3:node@iRMX) Joining the ring with id 38, knowing node 1
index 5672742..6aecbc5 100644 (file)
@@ -497,6 +497,28 @@ XBT_PUBLIC(void) surf_network_model_init_bypass(const char *id,
 XBT_PUBLIC(void) surf_network_model_init_GTNETS(const char *filename);
 #endif
 
+#ifdef HAVE_NS3
+/** \brief Initializes the platform with the network model NS3
+ *  \ingroup SURF_models
+ *  \param filename XML platform file name
+ *
+ *  This function is called by surf_workstation_model_init_NS3
+ *  or by yourself only if you plan using surf_workstation_model_init_compound
+ *
+ *  \see surf_workstation_model_init_NS3()
+ */
+XBT_PUBLIC(void) surf_network_model_init_NS3(const char *filename);
+
+XBT_PUBLIC(void) parse_ns3_add_host(void);
+XBT_PUBLIC(void) parse_ns3_add_router(void);
+XBT_PUBLIC(void) parse_ns3_add_link(void);
+XBT_PUBLIC(void) parse_ns3_add_AS(void);
+XBT_PUBLIC(void) parse_ns3_add_route(void);
+XBT_PUBLIC(void) parse_ns3_add_ASroute(void);
+XBT_PUBLIC(void) parse_ns3_add_cluster(void);
+
+#endif
+
 /** \brief Initializes the platform with the network model Reno
  *  \ingroup SURF_models
  *  \param filename XML platform file name
diff --git a/src/surf/network_ns3.c b/src/surf/network_ns3.c
new file mode 100644 (file)
index 0000000..b2e7470
--- /dev/null
@@ -0,0 +1,65 @@
+/* Copyright (c) 2007, 2008, 2009, 2010, 2011. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "surf_private.h"
+#include "surf/ns3/ns3_interface.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_ns3, surf,
+                                "Logging specific to the SURF network NS3 module");
+
+extern routing_global_t global_routing;
+
+void parse_ns3_add_host(void)
+{
+       XBT_INFO("NS3_ADD_HOST '%s'",A_surfxml_host_id);
+       //ns3_add_host(A_surfxml_host_id);
+}
+void parse_ns3_add_router(void)
+{
+       XBT_INFO("NS3_ADD_ROUTER '%s'",A_surfxml_router_id);
+}
+void parse_ns3_add_link(void)
+{
+       XBT_INFO("NS3_ADD_LINK '%s'",A_surfxml_link_id);
+}
+void parse_ns3_add_AS(void)
+{
+       XBT_INFO("NS3_ADD_AS '%s'",A_surfxml_AS_id);
+}
+void parse_ns3_add_route(void)
+{
+       XBT_INFO("NS3_ADD_ROUTE from '%s' to '%s'",A_surfxml_route_src,A_surfxml_route_dst);
+}
+void parse_ns3_add_ASroute(void)
+{
+       XBT_INFO("NS3_ADD_ASROUTE from '%s' to '%s'",A_surfxml_ASroute_src,A_surfxml_ASroute_dst);
+}
+void parse_ns3_add_cluster(void)
+{
+       XBT_INFO("NS3_ADD_CLUSTER '%s'",A_surfxml_cluster_id);
+       routing_parse_Scluster();
+}
+
+static void define_callbacks_ns3(const char *filename)
+{
+  surfxml_add_callback(STag_surfxml_host_cb_list, &parse_ns3_add_host);        //HOST
+  surfxml_add_callback(STag_surfxml_router_cb_list, &parse_ns3_add_router);    //ROUTER
+  surfxml_add_callback(STag_surfxml_link_cb_list, &parse_ns3_add_link);        //LINK
+  surfxml_add_callback(STag_surfxml_AS_cb_list, &parse_ns3_add_AS);            //AS
+  surfxml_add_callback(STag_surfxml_route_cb_list, &parse_ns3_add_route);      //ROUTE
+  surfxml_add_callback(STag_surfxml_ASroute_cb_list, &parse_ns3_add_ASroute);  //ASROUTE
+  surfxml_add_callback(STag_surfxml_cluster_cb_list, &parse_ns3_add_cluster); //CLUSTER
+}
+
+void surf_network_model_init_NS3(const char *filename)
+{
+       define_callbacks_ns3(filename);
+       surf_network_model = surf_model_init();
+       surf_network_model->name = "network NS3";
+
+       update_model_description(surf_network_model_description,
+                   "NS3", surf_network_model);
+}
diff --git a/src/surf/ns3/ns3_interface.cc b/src/surf/ns3/ns3_interface.cc
new file mode 100644 (file)
index 0000000..2688f63
--- /dev/null
@@ -0,0 +1,22 @@
+
+#include "surf/ns3/ns3_interface.h"
+
+#include "ns3/core-module.h"
+#include "ns3/simulator-module.h"
+#include "ns3/node-module.h"
+#include "ns3/helper-module.h"
+#include "ns3/global-route-manager.h"
+
+#include "xbt/log.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(interface_ns3, surf,
+                                "Logging specific to the SURF network NS3 module");
+
+//NodeContainer nodes;
+
+void ns3_add_host(char * id)
+{
+       XBT_INFO("Interface ns3 add host");
+//     Ptr<Node> a =  CreateObject<Node> (0);
+//     nodes.Add(a);
+}
diff --git a/src/surf/ns3/ns3_interface.h b/src/surf/ns3/ns3_interface.h
new file mode 100644 (file)
index 0000000..76c43d5
--- /dev/null
@@ -0,0 +1,9 @@
+/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "xbt/misc.h"
+
+XBT_PUBLIC(void) ns3_add_host(char * id);
index 74f7519..bd46602 100644 (file)
@@ -131,6 +131,11 @@ s_surf_model_description_t surf_network_model_description[] = {
   {"GTNets",
    "Network Pseudo-model using the GTNets simulator instead of an analytic model",
    NULL, surf_network_model_init_GTNETS},
+#endif
+#ifdef HAVE_NS3
+  {"NS3",
+   "TODO",
+   NULL, surf_network_model_init_NS3},
 #endif
   {"Reno",
    "Model using lagrange_solve instead of lmm_solve (experts only)", NULL,
index ac3fae8..42ec82a 100644 (file)
@@ -194,6 +194,8 @@ struct s_routing_global {
 
 XBT_PUBLIC(void) routing_model_create(size_t size_of_link, void *loopback, double_f_cpvoid_t get_link_latency_fun);
 
+XBT_PUBLIC(void) routing_parse_Scluster(void);       /* cluster bypass */
+
 /**
  * Resource protected methods
  */
index 3d1fd6a..5d1e078 100644 (file)
@@ -27,7 +27,6 @@ static double_f_cpvoid_t get_link_latency = NULL;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf");
 
-static void routing_parse_Scluster(void);       /* cluster bypass */
 static void routing_parse_Speer(void);          /* peer bypass */
 static void routing_parse_Srandom(void);        /* random bypass */
 static void routing_parse_Erandom(void);        /* random bypass */
@@ -1529,7 +1528,7 @@ static void routing_parse_Econfig(void)
   XBT_DEBUG("End configuration name = %s",A_surfxml_config_id);
 }
 
-static void routing_parse_Scluster(void)
+void routing_parse_Scluster(void)
 {
   static int AX_ptr = 0;