Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar don't like comments ending with ';'
[simgrid.git] / src / kernel / routing / DragonflyZone.hpp
index 2cc15a5..70d85de 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -12,15 +12,15 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-class XBT_PRIVATE DragonflyRouter {
+class DragonflyRouter {
 public:
   unsigned int group_;
   unsigned int chassis_;
   unsigned int blade_;
-  surf::Link** blueLinks_  = nullptr;
-  surf::Link** blackLinks_ = nullptr;
-  surf::Link** greenLinks_ = nullptr;
-  surf::Link** myNodes_    = nullptr;
+  surf::LinkImpl** blueLinks_  = nullptr;
+  surf::LinkImpl** blackLinks_ = nullptr;
+  surf::LinkImpl** greenLinks_ = nullptr;
+  surf::LinkImpl** myNodes_    = nullptr;
   DragonflyRouter(int i, int j, int k);
   ~DragonflyRouter();
 };
@@ -58,21 +58,22 @@ public:
  *    is also not realistic, as blue level can use more links than a single
  *    Aries can handle, thus it should use several routers.
  */
-class XBT_PRIVATE DragonflyZone : public ClusterZone {
+class DragonflyZone : public ClusterZone {
 public:
-  explicit DragonflyZone(NetZone* father, const char* name);
+  explicit DragonflyZone(NetZone* father, std::string name);
   ~DragonflyZone() override;
   //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
-  void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
-  void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
+  void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+  void parse_specific_arguments(ClusterCreationArgs* cluster) override;
   void seal() override;
   void generateRouters();
   void generateLinks();
-  void createLink(char* id, int numlinks, Link** linkup, Link** linkdown);
-  unsigned int* rankId_to_coords(int rankId);
+  void createLink(const std::string& id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown);
+
+  void rankId_to_coords(int rankId, unsigned int (*coords)[4]);
 
 private:
-  sg_platf_cluster_cbarg_t cluster_;
+  ClusterCreationArgs* cluster_     = nullptr;
   unsigned int numNodesPerBlade_    = 0;
   unsigned int numBladesPerChassis_ = 0;
   unsigned int numChassisPerGroup_  = 0;
@@ -80,7 +81,7 @@ private:
   unsigned int numLinksGreen_       = 0;
   unsigned int numLinksBlack_       = 0;
   unsigned int numLinksBlue_        = 0;
-  unsigned int numLinksperLink_     = 1; // fullduplex -> 2, only for local link
+  unsigned int numLinksperLink_     = 1; // splitduplex -> 2, only for local link
   DragonflyRouter** routers_        = nullptr;
 };
 }