Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
9d6273e949b03a87c7faed9c5b28fdbdb11046b9
[simgrid.git] / include / simgrid / kernel / routing / TorusZone.hpp
1 /* Copyright (c) 2014-2021. 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_TORUS_HPP_
7 #define SURF_ROUTING_CLUSTER_TORUS_HPP_
8
9 #include <simgrid/kernel/routing/ClusterZone.hpp>
10
11 #include <vector>
12
13 namespace simgrid {
14 namespace kernel {
15 namespace routing {
16
17 /** @ingroup ROUTING_API
18  * @brief NetZone using a Torus topology
19  *
20  */
21
22 class XBT_PRIVATE TorusZone : public ClusterZone {
23   std::vector<unsigned int> dimensions_;
24   s4u::Link::SharingPolicy link_sharing_policy_; //!< torus links: sharing policy
25   double link_bw_;                               //!< torus links: bandwidth
26   double link_lat_;                              //!< torus links: latency
27
28 public:
29   using ClusterZone::ClusterZone;
30   void create_links(int id, int rank, unsigned int position);
31   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
32   void set_topology(const std::vector<unsigned int>& dimensions);
33
34   /** @brief Convert topology parameters from string to vector of uint */
35   static std::vector<unsigned int> parse_topo_parameters(const std::string& topo_parameters);
36   /** @brief Set the characteristics of links inside the Torus zone */
37   void set_link_characteristics(double bw, double lat, s4u::Link::SharingPolicy sharing_policy);
38 };
39
40 } // namespace routing
41 } // namespace kernel
42 } // namespace simgrid
43 #endif