From: Martin Quinson Date: Thu, 21 Apr 2011 12:55:00 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_6_rc3~122 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f3dabc5eb26d7bc8b1e29b3aa52c74368c6bb699?hp=d966e8da3b13c4f36c983f1716659318207b3044 Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 3371adbe6e..db5d97f2c3 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -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 diff --git a/buildtools/Cmake/Modules/FindNS3.cmake b/buildtools/Cmake/Modules/FindNS3.cmake index 8906d1f0ae..aca50fd101 100644 --- a/buildtools/Cmake/Modules/FindNS3.cmake +++ b/buildtools/Cmake/Modules/FindNS3.cmake @@ -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) diff --git a/buildtools/Cmake/gras_config.h.in b/buildtools/Cmake/gras_config.h.in index a39a90f474..4777ae1576 100644 --- a/buildtools/Cmake/gras_config.h.in +++ b/buildtools/Cmake/gras_config.h.in @@ -141,6 +141,9 @@ /* 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 header file. */ #cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@ diff --git a/buildtools/pipol/Experimental.sh b/buildtools/pipol/Experimental.sh index ced8dddd7c..25b44daf42 100644 --- a/buildtools/pipol/Experimental.sh +++ b/buildtools/pipol/Experimental.sh @@ -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 diff --git a/buildtools/pipol/Nightly_simgrid.sh b/buildtools/pipol/Nightly_simgrid.sh index ab54c6442c..e5b1bc6dd5 100644 --- a/buildtools/pipol/Nightly_simgrid.sh +++ b/buildtools/pipol/Nightly_simgrid.sh @@ -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 diff --git a/buildtools/pipol/deploy.sh b/buildtools/pipol/deploy.sh index ab7080b9c7..feb83b12e3 100644 --- a/buildtools/pipol/deploy.sh +++ b/buildtools/pipol/deploy.sh @@ -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 diff --git a/examples/msg/chord/chord.tesh b/examples/msg/chord/chord.tesh index 77e9cf3d0a..98fabadc49 100644 --- a/examples/msg/chord/chord.tesh +++ b/examples/msg/chord/chord.tesh @@ -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 diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 5672742cb9..6aecbc5bd5 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -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 index 0000000000..b2e747039b --- /dev/null +++ b/src/surf/network_ns3.c @@ -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 index 0000000000..2688f639c8 --- /dev/null +++ b/src/surf/ns3/ns3_interface.cc @@ -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 a = CreateObject (0); +// nodes.Add(a); +} diff --git a/src/surf/ns3/ns3_interface.h b/src/surf/ns3/ns3_interface.h new file mode 100644 index 0000000000..76c43d5ea3 --- /dev/null +++ b/src/surf/ns3/ns3_interface.h @@ -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); diff --git a/src/surf/surf.c b/src/surf/surf.c index 74f7519327..bd4660229c 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -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, diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index ac3fae8ef6..42ec82ab90 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -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 */ diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 3d1fd6ab31..5d1e078eb4 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -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;