std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
- static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
+ static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->get_graph(graph, nodes, edges);
for (auto elm : *edges) {
xbt_edge_t edge = elm.second;
linkContainers(simgrid::instr::Container::byName(static_cast<const char*>(edge->src->data)),
/*
* Callbacks
*/
-static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
+static void instr_netzone_on_creation(simgrid::s4u::NetZone& netzone)
{
std::string id = netzone.get_name();
if (not TRACE_smpi_is_grouped())
mpi->getOrCreateStateType("MPI_STATE");
root->type_->getOrCreateLinkType("MPI_LINK", mpi, mpi);
+ // TODO See if we can move this to the LoadBalancer plugin
+ root->type_->getOrCreateLinkType("MIGRATE_LINK", mpi, mpi);
+ mpi->getOrCreateStateType("MIGRATE_STATE");
}
if (TRACE_needs_platform()){
}
}
-static void sg_instr_AS_end(simgrid::s4u::NetZone& /*netzone*/)
+static void instr_netzone_on_seal(simgrid::s4u::NetZone& /*netzone*/)
{
if (TRACE_needs_platform()){
currentContainer.pop_back();
}
}
-static void instr_routing_parse_start_link(simgrid::s4u::Link& link)
+static void instr_link_on_creation(simgrid::s4u::Link& link)
{
if (currentContainer.empty()) // No ongoing parsing. Are you creating the loopback?
return;
}
}
-static void sg_instr_new_host(simgrid::s4u::Host& host)
+static void instr_host_on_creation(simgrid::s4u::Host& host)
{
container_t container = new simgrid::instr::HostContainer(host, currentContainer.back());
container_t root = simgrid::instr::Container::getRoot();
if (TRACE_uncategorized())
container->type_->getOrCreateVariableType("power_used", "0.5 0.5 0.5");
- if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped())
- container->type_->getOrCreateContainerType("MPI")->getOrCreateStateType("MPI_STATE");
+ if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()) {
+ simgrid::instr::ContainerType* mpi = container->type_->getOrCreateContainerType("MPI");
+ mpi->getOrCreateStateType("MPI_STATE");
+ // TODO See if we can move this to the LoadBalancer plugin
+ root->type_->getOrCreateLinkType("MIGRATE_LINK", mpi, mpi);
+ mpi->getOrCreateStateType("MIGRATE_STATE");
+ }
if (TRACE_actor_is_enabled()) {
simgrid::instr::ContainerType* actor = container->type_->getOrCreateContainerType("ACTOR");
}
}
-static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint)
+static void instr_netpoint_on_creation(simgrid::kernel::routing::NetPoint* netpoint)
{
- if (netpoint->isRouter() && TRACE_is_enabled() && TRACE_needs_platform())
+ if (netpoint->is_router() && TRACE_is_enabled() && TRACE_needs_platform())
new simgrid::instr::RouterContainer(netpoint->get_cname(), currentContainer.back());
}
-static void instr_routing_parse_end_platform ()
+static void instr_on_platform_created()
{
currentContainer.clear();
std::set<std::string>* filter = new std::set<std::string>;
TRACE_paje_dump_buffer(true);
}
-void instr_routing_define_callbacks ()
+void instr_routing_define_callbacks()
{
- // always need the callbacks to ASes (we need only the root AS), to create the rootContainer and the rootType properly
- if (not TRACE_is_enabled())
- return;
+ // always need the callbacks to zones (we need only the root zone), to create the rootContainer and the rootType
+ // properly
if (TRACE_needs_platform()) {
- simgrid::s4u::Link::onCreation.connect(instr_routing_parse_start_link);
- simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform);
- simgrid::s4u::Host::onCreation.connect(sg_instr_new_host);
+ simgrid::s4u::Host::onCreation.connect(instr_host_on_creation);
+ simgrid::s4u::Link::onCreation.connect(instr_link_on_creation);
+ simgrid::s4u::onPlatformCreated.connect(instr_on_platform_created);
}
- simgrid::s4u::NetZone::onCreation.connect(sg_instr_AS_begin);
- simgrid::s4u::NetZone::onSeal.connect(sg_instr_AS_end);
- simgrid::kernel::routing::NetPoint::onCreation.connect(sg_instr_new_router);
+ simgrid::s4u::NetZone::onCreation.connect(instr_netzone_on_creation);
+ simgrid::s4u::NetZone::onSeal.connect(instr_netzone_on_seal);
+ simgrid::kernel::routing::NetPoint::onCreation.connect(instr_netpoint_on_creation);
}
/*
* user categories support
}
}
- static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
+ static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->get_graph(graph, nodes, edges);
}
xbt_graph_t instr_routing_platform_graph ()