Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case routing
[simgrid.git] / include / simgrid / kernel / routing / DragonflyZone.hpp
1 /* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SURF_ROUTING_CLUSTER_DRAGONFLY_HPP_
7 #define SURF_ROUTING_CLUSTER_DRAGONFLY_HPP_
8
9 #include <simgrid/kernel/routing/ClusterZone.hpp>
10
11 namespace simgrid {
12 namespace kernel {
13 namespace routing {
14
15 class DragonflyRouter {
16 public:
17   unsigned int group_;
18   unsigned int chassis_;
19   unsigned int blade_;
20   surf::LinkImpl** blue_links_  = nullptr;
21   surf::LinkImpl** black_links_ = nullptr;
22   surf::LinkImpl** green_links_ = nullptr;
23   surf::LinkImpl** my_nodes_    = nullptr;
24   DragonflyRouter(int i, int j, int k);
25   ~DragonflyRouter();
26 };
27
28 /** @ingroup ROUTING_API
29  * @brief NetZone using a Dragonfly topology
30  *
31  * Generate dragonfly according to the topology asked for, according to:
32  * Cray Cascade: a Scalable HPC System based on a Dragonfly Network
33  * Greg Faanes, Abdulla Bataineh, Duncan Roweth, Tom Court, Edwin Froese,
34  * Bob Alverson, Tim Johnson, Joe Kopnick, Mike Higgins and James Reinhard
35  * Cray Inc, Chippewa Falls, Wisconsin, USA
36  * or http://www.cray.com/sites/default/files/resources/CrayXCNetwork.pdf
37  *
38  * We use the same denomination for the different levels, with a Green,
39  * Black and Blue color scheme for the three different levels.
40  *
41  * Description of the topology has to be given with a string of type :
42  * "3,4;4,3;5,1;2"
43  *
44  * Last part  : "2"   : 2 nodes per blade
45  * Third part : "5,1" : five blades/routers per chassis, with one link between each (green network)
46  * Second part : "4,3" = four chassis per group, with three links between each nth router of each chassis (black
47  * network)
48  * First part : "3,4" = three electrical groups, linked in an alltoall
49  * pattern by 4 links each (blue network)
50  *
51  * LIMITATIONS (for now):
52  *  - Routing is only static and uses minimal routes.
53  *  - When n links are used between two routers/groups, we consider only one link with n times the bandwidth (needs to
54  *    be validated on a real system)
55  *  - All links have the same characteristics for now
56  *  - Blue links are all attached to routers in the chassis n°0. This limits
57  *    the number of groups possible to the number of blades in a chassis. This
58  *    is also not realistic, as blue level can use more links than a single
59  *    Aries can handle, thus it should use several routers.
60  */
61 class XBT_PUBLIC DragonflyZone : public ClusterZone {
62 public:
63   explicit DragonflyZone(NetZone* father, std::string name);
64   ~DragonflyZone() override;
65   //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
66   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
67   void parse_specific_arguments(ClusterCreationArgs* cluster) override;
68   void seal() override;
69   void generateRouters();
70   void generateLinks();
71   void createLink(const std::string& id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown);
72
73   void rankId_to_coords(int rankId, unsigned int (*coords)[4]);
74
75 private:
76   ClusterCreationArgs* cluster_     = nullptr;
77   unsigned int num_nodes_per_blade_    = 0;
78   unsigned int num_blades_per_chassis_ = 0;
79   unsigned int num_chassis_per_group_  = 0;
80   unsigned int num_groups_             = 0;
81   unsigned int num_links_green_        = 0;
82   unsigned int num_links_black_        = 0;
83   unsigned int num_links_blue_         = 0;
84   unsigned int num_links_per_link_     = 1; // splitduplex -> 2, only for local link
85   DragonflyRouter** routers_        = nullptr;
86 };
87 } // namespace routing
88 } // namespace kernel
89 } // namespace simgrid
90 #endif