1 /* Copyright (c) 2014-2022. The SimGrid Team. All rights reserved. */
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. */
6 #ifndef SURF_ROUTING_CLUSTER_TORUS_HPP_
7 #define SURF_ROUTING_CLUSTER_TORUS_HPP_
9 #include <simgrid/kernel/routing/ClusterZone.hpp>
17 /** @ingroup ROUTING_API
18 * @brief NetZone using a Torus topology
22 class XBT_PRIVATE TorusZone : public ClusterBase {
23 std::vector<unsigned long> dimensions_;
26 explicit TorusZone(const std::string& name) : ClusterBase(name){};
27 void create_torus_links(unsigned long id, int rank, unsigned long position);
28 void get_local_route(const NetPoint* src, const NetPoint* dst, Route* into, double* latency) override;
29 void set_topology(const std::vector<unsigned long>& dimensions);
31 /** @brief Convert topology parameters from string to vector of uint */
32 static std::vector<unsigned long> parse_topo_parameters(const std::string& topo_parameters);
35 } // namespace routing
37 } // namespace simgrid