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>
Sun, 19 Jun 2011 08:58:41 +0000 (10:58 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 19 Jun 2011 08:58:41 +0000 (10:58 +0200)
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/Distrib.cmake
src/surf/network_ns3.c
src/surf/ns3/ns3_interface.cc

index bf6d3e9..2cea4e2 100644 (file)
@@ -676,11 +676,19 @@ exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpif2c" OUTPUT_VARIABLE OKITO
 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpiff" OUTPUT_VARIABLE OKITOKI)
 exec_program("chmod a=rwx ${CMAKE_BINARY_DIR}/bin/smpirun" OUTPUT_VARIABLE OKITOKI)
 
-set(generate_files_to_clean
-${CMAKE_BINARY_DIR}/src/context_sysv_config.h
-${CMAKE_BINARY_DIR}/src/gras_config.h
-${CMAKE_BINARY_DIR}/include/simgrid_config.h
-${CMAKE_BINARY_DIR}/include/smpi/smpif.h
+set(generated_headers_to_install
+       ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
+       ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
+)
+
+set(generated_headers
+    ${CMAKE_CURRENT_BINARY_DIR}/src/context_sysv_config.h
+    ${CMAKE_CURRENT_BINARY_DIR}/src/gras_config.h
+)
+
+set(generated_files_to_clean
+${generated_headers}
+${generated_headers_to_install}
 ${CMAKE_BINARY_DIR}/bin/smpicc
 ${CMAKE_BINARY_DIR}/bin/smpif2c
 ${CMAKE_BINARY_DIR}/bin/smpiff
index c3d8881..6378849 100644 (file)
@@ -362,7 +362,7 @@ set(RNGSTREAM_SRC
        src/rngstreams/RngStream.c
 )
 
-set(install_HEADERS
+set(headers_to_install
        include/xbt/misc.h
        include/xbt/sysdep.h
        include/xbt/virtu.h
@@ -431,11 +431,6 @@ set(source_of_generated_headers
        include/smpi/smpif.h.in
        src/context_sysv_config.h.in)
 
-set(GENERATE_HEADERS
-       ${CMAKE_CURRENT_BINARY_DIR}/include/smpi/smpif.h
-       ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h
-)
-
 ### depend of some variables setted upper
 # -->CONTEXT_THREADS CONTEXT_UCONTEXT
 if(${CONTEXT_THREADS}) #pthread
@@ -820,7 +815,7 @@ buildtools/Cmake/tesh.pl
 
 # This is the complete list of what will be added to the source archive
 set(source_to_pack     
-       ${install_HEADERS}
+       ${headers_to_install}
        ${source_of_generated_headers}
        ${XBT_RL_SRC}
        ${EXTRA_DIST}
index 1ee02ab..81bf320 100644 (file)
@@ -79,8 +79,8 @@ endif(enable_lib_static AND NOT WIN32)
 
 # include files
 set(HEADERS
-    ${install_HEADERS}
-    ${GENERATE_HEADERS}
+    ${headers_to_install}
+    ${generated_headers_to_install}
     )
 foreach(file ${HEADERS})
   get_filename_component(location ${file} PATH)
index 481c575..50cf119 100644 (file)
@@ -37,28 +37,6 @@ static void replace_str(char *str, const char *orig, const char *rep)
 
 static void replace_bdw_ns3(char * bdw)
 {
-//     replace_str(bdw,".00","");
-//     char *temp = xbt_strdup(bdw);
-//
-//     replace_str(bdw,"000000000","Gbps");
-//     if(strcmp(bdw,temp)) {xbt_free(temp);return;}
-//     replace_str(bdw,"00000000","00Mbps");
-//     if(strcmp(bdw,temp)) {xbt_free(temp);return;}
-//     replace_str(bdw,"0000000","0Mbps");
-//     if(strcmp(bdw,temp)) {xbt_free(temp);return;}
-//     replace_str(bdw,"000000","Mbps");
-//     if(strcmp(bdw,temp)) {xbt_free(temp);return;}
-//     replace_str(bdw,"00000","00Kbps");
-//     if(strcmp(bdw,temp)) {xbt_free(temp);return;}
-//     replace_str(bdw,"0000","0Kbps");
-//     if(strcmp(bdw,temp)) {xbt_free(temp);return;}
-//     replace_str(bdw,"000","Kbps");
-//     if(strcmp(bdw,temp)) {xbt_free(temp);return;}
-//
-//     xbt_free(bdw);
-//     bdw = bprintf("%s%s",temp,"bps");
-//     xbt_free(temp);
-
        char *temp = xbt_strdup(bdw);
        xbt_free(bdw);
        bdw = bprintf("%fbps",atof(temp));
@@ -257,38 +235,36 @@ void parse_ns3_end_platform(void)
 {
        ns3_end_platform();
 
-//       xbt_lib_cursor_t cursor = NULL;
-//       char *name = NULL;
-//       void **data = NULL;
-//       XBT_INFO("link_lib");
-//       xbt_lib_foreach(link_lib, cursor, name, data) {
-//                     XBT_INFO("\tSee link '%s'\t--> NS3_LEVEL %p",
-//                                     name,
-//                                     data[NS3_LINK_LEVEL]);
-//       }
-//       XBT_INFO(" ");
-//       XBT_INFO("host_lib");
-//       xbt_lib_foreach(host_lib, cursor, name, data) {
-//                     XBT_INFO("\tSee host '%s'\t--> NS3_LEVEL %p",
-//                                     name,
-//                                     data[NS3_HOST_LEVEL]);
-//       }
-//       XBT_INFO(" ");
-//       XBT_INFO("as_router_lib");
-//       xbt_lib_foreach(as_router_lib, cursor, name, data) {
-//                     XBT_INFO("\tSee ASR '%s'\t--> NS3_LEVEL %p",
-//                                     name,
-//                                     data[NS3_ASR_LEVEL]);
-//       }
-//
-//       XBT_INFO(" ");
+         xbt_lib_cursor_t cursor = NULL;
+         char *name = NULL;
+         void **data = NULL;
+         XBT_DEBUG("link_lib");
+         xbt_lib_foreach(link_lib, cursor, name, data) {
+                       XBT_DEBUG("\tSee link '%s'\t--> NS3_LEVEL %p",
+                                       name,
+                                       data[NS3_LINK_LEVEL]);
+         }
+         XBT_DEBUG(" ");
+         XBT_DEBUG("host_lib");
+         xbt_lib_foreach(host_lib, cursor, name, data) {
+                       XBT_DEBUG("\tSee host '%s'\t--> NS3_LEVEL %p",
+                                       name,
+                                       data[NS3_HOST_LEVEL]);
+         }
+         XBT_DEBUG(" ");
+         XBT_DEBUG("as_router_lib");
+         xbt_lib_foreach(as_router_lib, cursor, name, data) {
+                       XBT_DEBUG("\tSee ASR '%s'\t--> NS3_LEVEL %p",
+                                       name,
+                                       data[NS3_ASR_LEVEL]);
+         }
+
+         XBT_DEBUG(" ");
 }
 
 /* Create the ns3 topology based on routing strategy */
 void create_ns3_topology()
 {
-//   int src_id,dst_id;
-
    XBT_INFO("Starting topology generation");
 
    //get the onelinks from the parsed platform
@@ -304,11 +280,6 @@ void create_ns3_topology()
      char *dst = onelink->dst;
      void *link = onelink->link_ptr;
 
-//TODO need to uncomment those two line
-//     src_id = *((int *) xbt_dict_get_or_null(global_routing->root->to_index,src));
-//     dst_id = *((int *) xbt_dict_get_or_null(global_routing->root->to_index,dst));
-
-//   if( (src_id != dst_id) && ((surf_ns3_link_t)link)->created){
      if( strcmp(src,dst) && ((surf_ns3_link_t)link)->created){
      XBT_INFO("Route from '%s' to '%s' with link '%s'",src,dst,((surf_ns3_link_t)link)->data->id);
      char * link_bdw = xbt_strdup(((surf_ns3_link_t)link)->data->bdw);
index d961c69..4542034 100644 (file)
@@ -90,19 +90,18 @@ void * ns3_add_cluster(char * bw,char * lat,char *id)
        XBT_DEBUG("Add router %d to cluster",nodes.GetN()-Nodes.GetN()-1);
        Nodes.Add(nodes.Get(nodes.GetN()-Nodes.GetN()-1));
 
-       if(Nodes.GetN() > 254)
-               xbt_die("Cluster with NS3 is limited to 254 nodes");
+       if(Nodes.GetN() > 65000)
+               xbt_die("Cluster with NS3 is limited to 65000 nodes");
        CsmaHelper csma;
        csma.SetChannelAttribute ("DataRate", StringValue (bw));
        csma.SetChannelAttribute ("Delay", StringValue (lat));
        NetDeviceContainer devices = csma.Install (Nodes);
        XBT_DEBUG("Create CSMA");
 
-
-       char * adr = bprintf("10.%d.%d.0",number_of_networks,number_of_links);
+       char * adr = bprintf("%d.%d.0.0",number_of_networks,number_of_links);
        XBT_DEBUG("Assign IP Addresses %s to CSMA.",adr);
        Ipv4AddressHelper ipv4;
-       ipv4.SetBase (adr, "255.255.255.0");
+       ipv4.SetBase (adr, "255.255.0.0");
        interfaces.Add(ipv4.Assign (devices));
 
        if(number_of_links == 255){
@@ -114,6 +113,7 @@ void * ns3_add_cluster(char * bw,char * lat,char *id)
                number_of_links++;
        }
        XBT_DEBUG("Number of nodes in Cluster_nodes: %d",Cluster_nodes.GetN());
+
 }
 
 void * ns3_add_AS(char * id)
@@ -143,8 +143,8 @@ void * ns3_add_link(int src,int dst,char * bw,char * lat)
 
        netA.Add(pointToPoint.Install (a, b));
 
-       char * adr = bprintf("10.%d.%d.0",number_of_networks,number_of_links);
-       address.SetBase (adr, "255.255.255.0");
+       char * adr = bprintf("%d.%d.0.0",number_of_networks,number_of_links);
+       address.SetBase (adr, "255.255.0.0");
        XBT_DEBUG("\tInterface stack '%s'",adr);
        interfaces.Add(address.Assign (netA));
 
@@ -164,11 +164,12 @@ void * ns3_end_platform(void)
        XBT_INFO("InitializeRoutes");
        GlobalRouteManager::BuildGlobalRoutingDatabase();
        GlobalRouteManager::InitializeRoutes();
+
        //TODO REMOVE ;)
        Ptr<Node> a = nodes.Get(0);
-       Ptr<Node> b = nodes.Get(11);
-       Ptr<Node> c = nodes.Get(12);
-       Ptr<Node> d = nodes.Get(13);
+       Ptr<Node> b = nodes.Get(1);
+       Ptr<Node> c = nodes.Get(2);
+       Ptr<Node> d = nodes.Get(3);
 
        UdpEchoServerHelper echoServer (9);