e.load_platform(argv[1]);
/* - Display Host properties */
- for (auto h : e.get_all_hosts()) {
+ for (auto const* h : e.get_all_hosts()) {
XBT_INFO("*** %s properties ****", h->get_cname());
for (auto const& [key, value] : *h->get_properties())
XBT_INFO(" %s -> %s", key.c_str(), value.c_str());
std::vector<simgrid::kernel::routing::ClusterZone*> clusters =
e.get_filtered_netzones<simgrid::kernel::routing::ClusterZone>();
- for (auto c : clusters) {
+ for (auto const* c : clusters) {
XBT_INFO("%s", c->get_cname());
std::vector<sg4::Host*> hosts = c->get_all_hosts();
- for (auto h : hosts)
+ for (auto const* h : hosts)
XBT_INFO(" %s", h->get_cname());
}
std::vector<simgrid::kernel::routing::DragonflyZone*> dragonfly_clusters =
e.get_filtered_netzones<simgrid::kernel::routing::DragonflyZone>();
- for (auto d : dragonfly_clusters) {
+ for (auto const* d : dragonfly_clusters) {
XBT_INFO("%s' dragonfly topology:", d->get_cname());
for (size_t i = 0; i < d->get_host_count(); i++) {
const simgrid::kernel::routing::DragonflyZone::Coords coords = d->rankId_to_coords(i);
xbt_assert(models_prio_.find(model_name) == models_prio_.end(),
"Model %s already exists, use model.set_name() to change its name", model_name.c_str());
- for (const auto dep : dependencies) {
+ for (const auto* dep : dependencies) {
xbt_assert(models_prio_.find(dep->get_name()) != models_prio_.end(),
"Model %s doesn't exists. Impossible to use it as dependency.", dep->get_name().c_str());
}
// For each enabled transition in the property automaton, push a
// (application_state, automaton_state) pair to the exploration stack:
for (int i = xbt_dynar_length(current_pair->automaton_state->out) - 1; i >= 0; i--) {
- auto transition_succ_label = Api::get().get_automaton_transition_label(current_pair->automaton_state->out, i);
- auto transition_succ_dst = Api::get().get_automaton_transition_dst(current_pair->automaton_state->out, i);
+ const auto* transition_succ_label =
+ Api::get().get_automaton_transition_label(current_pair->automaton_state->out, i);
+ auto* transition_succ_dst = Api::get().get_automaton_transition_dst(current_pair->automaton_state->out, i);
if (evaluate_label(transition_succ_label, *prop_values))
exploration_stack_.push_back(this->create_pair(current_pair.get(), transition_succ_dst, prop_values));
}
// in case no fullpath is provided ... just pick the first mountpoint.
if (size_t found = fullname.find('/'); found == std::string::npos || fullname.rfind("./", 1) != std::string::npos) {
- auto disk = simgrid::s4u::Host::current()->get_disks().front();
+ const auto* disk = simgrid::s4u::Host::current()->get_disks().front();
std::string mount;
if (disk->get_host() != simgrid::s4u::Host::current())
mount = disk->extension<simgrid::s4u::FileSystemDiskExt>()->get_mount_point(disk->get_host());
double angle = 0;
auto nb_stations = static_cast<double>(wifizone->get_all_hosts().size() - 1);
double step = 2 * M_PI / nb_stations;
- for (auto station_host : wifizone->get_all_hosts()) {
+ for (const auto* station_host : wifizone->get_all_hosts()) {
station_netpoint_ns3 = station_host->get_netpoint()->extension<NetPointNs3>();
if (station_netpoint_ns3 == access_point_netpoint_ns3)
continue;
std::sort(hosts.begin(), hosts.end(),
[](const sg4::Host* a, const sg4::Host* b) { return a->get_name() < b->get_name(); });
- for (auto h : hosts) {
+ for (auto const* h : hosts) {
std::printf(" <host id=\"%s\" speed=\"%.0f\"", h->get_cname(), h->get_speed());
const std::unordered_map<std::string, std::string>* props = h->get_properties();
if (h->get_core_count() > 1) {
std::sort(links.begin(), links.end(),
[](const sg4::Link* a, const sg4::Link* b) { return a->get_name() < b->get_name(); });
- for (auto link : links) {
+ for (auto const* link : links) {
std::printf(" <link id=\"");
std::printf("%s\" bandwidth=\"%.0f\" latency=\"%.9f\"", link->get_cname(), link->get_bandwidth(),
return a->get_name() < b->get_name();
});
- for (auto src_host : hosts) { // Routes from host
+ for (auto const* src_host : hosts) { // Routes from host
const simgrid::kernel::routing::NetPoint* src = src_host->get_netpoint();
- for (auto dst_host : hosts) { // Routes to host
+ for (auto const* dst_host : hosts) { // Routes to host
std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
const simgrid::kernel::routing::NetPoint* dst = dst_host->get_netpoint();
simgrid::kernel::routing::NetZoneImpl::get_global_route(src, dst, route, nullptr);
std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");
}
- for (auto dst_host : hosts) { // Routes to host
+ for (auto const* dst_host : hosts) { // Routes to host
std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->get_cname(), dst_host->get_cname());
std::vector<simgrid::kernel::resource::StandardLinkImpl*> route;
const simgrid::kernel::routing::NetPoint* netcardDst = dst_host->get_netpoint();
h1->route_to(h2, route, &latency);
XBT_INFO("Route size %zu", route.size());
- for (auto link: route) {
+ for (auto const* link : route) {
double bandwidth = link->get_bandwidth();
XBT_INFO(" Link %s: latency = %f, bandwidth = %f", link->get_cname(), link->get_latency(), bandwidth);
if (bandwidth < min_bandwidth || min_bandwidth < 0.0)
h1->route_to(h2, route, &latency);
XBT_INFO(" Route size %zu", route.size());
- for (auto link: route) {
+ for (auto const* link : route) {
double bandwidth = link->get_bandwidth();
XBT_INFO(" Link %s: latency = %f, bandwidth = %f", link->get_cname(), link->get_latency(), bandwidth);
if (bandwidth < min_bandwidth || min_bandwidth < 0.0)