Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 12 Feb 2016 21:54:43 +0000 (22:54 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 12 Feb 2016 21:54:43 +0000 (22:54 +0100)
CMakeLists.txt
doc/doxygen/inside_tests.doc
src/surf/surf_routing.cpp
src/surf/surf_routing.hpp
src/surf/surf_routing_cluster.cpp
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_full.cpp
src/surf/surf_routing_generic.cpp
tools/cmake/test_prog/prog_stackgrowth.c
tools/internal/spell_comments.pl

index 1524a17..34badca 100644 (file)
@@ -101,7 +101,7 @@ set(SIMGRID_VERSION_MINOR "13")
 set(SIMGRID_VERSION_PATCH "0")
 set(SIMGRID_VERSION_EXTRA "-devel") # Extra words to add to version string (e.g. -rc1)
 
-set(SIMGRID_VERSION_DATE  "2015") # Year for copyright information
+set(SIMGRID_VERSION_DATE  "2016") # Year for copyright information
 
 if(${SIMGRID_VERSION_PATCH} EQUAL "0")
   set(release_version "${SIMGRID_VERSION_MAJOR}.${SIMGRID_VERSION_MINOR}")
@@ -738,11 +738,12 @@ endif()
 
 ### check for stackgrowth
 if (NOT CMAKE_CROSSCOMPILING)
-  try_run(RUN_makecontext_VAR COMPILE_makecontext_VAR
+  try_run(RUN_stackgrowth_VAR COMPILE_stackgrowth_VAR
     ${CMAKE_BINARY_DIR}
     ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_stackgrowth.c
     RUN_OUTPUT_VARIABLE stack
-    )
+    COPY_FILE test_stackgrowth
+  )
 endif()
 if("${stack}" STREQUAL "down")
   set(PTH_STACKGROWTH "-1")
index c6679fa..ca1b7ed 100644 (file)
@@ -308,4 +308,16 @@ We re-use the ones from the
 project. Thanks to them for compiling sane tools and constituting that
 archive, it saved my mind! 
 
+\subsection inside_tests_debian Debian builders
+
+Since SimGrid is packaged in Debian, we benefit from their huge
+testing infrastructure. That's an interesting torture test for our
+code base. The downside is that it's only for the released versions of
+SimGrid. That is why the Debian build does not stop when the tests
+fail: post-releases fixes do not fit well in our workflow and we fix
+only the most important breakages.
+
+The build results are here:
+https://buildd.debian.org/status/package.php?p=simgrid
+
 */
index 237c4ed..5ad4254 100644 (file)
@@ -36,7 +36,7 @@ namespace surf {
   As::~As()
   {
     xbt_dict_free(&sons_);
-    xbt_dynar_free(&p_indexNetworkElm);
+    xbt_dynar_free(&vertices_);
     xbt_dynar_free(&upDownLinks);
     xbt_free(name_);
     if (netcard_)
@@ -45,8 +45,8 @@ namespace surf {
 
   int As::addComponent(NetCard *elm) {
     XBT_DEBUG("Load component \"%s\"", elm->getName());
-    xbt_dynar_push_as(p_indexNetworkElm, NetCard*, elm);
-    return xbt_dynar_length(p_indexNetworkElm)-1;
+    xbt_dynar_push_as(vertices_, NetCard*, elm);
+    return xbt_dynar_length(vertices_)-1;
   }
 
 }} // namespace simgrid::surf
@@ -856,7 +856,7 @@ xbt_dict_t surf_AS_get_routing_sons(simgrid::surf::As *as)
 
 xbt_dynar_t surf_AS_get_hosts(simgrid::surf::As *as)
 {
-  xbt_dynar_t elms = as->p_indexNetworkElm;
+  xbt_dynar_t elms = as->vertices_;
   int count = xbt_dynar_length(elms);
   xbt_dynar_t res =  xbt_dynar_new(sizeof(sg_host_t), NULL);
   for (int index = 0; index < count; index++) {
index 8ffb46f..e5eed86 100644 (file)
@@ -28,13 +28,14 @@ class XBT_PRIVATE Onelink;
 class RoutingPlatf;
 
 /** @ingroup SURF_routing_interface
- * @brief A network card
+ * @brief Network cards are the vertices in the graph representing the network, used to compute paths between nodes.
+ *
  * @details This represents a position in the network. One can route information between two netcards
  */
 class NetCard {
 public:
   virtual ~NetCard(){};
-  virtual int getId()=0;
+  virtual int getId()=0; // Our rank in the vertices_ array of our container AS.
   virtual int *getIdPtr()=0;
   virtual void setId(int id)=0;
   virtual char *getName()=0;
@@ -58,7 +59,7 @@ public:
   As *father_ = nullptr;
   xbt_dict_t sons_ = xbt_dict_new_homogeneous(NULL);
 
-  xbt_dynar_t p_indexNetworkElm = xbt_dynar_new(sizeof(char*),NULL); // TODO: What is it?
+  xbt_dynar_t vertices_ = xbt_dynar_new(sizeof(char*),NULL); // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
   xbt_dict_t bypassRoutes_ = nullptr;
   e_surf_routing_hierarchy_t hierarchy_ = SURF_ROUTING_NULL;
   xbt_dynar_t upDownLinks = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
@@ -66,11 +67,18 @@ public:
 
 
   /**
-   * @brief Get the characteristics of the routing path between two points
+   * @brief Probe the routing path between two points
    *
-   * This function is used by the networking model to find the information it needs when starting a communication.
+   * The networking model uses this function when creating a communication
+   * to retrieve both the list of links that the create communication will use,
+   * and the summed latency that these links represent.
    *
-   * The things are not straightforward because the platform can be routed using several routing models.
+   * The network could recompute the latency by itself from the list, but it would
+   * require an additional link set traversal. This operation being on the critical
+   * path of SimGrid, the routing computes the latency in behalf of the network.
+   *
+   * Things are rather complex here because we have to find the path from ASes to ASes, and within each.
+   * In addition, the different ASes may use differing routing models.
    * Some ASes may be routed in full, others may have only some connection information and use a shortest path on top of that, and so on.
    * Some ASes may even not have any predefined links and use only coordinate informations to compute the latency.
    *
@@ -79,12 +87,11 @@ public:
    * 
    * @param src Initial point of the routing path
    * @param dst Final point of the routing path
-   * @param into Container into which the links should be pushed
-   * @param latency Accumulator in which the latencies should be added
+   * @param into Container into which the traversed links should be pushed
+   * @param latency Accumulator in which the latencies should be added (caller must set it to 0)
    */
-  virtual void getRouteAndLatency(
-      NetCard *src, NetCard *dst,
-      sg_platf_route_cbarg_t into, double *latency)=0;
+  virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency)=0;
+  /** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
   virtual xbt_dynar_t getOneLinkRoutes()=0;
 
   virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0;
index 61ced4e..d3d83f7 100644 (file)
@@ -75,7 +75,7 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb
 void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
   int isrc;
-  int table_size = xbt_dynar_length(p_indexNetworkElm);
+  int table_size = xbt_dynar_length(vertices_);
 
   NetCard *src;
   xbt_node_t current, previous, backboneNode = NULL, routerNode;
@@ -95,7 +95,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
   }
 
   for (isrc = 0; isrc < table_size; isrc++) {
-    src = xbt_dynar_get_as(p_indexNetworkElm, isrc, NetCard*);
+    src = xbt_dynar_get_as(vertices_, isrc, NetCard*);
 
     if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) {
       previous = new_xbt_graph_node(graph, src->getName(), nodes);
index 1808d92..5211683 100644 (file)
@@ -171,12 +171,12 @@ xbt_dynar_t AsDijkstra::getOneLinkRoutes()
 
   int src,dst;
   NetCard *src_elm, *dst_elm;
-  int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
+  int table_size = (int)xbt_dynar_length(vertices_);
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
       xbt_dynar_reset(route->link_list);
-      src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*);
-      dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*);
+      src_elm = xbt_dynar_get_as(vertices_, src, NetCard*);
+      dst_elm = xbt_dynar_get_as(vertices_, dst, NetCard*);
       this->getRouteAndLatency(src_elm, dst_elm,route, NULL);
 
       if (xbt_dynar_length(route->link_list) == 1) {
index 8500720..49022bb 100644 (file)
@@ -28,7 +28,7 @@ AsFloyd::AsFloyd(const char*name)
 AsFloyd::~AsFloyd(){
   int i, j;
   int table_size;
-  table_size = (int)xbt_dynar_length(p_indexNetworkElm);
+  table_size = (int)xbt_dynar_length(vertices_);
   if (p_linkTable == NULL) // Dealing with a parse error in the file?
     return;
   /* Delete link_table */
@@ -53,12 +53,12 @@ xbt_dynar_t AsFloyd::getOneLinkRoutes()
 
   int src,dst;
   sg_netcard_t src_elm, dst_elm;
-  int table_size = xbt_dynar_length(p_indexNetworkElm);
+  int table_size = xbt_dynar_length(vertices_);
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
       xbt_dynar_reset(route->link_list);
-      src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*);
-      dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*);
+      src_elm = xbt_dynar_get_as(vertices_, src, NetCard*);
+      dst_elm = xbt_dynar_get_as(vertices_, dst, NetCard*);
       this->getRouteAndLatency(src_elm, dst_elm, route, NULL);
 
       if (xbt_dynar_length(route->link_list) == 1) {
@@ -82,7 +82,7 @@ void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbar
 {
 
   /* set utils vars */
-  size_t table_size = xbt_dynar_length(p_indexNetworkElm);
+  size_t table_size = xbt_dynar_length(vertices_);
 
   this->srcDstCheck(src, dst);
 
@@ -144,7 +144,7 @@ void AsFloyd::parseRoute(sg_platf_route_cbarg_t route)
   int as_route = 0;
 
   /* set the size of table routing */
-  int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
+  int table_size = (int)xbt_dynar_length(vertices_);
   NetCard *src_net_elm, *dst_net_elm;
 
   src_net_elm = sg_netcard_by_name_or_null(src);
@@ -265,7 +265,7 @@ void AsFloyd::Seal(){
   unsigned int i, j, a, b, c;
 
   /* set the size of table routing */
-  size_t table_size = xbt_dynar_length(p_indexNetworkElm);
+  size_t table_size = xbt_dynar_length(vertices_);
 
   if(!p_linkTable) {
     /* Create Cost, Predecessor and Link tables */
index fc1c034..16a27d4 100644 (file)
@@ -24,7 +24,7 @@ void AsFull::Seal() {
   sg_platf_route_cbarg_t e_route;
 
   /* set utils vars */
-  int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
+  int table_size = (int)xbt_dynar_length(vertices_);
 
   /* Create table if necessary */
   if (!p_routingTable)
@@ -48,7 +48,7 @@ void AsFull::Seal() {
 
 AsFull::~AsFull(){
   if (p_routingTable) {
-    int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
+    int table_size = (int)xbt_dynar_length(vertices_);
     int i, j;
     /* Delete routing table */
     for (i = 0; i < table_size; i++)
@@ -67,7 +67,7 @@ xbt_dynar_t AsFull::getOneLinkRoutes()
   xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
 
   int src, dst;
-  int table_size = xbt_dynar_length(p_indexNetworkElm);
+  int table_size = xbt_dynar_length(vertices_);
 
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
@@ -77,9 +77,9 @@ xbt_dynar_t AsFull::getOneLinkRoutes()
           void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
           Onelink *onelink;
           if (hierarchy_ == SURF_ROUTING_BASE) {
-          NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t);
+          NetCard *tmp_src = xbt_dynar_get_as(vertices_, src, sg_netcard_t);
             tmp_src->setId(src);
-          NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t);
+          NetCard *tmp_dst = xbt_dynar_get_as(vertices_, dst, sg_netcard_t);
           tmp_dst->setId(dst);
             onelink = new Onelink(link, tmp_src, tmp_dst);
           } else if (hierarchy_ == SURF_ROUTING_RECURSIVE)
@@ -106,7 +106,7 @@ void AsFull::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg
       dst->getId());
 
   /* set utils vars */
-  size_t table_size = xbt_dynar_length(p_indexNetworkElm);
+  size_t table_size = xbt_dynar_length(vertices_);
 
   sg_platf_route_cbarg_t e_route = NULL;
   void *link;
@@ -146,7 +146,7 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route)
   xbt_assert(src_net_elm, "Network elements %s not found", src);
   xbt_assert(dst_net_elm, "Network elements %s not found", dst);
 
-  size_t table_size = xbt_dynar_length(p_indexNetworkElm);
+  size_t table_size = xbt_dynar_length(vertices_);
 
   xbt_assert(!xbt_dynar_is_empty(route->link_list),
       "Invalid count of links, must be greater than zero (%s,%s)",
index d332952..2e8ef80 100644 (file)
@@ -148,17 +148,17 @@ namespace surf {
 void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
   int src, dst;
-  int table_size = xbt_dynar_length(p_indexNetworkElm);
+  int table_size = xbt_dynar_length(vertices_);
 
 
   for (src = 0; src < table_size; src++) {
     NetCard *my_src =
-        xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*);
+        xbt_dynar_get_as(vertices_, src, NetCard*);
     for (dst = 0; dst < table_size; dst++) {
       if (src == dst)
         continue;
       NetCard *my_dst =
-          xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*);
+          xbt_dynar_get_as(vertices_, dst, NetCard*);
 
       sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
       route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
index f005341..d75dde5 100644 (file)
 static int iterate = 10;
 static int growsdown(int *x)
 {
-  int y;
-  y = (x > &y);
+  int y = (x > &y);
+   
   if (--iterate > 0)
     y = growsdown(&y);
-  if (y != (x > &y))
+
+  /* The stack sometimes changes at the 0th level. 
+   * Original version did fail in this case, but I changed this around SimGrid 3.13 because of https://bugs.debian.org/814272
+   * Every arch failed on that day :(
+   */
+  if (iterate != 0 && y != (x > &y)) {
+    fprintf(stderr, "The stack changed its direction! (Iteration: %d. It was growing %s; &y=%p; &prevY=%p)\n",
+           (10-iterate), y?"down":"up", &y, x);
     exit(1);
+  }
   return y;
 }
 
@@ -23,6 +31,6 @@ int main(int argc, char *argv[])
 {
   int x;
   printf("%s", growsdown(&x) ? "down" : "up");
-  exit(0);
-  return 1;
+
+  return 0;
 }
index 7ff91da..c9659d3 100755 (executable)
@@ -15,7 +15,7 @@
 use strict;
 use warnings;
 
-die "Please install iamerican to use that script.
+die "Please install iamerican to use that script.\n"
   unless (-r "/usr/lib/ispell/american.hash");
 
 sub check_content($) {
@@ -31,7 +31,7 @@ die "Call this script from its location or from the SimGrid root directory\n" un
 
 die "Usage: ". ($DICTFILE eq "./spell_dict.txt"? "./":"tools/internal/")."spell_comments.pl "
            ."`find ". ($DICTFILE eq "./spell_dict.txt"? "../../":".")." -name '*.[ch]' -o -name '*.hpp' -o -name '*.cpp' |grep -v umpire|grep -v smpi/mpich3-test|grep -v NAS`\n"
-  unless length(@ARGV)>1;
+  unless scalar(@ARGV)>1;
 
 my $total = 0;
 foreach my $file (@ARGV) {