X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0fa053f89a0b5f34a050f4790925d9d63ac11073..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/include/simgrid/kernel/routing/DragonflyZone.hpp diff --git a/include/simgrid/kernel/routing/DragonflyZone.hpp b/include/simgrid/kernel/routing/DragonflyZone.hpp index bb06b63e0c..dc15b66d9b 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-2021. 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_; - resource::LinkImpl** blue_links_ = nullptr; - resource::LinkImpl** black_links_ = nullptr; - resource::LinkImpl** green_links_ = nullptr; - resource::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,29 @@ 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; + struct Coords { + unsigned group; + unsigned chassis; + unsigned blade; + unsigned node; + }; + + 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, resource::LinkImpl** linkup, resource::LinkImpl** linkdown); - void rankId_to_coords(int rankId, unsigned int (*coords)[4]); + Coords rankId_to_coords(int rank_id) const; + XBT_ATTRIB_DEPRECATED_v330("Please use rankId_to_coords(int)") void rankId_to_coords(int rank_id, + unsigned int coords[4]) const; private: - e_surf_link_sharing_policy_t sharing_policy_; + void generate_routers(); + void generate_links(); + void generate_link(const std::string& id, int numlinks, resource::LinkImpl** linkup, + resource::LinkImpl** linkdown) const; + + simgrid::s4u::Link::SharingPolicy sharing_policy_ = simgrid::s4u::Link::SharingPolicy::SHARED; double bw_ = 0; double lat_ = 0; @@ -85,7 +94,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