/** Module management function: frees all internal data structures */
void sg_platf_exit() {
- simgrid::surf::on_cluster.disconnectSlots();
- simgrid::s4u::on_platform_created.disconnectSlots();
+ simgrid::surf::on_cluster.disconnect_slots();
+ simgrid::s4u::on_platform_created.disconnect_slots();
/* make sure that we will reinit the models while loading the platf once reinited */
surf_parse_models_setup_already_called = 0;
/* Change from the defaults */
if (args->state_trace)
- host->pimpl_cpu->setStateTrace(args->state_trace);
+ host->pimpl_cpu->set_state_trace(args->state_trace);
if (args->speed_trace)
host->pimpl_cpu->set_speed_trace(args->speed_trace);
if (args->pstate != 0)
if (link->properties) {
for (auto const& elm : *link->properties)
- l->setProperty(elm.first, elm.second);
+ l->set_property(elm.first, elm.second);
}
if (link->latency_trace)
- l->setLatencyTrace(link->latency_trace);
+ l->set_latency_trace(link->latency_trace);
if (link->bandwidth_trace)
- l->setBandwidthTrace(link->bandwidth_trace);
+ l->set_bandwidth_trace(link->bandwidth_trace);
if (link->state_trace)
- l->setStateTrace(link->state_trace);
+ l->set_state_trace(link->state_trace);
}
delete link->properties;
}
simgrid::kernel::routing::HostCreationArgs host;
host.id = host_id.c_str();
if ((cluster->properties != nullptr) && (not cluster->properties->empty())) {
- host.properties = new std::map<std::string, std::string>;
+ host.properties = new std::unordered_map<std::string, std::string>;
for (auto const& elm : *cluster->properties)
host.properties->insert({elm.first, elm.second});
// other columns are to store one or more link for the node
//add a loopback link
- simgrid::kernel::resource::LinkImpl* linkUp = nullptr;
- simgrid::kernel::resource::LinkImpl* linkDown = nullptr;
+ simgrid::s4u::Link* linkUp = nullptr;
+ simgrid::s4u::Link* linkDown = nullptr;
if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
std::string tmp_link = link_id + "_loopback";
XBT_DEBUG("<loopback\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->loopback_bw);
link.latency = cluster->loopback_lat;
link.policy = simgrid::s4u::Link::SharingPolicy::FATPIPE;
sg_platf_new_link(&link);
- linkUp = simgrid::kernel::resource::LinkImpl::byName(tmp_link);
- linkDown = simgrid::kernel::resource::LinkImpl::byName(tmp_link);
+ linkUp = simgrid::s4u::Link::by_name_or_null(tmp_link);
+ linkDown = simgrid::s4u::Link::by_name_or_null(tmp_link);
auto* as_cluster = static_cast<ClusterZone*>(current_as);
- as_cluster->private_links_.insert({as_cluster->node_pos(rankId), {linkUp, linkDown}});
+ as_cluster->private_links_.insert({as_cluster->node_pos(rankId), {linkUp->get_impl(), linkDown->get_impl()}});
}
//add a limiter link (shared link to account for maximal bandwidth of the node)
link.latency = 0;
link.policy = simgrid::s4u::Link::SharingPolicy::SHARED;
sg_platf_new_link(&link);
- linkDown = simgrid::kernel::resource::LinkImpl::byName(tmp_link);
+ linkDown = simgrid::s4u::Link::by_name_or_null(tmp_link);
linkUp = linkDown;
- current_as->private_links_.insert({current_as->node_pos_with_loopback(rankId), {linkUp, linkDown}});
+ current_as->private_links_.insert(
+ {current_as->node_pos_with_loopback(rankId), {linkUp->get_impl(), linkDown->get_impl()}});
}
//call the cluster function that adds the others links
XBT_DEBUG("<link\tid=\"%s\" bw=\"%f\" lat=\"%f\"/>", link.id.c_str(), cluster->bb_bw, cluster->bb_lat);
sg_platf_new_link(&link);
- routing_cluster_add_backbone(simgrid::kernel::resource::LinkImpl::byName(link.id));
+ routing_cluster_add_backbone(simgrid::s4u::Link::by_name(link.id)->get_impl());
}
XBT_DEBUG("</AS>");
if (storage->properties) {
for (auto const& elm : *storage->properties)
- s->setProperty(elm.first, elm.second);
+ s->set_property(elm.first, elm.second);
delete storage->properties;
}
}
if (mount_list.empty())
XBT_DEBUG("Create a Mount list for %s", A_surfxml_host_id);
- mount_list.insert({mount->name, simgrid::s4u::Engine::get_instance()->storage_by_name(mount->storageId)->getImpl()});
+ mount_list.insert({mount->name, simgrid::s4u::Engine::get_instance()->storage_by_name(mount->storageId)->get_impl()});
}
void sg_platf_new_route(simgrid::kernel::routing::RouteCreationArgs* route)
std::string actor_name = actor->args[0];
std::function<void()> code = factory(std::move(actor->args));
- std::shared_ptr<std::map<std::string, std::string>> properties(actor->properties);
+ std::shared_ptr<std::unordered_map<std::string, std::string>> properties(actor->properties);
simgrid::kernel::actor::ProcessArg* arg =
new simgrid::kernel::actor::ProcessArg(actor_name, code, nullptr, host, kill_time, properties, auto_restart);
speedPerPstate.push_back(peer->speed);
simgrid::s4u::Host* host = as->create_host(peer->id.c_str(), &speedPerPstate, 1, nullptr);
- as->setPeerLink(host->pimpl_netpoint, peer->bw_in, peer->bw_out, peer->coord);
+ as->set_peer_link(host->pimpl_netpoint, peer->bw_in, peer->bw_out, peer->coord);
/* Change from the defaults */
if (peer->state_trace)
- host->pimpl_cpu->setStateTrace(peer->state_trace);
+ host->pimpl_cpu->set_state_trace(peer->state_trace);
if (peer->speed_trace)
host->pimpl_cpu->set_speed_trace(peer->speed_trace);
}
*
* @param zone the parameters defining the Zone to build.
*/
-simgrid::s4u::NetZone* sg_platf_new_Zone_begin(simgrid::kernel::routing::ZoneCreationArgs* zone)
+simgrid::kernel::routing::NetZoneImpl* sg_platf_new_Zone_begin(simgrid::kernel::routing::ZoneCreationArgs* zone)
{
if (not surf_parse_models_setup_already_called) {
simgrid::s4u::on_platform_creation();
}
if (current_routing == nullptr) { /* it is the first one */
- simgrid::s4u::Engine::get_instance()->set_netzone_root(new_zone);
+ simgrid::s4u::Engine::get_instance()->set_netzone_root(new_zone->get_iface());
} else {
/* set the father behavior */
if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::recursive;
/* add to the sons dictionary */
- current_routing->getChildren()->push_back(static_cast<simgrid::s4u::NetZone*>(new_zone));
+ current_routing->get_children()->push_back(new_zone);
}
/* set the new current component of the tree */
current_routing = new_zone;
- simgrid::s4u::NetZone::onCreation(*new_zone); // notify the signal
+ simgrid::s4u::NetZone::on_creation(*new_zone->get_iface()); // notify the signal
return new_zone;
}
{
xbt_assert(current_routing, "Cannot seal the current AS: none under construction");
current_routing->seal();
- simgrid::s4u::NetZone::onSeal(*current_routing);
- current_routing = static_cast<simgrid::kernel::routing::NetZoneImpl*>(current_routing->getFather());
+ simgrid::s4u::NetZone::on_seal(*current_routing->get_iface());
+ current_routing = static_cast<simgrid::kernel::routing::NetZoneImpl*>(current_routing->get_father());
}
/** @brief Add a link connecting an host to the rest of its AS (which must be cluster or vivaldi) */
xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
"Only hosts from Cluster and Vivaldi ASes can get an host_link.");
- simgrid::kernel::resource::LinkImpl* linkUp = simgrid::kernel::resource::LinkImpl::byName(hostlink->link_up);
- simgrid::kernel::resource::LinkImpl* linkDown = simgrid::kernel::resource::LinkImpl::byName(hostlink->link_down);
+ simgrid::s4u::Link* linkUp = simgrid::s4u::Link::by_name_or_null(hostlink->link_up);
+ simgrid::s4u::Link* linkDown = simgrid::s4u::Link::by_name_or_null(hostlink->link_down);
xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up.c_str());
xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down.c_str());
surf_parse_error(std::string("Host_link for '") + hostlink->id.c_str() + "' is already defined!");
XBT_DEBUG("Push Host_link for host '%s' to position %u", netpoint->get_cname(), netpoint->id());
- as_cluster->private_links_.insert({netpoint->id(), {linkUp, linkDown}});
+ as_cluster->private_links_.insert({netpoint->id(), {linkUp->get_impl(), linkDown->get_impl()}});
}
void sg_platf_new_trace(simgrid::kernel::routing::TraceCreationArgs* trace)