Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
[simgrid.git] / include / simgrid / kernel / routing / TorusZone.hpp
1 /* Copyright (c) 2014-2023. 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 SIMGRID_ROUTING_CLUSTER_TORUS_HPP_
7 #define SIMGRID_ROUTING_CLUSTER_TORUS_HPP_
8
9 #include <simgrid/kernel/routing/ClusterZone.hpp>
10
11 #include <vector>
12
13 namespace simgrid::kernel::routing {
14
15 /** @ingroup ROUTING_API
16  * @brief NetZone using a Torus topology
17  *
18  */
19
20 class XBT_PRIVATE TorusZone : public ClusterBase {
21   std::vector<unsigned long> dimensions_;
22
23 public:
24   explicit TorusZone(const std::string& name) : ClusterBase(name){};
25   void create_torus_links(unsigned long id, int rank, unsigned long position);
26   void get_local_route(const NetPoint* src, const NetPoint* dst, Route* into, double* latency) override;
27   void set_topology(const std::vector<unsigned long>& dimensions);
28
29   /** @brief Convert topology parameters from string to vector of uint */
30   static std::vector<unsigned long> parse_topo_parameters(const std::string& topo_parameters);
31 };
32
33 } // namespace simgrid::kernel::routing
34 #endif