/** Module management function: creates all internal data structures */
void sg_platf_init()
-{ /* Do nothing: just for symmetry of user code */
+{
+ simgrid::s4u::on_platform_created.connect(check_disk_attachment);
}
/** Module management function: frees all internal data structures */
void sg_platf_exit() {
simgrid::surf::on_cluster.disconnectSlots();
- simgrid::s4u::onPlatformCreated.disconnectSlots();
+ simgrid::s4u::on_platform_created.disconnectSlots();
/* 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)
- host->pimpl_cpu->setPState(args->pstate);
+ host->pimpl_cpu->set_pstate(args->pstate);
if (args->coord && strcmp(args->coord, ""))
new simgrid::kernel::routing::vivaldi::Coords(host->pimpl_netpoint, args->coord);
}
if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::base;
- xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->getNetpointByNameOrNull(name),
+ xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name),
"Refusing to create a router named '%s': this name already describes a node.", name.c_str());
simgrid::kernel::routing::NetPoint* netpoint =
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)
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;
}
}
/* 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);
}
-void sg_platf_begin() { /* Do nothing: just for symmetry of user code */ }
-
-void sg_platf_end() {
- simgrid::s4u::onPlatformCreated();
-}
-
/* Pick the right models for CPU, net and host, and call their model_init_preparse */
static void surf_config_models_setup()
{
simgrid::s4u::NetZone* sg_platf_new_Zone_begin(simgrid::kernel::routing::ZoneCreationArgs* zone)
{
if (not surf_parse_models_setup_already_called) {
+ simgrid::s4u::on_platform_creation();
+
/* Initialize the surf models. That must be done after we got all config, and before we need the models.
* That is, after the last <config> tag, if any, and before the first of cluster|peer|AS|trace|trace_connect
*
}
if (current_routing == nullptr) { /* it is the first one */
- xbt_assert(simgrid::s4u::Engine::get_instance()->pimpl->netzone_root_ == nullptr,
- "All defined components must belong to a networking zone.");
- simgrid::s4u::Engine::get_instance()->pimpl->netzone_root_ = new_zone;
-
+ simgrid::s4u::Engine::get_instance()->set_netzone_root(new_zone);
} else {
/* set the father behavior */
if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
/* set the new current component of the tree */
current_routing = new_zone;
-
simgrid::s4u::NetZone::onCreation(*new_zone); // notify the signal
return new_zone;