X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f3a267e5ba376a0f0313767a12d518ffdeaa7196..84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6:/include/simgrid/kernel/routing/DragonflyZone.hpp?ds=sidebyside diff --git a/include/simgrid/kernel/routing/DragonflyZone.hpp b/include/simgrid/kernel/routing/DragonflyZone.hpp index 4bccc4ecab..adde19cf44 100644 --- a/include/simgrid/kernel/routing/DragonflyZone.hpp +++ b/include/simgrid/kernel/routing/DragonflyZone.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2014-2020. 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. */ @@ -7,6 +7,7 @@ #define SURF_ROUTING_CLUSTER_DRAGONFLY_HPP_ #include +#include namespace simgrid { namespace kernel { @@ -17,12 +18,11 @@ public: unsigned int group_; unsigned int chassis_; unsigned int blade_; - surf::LinkImpl** blue_links_ = nullptr; - surf::LinkImpl** black_links_ = nullptr; - surf::LinkImpl** green_links_ = nullptr; - surf::LinkImpl** my_nodes_ = nullptr; - DragonflyRouter(int i, int j, int k); - ~DragonflyRouter(); + resource::LinkImpl* blue_link_ = nullptr; + std::vector black_links_; + std::vector green_links_; + std::vector my_nodes_; + DragonflyRouter(unsigned group, unsigned chassis, unsigned blade) : group_(group), chassis_(chassis), blade_(blade) {} }; /** @ingroup ROUTING_API @@ -60,20 +60,22 @@ public: */ class XBT_PUBLIC DragonflyZone : public ClusterZone { public: - 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; + explicit DragonflyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel); void get_local_route(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(const std::string& id, int numlinks, surf::LinkImpl** linkup, surf::LinkImpl** linkdown); - void rankId_to_coords(int rankId, unsigned int (*coords)[4]); + void rankId_to_coords(int rank_id, unsigned int coords[4]); private: - ClusterCreationArgs* cluster_ = nullptr; + void generate_routers(); + void generate_links(); + void create_link(const std::string& id, int numlinks, resource::LinkImpl** linkup, resource::LinkImpl** linkdown); + + simgrid::s4u::Link::SharingPolicy sharing_policy_; + double bw_ = 0; + double lat_ = 0; + unsigned int num_nodes_per_blade_ = 0; unsigned int num_blades_per_chassis_ = 0; unsigned int num_chassis_per_group_ = 0; @@ -82,7 +84,7 @@ private: unsigned int num_links_black_ = 0; unsigned int num_links_blue_ = 0; unsigned int num_links_per_link_ = 1; // splitduplex -> 2, only for local link - DragonflyRouter** routers_ = nullptr; + std::vector routers_; }; } // namespace routing } // namespace kernel