Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
clang-format changes related to the previous commit
[simgrid.git] / src / kernel / routing / DragonflyZone.hpp
1 /* Copyright (c) 2014-2016. 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 "src/kernel/routing/ClusterZone.hpp"
10
11 namespace simgrid {
12 namespace kernel {
13 namespace routing {
14
15 class XBT_PRIVATE DragonflyRouter {
16 public:
17   unsigned int group_;
18   unsigned int chassis_;
19   unsigned int blade_;
20   surf::Link** blueLinks_  = nullptr;
21   surf::Link** blackLinks_ = nullptr;
22   surf::Link** greenLinks_ = nullptr;
23   surf::Link** myNodes_    = nullptr;
24   DragonflyRouter(int i, int j, int k);
25   ~DragonflyRouter();
26 };
27
28 /**
29  * \class AsClusterDragonfly
30  *
31  * \brief Dragonfly representation and routing.
32  *
33  * Generate dragonfly according to the topology asked for, according to:
34  * Cray Cascade: a Scalable HPC System based on a Dragonfly Network
35  * Greg Faanes, Abdulla Bataineh, Duncan Roweth, Tom Court, Edwin Froese,
36  * Bob Alverson, Tim Johnson, Joe Kopnick, Mike Higgins and James Reinhard
37  * Cray Inc, Chippewa Falls, Wisconsin, USA
38  * or http://www.cray.com/sites/default/files/resources/CrayXCNetwork.pdf
39  *
40  * We use the same denomination for the different levels, with a Green,
41  * Black and Blue color scheme for the three different levels.
42  *
43  * Description of the topology has to be given with a string of type :
44  * "3,4;4,3;5,1;2"
45  *
46  * Last part  : "2"   : 2 nodes per blade
47  * Third part : "5,1" : five blades/routers per chassis, with one link between each (green network)
48  * Second part : "4,3" = four chassis per group, with three links between each nth router of each chassis (black
49  * network)
50  * First part : "3,4" = three electrical groups, linked in an alltoall
51  * pattern by 4 links each (blue network)
52  *
53  * LIMITATIONS (for now):
54  *  - Routing is only static and uses minimal routes.
55  *  - When n links are used between two routers/groups, we consider only one link with n times the bandwidth (needs to
56  * be validated on a real system)
57  *  - All links have the same characteristics for now
58  *  - Blue links are all attached to routers in the chassis n°0. This limits
59  *    the number of groups possible to the number of blades in a chassis. This
60  *    is also not realistic, as blue level can use more links than a single
61  *    Aries can handle, thus it should use several routers.
62  */
63 class XBT_PRIVATE AsClusterDragonfly : public AsCluster {
64 public:
65   explicit AsClusterDragonfly(As* father, const char* name);
66   ~AsClusterDragonfly() override;
67   //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
68   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
69   void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
70   void seal() override;
71   void generateRouters();
72   void generateLinks();
73   void createLink(char* id, int numlinks, Link** linkup, Link** linkdown);
74   unsigned int* rankId_to_coords(int rankId);
75
76 private:
77   sg_platf_cluster_cbarg_t cluster_;
78   unsigned int numNodesPerBlade_    = 0;
79   unsigned int numBladesPerChassis_ = 0;
80   unsigned int numChassisPerGroup_  = 0;
81   unsigned int numGroups_           = 0;
82   unsigned int numLinksGreen_       = 0;
83   unsigned int numLinksBlack_       = 0;
84   unsigned int numLinksBlue_        = 0;
85   unsigned int numLinksperLink_     = 1; // fullduplex -> 2, only for local link
86   DragonflyRouter** routers_        = nullptr;
87 };
88 }
89 }
90 }
91 #endif