* long path resolution times.
*/
class XBT_PRIVATE DijkstraZone : public RoutedZone {
-private:
static void route_graph_delete(xbt_graph_t);
std::unique_ptr<s_xbt_graph_t, decltype(&DijkstraZone::route_graph_delete)> route_graph_{
void do_seal() override;
public:
- DijkstraZone(const std::string& name, bool cached);
+ DijkstraZone(const std::string& name, bool cached) : RoutedZone(name), cached_(cached) {}
/* For each vertex (node) already in the graph,
* make sure it also has a loopback link; this loopback
class XBT_PRIVATE EmptyZone : public NetZoneImpl {
public:
- explicit EmptyZone(const std::string& name);
- ~EmptyZone() override;
+ explicit EmptyZone(const std::string& name) : NetZoneImpl(name) {}
+ ~EmptyZone() override = default;
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override
{
* Routing is made using a destination-mod-k scheme.
*/
class XBT_PRIVATE FatTreeZone : public ClusterZone {
-public:
- explicit FatTreeZone(const std::string& name);
- FatTreeZone(const FatTreeZone&) = delete;
- FatTreeZone& operator=(const FatTreeZone&) = delete;
- ~FatTreeZone() override;
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
-
- /** @brief Read the parameters in topo_parameters field.
- *
- * It will also store the cluster for future use.
- */
- void parse_specific_arguments(ClusterCreationArgs* cluster) override;
- void add_processing_node(int id);
- void generate_dot_file(const std::string& filename = "fat_tree.dot") const;
-
-private:
/** @brief Generate the fat tree
*
* Once all processing nodes have been added, this will make sure the fat
* tree is generated by calling generateLabels(), generateSwitches() and
* then connection all nodes between them, using their label.
*/
- void do_seal() override;
// description of a PGFT (TODO : better doc)
unsigned long levels_ = 0;
std::vector<unsigned int> num_children_per_node_; // number of children by node
int connect_node_to_parents(FatTreeNode* node);
bool are_related(FatTreeNode* parent, FatTreeNode* child) const;
bool is_in_sub_tree(FatTreeNode* root, FatTreeNode* node) const;
+
+ void do_seal() override;
+
+public:
+ explicit FatTreeZone(const std::string& name) : ClusterZone(name) {}
+ FatTreeZone(const FatTreeZone&) = delete;
+ FatTreeZone& operator=(const FatTreeZone&) = delete;
+ ~FatTreeZone() override;
+ void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+
+ /** @brief Read the parameters in topo_parameters field.
+ *
+ * It will also store the cluster for future use.
+ */
+ void parse_specific_arguments(ClusterCreationArgs* cluster) override;
+ void add_processing_node(int id);
+ void generate_dot_file(const std::string& filename = "fat_tree.dot") const;
};
} // namespace routing
} // namespace kernel
* (somewhere between the one of @{DijkstraZone} and the one of @{FullZone}).
*/
class XBT_PRIVATE FloydZone : public RoutedZone {
+ /* vars to compute the Floyd algorithm. */
+ std::vector<int> predecessor_table_;
+ std::vector<double> cost_table_;
+ std::vector<RouteCreationArgs*> link_table_;
+
+ void init_tables(unsigned int table_size);
+ void do_seal() override;
+
public:
- explicit FloydZone(const std::string& name);
+ explicit FloydZone(const std::string& name) : RoutedZone(name) {}
FloydZone(const FloydZone&) = delete;
FloydZone& operator=(const FloydZone&) = delete;
~FloydZone() override;
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
-
-private:
- /* vars to compute the Floyd algorithm. */
- std::vector<int> predecessor_table_;
- std::vector<double> cost_table_;
- std::vector<RouteCreationArgs*> link_table_;
-
- void init_tables(unsigned int table_size);
- void do_seal() override;
};
} // namespace routing
} // namespace kernel
*/
class XBT_PRIVATE FullZone : public RoutedZone {
public:
- explicit FullZone(const std::string& name);
+ explicit FullZone(const std::string& name) : RoutedZone(name){};
FullZone(const FullZone&) = delete;
FullZone& operator=(const FullZone) = delete;
~FullZone() override;
*/
class XBT_PRIVATE TorusZone : public ClusterZone {
+ std::vector<unsigned int> dimensions_;
+
public:
- explicit TorusZone(const std::string& name);
+ explicit TorusZone(const std::string& name) : ClusterZone(name){};
void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position) override;
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
void parse_specific_arguments(ClusterCreationArgs* cluster) override;
-
-private:
- std::vector<unsigned int> dimensions_;
};
} // namespace routing
} // namespace kernel
class XBT_PRIVATE VivaldiZone : public ClusterZone {
public:
- explicit VivaldiZone(const std::string& name);
+ explicit VivaldiZone(const std::string& name) : ClusterZone(name) {}
void set_peer_link(NetPoint* netpoint, double bw_in, double bw_out, const std::string& coord);
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
* That link is used for all communications within the zone.
*/
class XBT_PRIVATE WifiZone : public RoutedZone {
+ resource::LinkImpl* wifi_link_ = nullptr; // Representing the air media (there is no such thing in NS-3)
+ NetPoint* access_point_ = nullptr; // Zone's gateway to the external world
+
+ void do_seal() override;
+
public:
- explicit WifiZone(const std::string& name);
+ explicit WifiZone(const std::string& name) : RoutedZone(name){};
WifiZone(const WifiZone&) = delete;
WifiZone& operator=(const WifiZone) = delete;
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
s4u::Link* create_link(const std::string& name, const std::vector<double>& bandwidths,
s4u::Link::SharingPolicy policy) override;
- NetPoint* get_access_point() { return access_point_; }
-
-private:
- void do_seal() override;
- resource::LinkImpl* wifi_link_ = nullptr; // Representing the air media (there is no such thing in NS-3)
- NetPoint* access_point_ = nullptr; // Zone's gateway to the external world
+ NetPoint* get_access_point() const { return access_point_; }
};
} // namespace routing
} // namespace kernel
int graph_id_ = -1; /* used for caching internal graph id's */
};
-DijkstraZone::DijkstraZone(const std::string& name, bool cached) : RoutedZone(name), cached_(cached) {}
-
void DijkstraZone::route_graph_delete(xbt_graph_t g)
{
xbt_graph_free_graph(
namespace kernel {
namespace routing {
-EmptyZone::EmptyZone(const std::string& name) : NetZoneImpl(name) {}
-
-EmptyZone::~EmptyZone() = default;
-
void EmptyZone::get_graph(const s_xbt_graph_t* /*graph*/, std::map<std::string, xbt_node_t, std::less<>>* /*nodes*/,
std::map<std::string, xbt_edge_t, std::less<>>* /*edges*/)
{
namespace kernel {
namespace routing {
-FatTreeZone::FatTreeZone(const std::string& name) : ClusterZone(name)
-{
- XBT_DEBUG("Creating a new fat tree.");
-}
-
FatTreeZone::~FatTreeZone()
{
- for (FatTreeNode const* node : this->nodes_) {
+ for (FatTreeNode const* node : this->nodes_)
delete node;
- }
- for (FatTreeLink const* link : this->links_) {
+ for (FatTreeLink const* link : this->links_)
delete link;
- }
}
bool FatTreeZone::is_in_sub_tree(FatTreeNode* root, FatTreeNode* node) const
namespace kernel {
namespace routing {
-FloydZone::FloydZone(const std::string& name) : RoutedZone(name) {}
-
FloydZone::~FloydZone()
{
/* Delete link_table */
namespace simgrid {
namespace kernel {
namespace routing {
-FullZone::FullZone(const std::string& name) : RoutedZone(name) {}
void FullZone::do_seal()
{
namespace simgrid {
namespace kernel {
namespace routing {
-TorusZone::TorusZone(const std::string& name) : ClusterZone(name) {}
void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position)
{
return &coords->coords;
}
-VivaldiZone::VivaldiZone(const std::string& name) : ClusterZone(name) {}
-
void VivaldiZone::set_peer_link(NetPoint* netpoint, double bw_in, double bw_out, const std::string& coord)
{
xbt_assert(netpoint->get_englobing_zone() == this,
namespace simgrid {
namespace kernel {
namespace routing {
-WifiZone::WifiZone(const std::string& name) : RoutedZone(name) {}
void WifiZone::do_seal()
{
}
}
}
+
s4u::Link* WifiZone::create_link(const std::string& name, const std::vector<double>& bandwidths,
s4u::Link::SharingPolicy policy)
{