Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/simgrid/simgrid
authordegomme <augustin.degomme@unibas.ch>
Thu, 28 Jul 2016 10:01:38 +0000 (12:01 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Thu, 28 Jul 2016 10:01:38 +0000 (12:01 +0200)
1  2 
src/surf/sg_platf.cpp

diff --combined src/surf/sg_platf.cpp
  #include "src/surf/network_interface.hpp"
  #include "surf/surf_routing.h" // FIXME: brain dead public header
  
- #include "src/surf/AsImpl.hpp"
- #include "src/surf/AsCluster.hpp"
- #include "src/surf/AsClusterTorus.hpp"
- #include "src/surf/AsClusterFatTree.hpp"
- #include "src/surf/AsClusterDragonfly.hpp"
- #include "src/surf/AsDijkstra.hpp"
- #include "src/surf/AsFloyd.hpp"
- #include "src/surf/AsFull.hpp"
- #include "src/surf/AsNone.hpp"
- #include "src/surf/AsVivaldi.hpp"
+ #include "src/routing/AsImpl.hpp"
+ #include "src/routing/AsCluster.hpp"
+ #include "src/routing/AsClusterTorus.hpp"
+ #include "src/routing/AsClusterFatTree.hpp"
+ #include "src/routing/AsClusterDragonfly.hpp"
+ #include "src/routing/AsDijkstra.hpp"
+ #include "src/routing/AsFloyd.hpp"
+ #include "src/routing/AsFull.hpp"
+ #include "src/routing/AsNone.hpp"
+ #include "src/routing/AsVivaldi.hpp"
  
  XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
  
@@@ -175,7 -175,6 +175,7 @@@ void sg_platf_new_host(sg_platf_host_cb
  /** @brief Add a "router" to the network element list */
  void sg_platf_new_router(sg_platf_router_cbarg_t router)
  {
 +  using simgrid::routing::AsCluster;
    simgrid::routing::AsImpl* current_routing = routing_get_current();
  
    if (current_routing->hierarchy_ == simgrid::routing::AsImpl::RoutingMode::unset)
      xbt_lib_set(as_router_lib, router->id, COORD_ASR_LEVEL, (void *) ctn);
    }
  
 +  auto cluster = dynamic_cast<AsCluster*>(current_routing);
 +  if(cluster != nullptr)
 +    cluster->router_ = static_cast<simgrid::routing::NetCard*>(xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL));
 +
    if (TRACE_is_enabled() && TRACE_needs_platform())
      sg_instr_new_router(router);
  }
@@@ -709,6 -704,7 +709,6 @@@ void sg_platf_new_peer(sg_platf_peer_cb
    router.id = router_id;
    router.coord = peer->coord;
    sg_platf_new_router(&router);
 -  static_cast<AsCluster*>(current_routing)->router_ = static_cast<NetCard*>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
  
    XBT_DEBUG("</AS>");
    sg_platf_new_AS_seal();