// create an array with all ancestors of a1
std::vector<simgrid::instr::Container*> ancestors_a1;
- simgrid::instr::Container* p = a1->father_;
- while (p) {
+ for (auto* p = a1->father_; p != nullptr; p = p->father_)
ancestors_a1.push_back(p);
- p = p->father_;
- }
// create an array with all ancestors of a2
std::vector<simgrid::instr::Container*> ancestors_a2;
- p = a2->father_;
- while (p) {
+ for (auto* p = a2->father_; p != nullptr; p = p->father_)
ancestors_a2.push_back(p);
- p = p->father_;
- }
// find the lowest ancestor
- p = nullptr;
+ simgrid::instr::Container* p = nullptr;
int i = static_cast<int>(ancestors_a1.size()) - 1;
int j = static_cast<int>(ancestors_a2.size()) - 1;
while (i >= 0 && j >= 0) {
std::map<std::string, xbt_edge_t> edges;
netzone->get_impl()->get_graph(graph, &nodes, &edges);
- for (auto elm : edges) {
+ for (auto const& elm : edges) {
const xbt_edge* edge = elm.second;
linkContainers(simgrid::instr::Container::by_name(static_cast<const char*>(edge->src->data)),
simgrid::instr::Container::by_name(static_cast<const char*>(edge->dst->data)), filter);
if (not TRACE_smpi_is_grouped())
mpi->by_name_or_create<StateType>("MPI_STATE");
root->type_->by_name_or_create("MPI_LINK", mpi, mpi);
- // TODO See if we can move this to the LoadBalancer plugin
root->type_->by_name_or_create("MIGRATE_LINK", mpi, mpi);
mpi->by_name_or_create<StateType>("MIGRATE_STATE");
}
if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()) {
auto* mpi = container->type_->by_name_or_create<ContainerType>("MPI");
mpi->by_name_or_create<StateType>("MPI_STATE");
- // TODO See if we can move this to the LoadBalancer plugin
root->type_->by_name_or_create("MIGRATE_LINK", mpi, mpi);
mpi->by_name_or_create<StateType>("MIGRATE_STATE");
}