xbt_node_t route_graph_new_node(int id);
xbt_node_t node_map_search(int id);
void new_edge(int src_id, int dst_id, RouteCreationArgs* e_route);
+ void do_seal() override;
public:
DijkstraZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel, bool cached);
* After this function returns, any node in the graph
* will have a loopback attached to it.
*/
- void seal() override;
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override;
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
explicit DragonflyZone(NetZoneImpl* father, const std::string& name, resource::NetworkModel* netmodel);
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
void parse_specific_arguments(ClusterCreationArgs* cluster) override;
- void seal() override;
Coords rankId_to_coords(int rank_id) const;
XBT_ATTRIB_DEPRECATED_v330("Please use rankId_to_coords(int)") void rankId_to_coords(int rank_id,
unsigned int coords[4]) const;
private:
+ void do_seal() override;
void generate_routers();
void generate_links();
void generate_link(const std::string& id, int numlinks, resource::LinkImpl** linkup,
~FatTreeZone() override;
void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
- /** @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 seal() override;
/** @brief Read the parameters in topo_parameters field.
*
* It will also store the cluster for future use.
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
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;
- void seal() override;
private:
/* vars to compute the Floyd algorithm. */
std::vector<RouteCreationArgs*> link_table_;
void init_tables(unsigned int table_size);
+ void do_seal() override;
};
} // namespace routing
} // namespace kernel
FullZone& operator=(const FullZone) = delete;
~FullZone() override;
- void seal() 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:
std::vector<RouteCreationArgs*> routing_table_;
+ void do_seal() override;
};
} // namespace routing
} // namespace kernel
resource::CpuModel* cpu_model_pm_;
resource::DiskModel* disk_model_;
simgrid::surf::HostModel* host_model_;
+ /** @brief Perform sealing procedure for derived classes, if necessary */
+ virtual void do_seal(){};
protected:
explicit NetZoneImpl(NetZoneImpl* father, const std::string& name, resource::NetworkModel* network_model);
std::vector<resource::LinkImpl*>& link_list, bool symmetrical);
/** @brief Seal your netzone once you're done adding content, and before routing stuff through it */
- virtual void seal() { sealed_ = true; };
+ void seal();
virtual int add_component(kernel::routing::NetPoint* elm); /* A host, a router or a netzone, whatever */
virtual void add_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
WifiZone(const WifiZone&) = delete;
WifiZone& operator=(const WifiZone) = delete;
- void seal() override;
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
};
[](void* e) { delete static_cast<simgrid::kernel::routing::RouteCreationArgs*>(e); }, nullptr);
}
-void DijkstraZone::seal()
+void DijkstraZone::do_seal()
{
unsigned int cursor;
xbt_node_t node = nullptr;
}
/* Generate the cluster once every node is created */
-void DragonflyZone::seal()
+void DragonflyZone::do_seal()
{
if (this->num_nodes_per_blade_ == 0) {
return;
/* This function makes the assumption that parse_specific_arguments() and
* addNodes() have already been called
*/
-void FatTreeZone::seal()
+void FatTreeZone::do_seal()
{
if (this->levels_ == 0) {
return;
}
}
-void FloydZone::seal()
+void FloydZone::do_seal()
{
/* set the size of table routing */
unsigned int table_size = get_table_size();
{
}
-void FullZone::seal()
+void FullZone::do_seal()
{
unsigned int table_size = get_table_size();
if (route.gw_dst != dst)
get_global_route(route.gw_dst, dst, links, latency);
}
+
+void NetZoneImpl::seal()
+{
+ do_seal(); // derived class' specific sealing procedure
+ sealed_ = true;
+}
+
} // namespace routing
} // namespace kernel
} // namespace simgrid
{
}
-void WifiZone::seal()
+void WifiZone::do_seal()
{
const char* AP_name = get_property("access_point");
if (AP_name != nullptr) {