Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New example: Torus cluster of multi-cpu hosts(Star Zones)
[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
25 public:
26   using ClusterZone::ClusterZone;
27   void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position) override;
28   void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
29   void parse_specific_arguments(ClusterCreationArgs* cluster) override;
30   void set_topology(const std::vector<unsigned int>& dimensions);
31
32   /** @brief Convert topology parameters from string to vector of uint */
33   static std::vector<unsigned int> parse_topo_parameters(const std::string& topo_parameters);
34 };
35
36 /** @brief Create a regular torus zone with hosts as leafs */
37 s4u::NetZone* create_torus_zone_with_hosts(const ClusterCreationArgs* cluster, const s4u::NetZone* parent);
38
39 } // namespace routing
40 } // namespace kernel
41 } // namespace simgrid
42 #endif