Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8396105b6a93f2d3f8e0a8072dea8c5a5abd499d
[simgrid.git] / src / surf / AsClusterDragonfly.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/surf/AsCluster.hpp"
10
11 namespace simgrid {
12   namespace surf {
13
14
15 class XBT_PRIVATE DragonflyRouter {
16     public:
17       int group_;
18       int chassis_;
19       int blade_;
20       Link** blueLinks_=NULL;
21       Link** blackLinks_=NULL;
22       Link** greenLinks_=NULL;
23       Link** myNodes_=NULL;
24       DragonflyRouter(int i, int j, int k);
25       ~DragonflyRouter();
26 };
27
28
29 class XBT_PRIVATE AsClusterDragonfly:public simgrid::surf::AsCluster {
30     public:
31       explicit AsClusterDragonfly(const char*name);
32       ~AsClusterDragonfly() override;
33 //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
34       void getRouteAndLatency(NetCard * src, NetCard * dst, sg_platf_route_cbarg_t into, double *latency) override;
35       void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
36       void seal() override;
37       void generateRouters();
38       void generateLinks();
39       void createLink(char* id, Link** linkup, Link** linkdown);
40       unsigned int * rankId_to_coords(int rankId);
41     private:
42       sg_platf_cluster_cbarg_t cluster_;
43       unsigned int numNodesPerBlade_ = 0;
44       unsigned int numBladesPerChassis_ = 0;
45       unsigned int numChassisPerGroup_ = 0;
46       unsigned int numGroups_ = 0;
47       unsigned int numLinksGreen_ = 0;
48       unsigned int numLinksBlack_ = 0;
49       unsigned int numLinksBlue_ = 0;
50       DragonflyRouter** routers_=NULL;
51     };
52
53   }}
54 #endif