-/* Copyright (c) 2010-2022. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/instr/instr_private.hpp"
#include "src/kernel/resource/CpuImpl.hpp"
#include "src/kernel/resource/NetworkModel.hpp"
-#include "src/surf/surf_interface.hpp"
#include <fstream>
std::string instr_pid(simgrid::s4u::Actor const& proc)
{
- return std::string(proc.get_name()) + "-" + std::to_string(proc.get_pid());
+ return proc.get_name() + "-" + std::to_string(proc.get_pid());
}
static simgrid::instr::Container* lowestCommonAncestor(const simgrid::instr::Container* a1,
simgrid::instr::Type* root)
{
if (root->get_name() == "HOST" || root->get_name() == "VM")
- root->by_name_or_create(std::string("p") + new_typename, color);
+ root->by_name_or_create("p" + new_typename, color);
if (root->get_name() == "LINK")
- root->by_name_or_create(std::string("b") + new_typename, color);
+ root->by_name_or_create("b" + new_typename, color);
for (auto const& [_, child] : root->get_children()) {
recursiveNewVariableType(new_typename, color, child.get());
s4u::Link::on_bandwidth_change_cb([](s4u::Link const& link) {
Container::by_name(link.get_name())
->get_variable("bandwidth")
- ->set_event(simgrid_get_clock(), sg_bandwidth_factor * link.get_bandwidth());
+ ->set_event(
+ simgrid_get_clock(),
+ static_cast<kernel::resource::NetworkModel*>(link.get_impl()->get_model())->get_bandwidth_factor() *
+ link.get_bandwidth());
});
- s4u::NetZone::on_seal_cb([](s4u::NetZone const& /*netzone*/) { currentContainer.pop_back(); });
kernel::routing::NetPoint::on_creation.connect([](kernel::routing::NetPoint const& netpoint) {
if (netpoint.is_router())
new RouterContainer(netpoint.get_name(), currentContainer.back());
if (TRACE_smpi_is_enabled() && TRACE_smpi_is_computing()) {
s4u::Exec::on_start_cb([](s4u::Exec const& exec) {
- Container::by_name(std::string("rank-") + std::to_string(s4u::Actor::self()->get_pid()))
+ Container::by_name("rank-" + std::to_string(s4u::Actor::self()->get_pid()))
->get_state("MPI_STATE")
->push_event("computing", new CpuTIData("compute", exec.get_cost()));
});
s4u::Activity::on_completion_cb([](const s4u::Activity&) {
- Container::by_name(std::string("rank-") + std::to_string(s4u::Actor::self()->get_pid()))
- ->get_state("MPI_STATE")
- ->pop_event();
+ Container::by_name("rank-" + std::to_string(s4u::Actor::self()->get_pid()))->get_state("MPI_STATE")->pop_event();
});
}