/* make sure that we will reinit the models while loading the platf once reinited */
surf_parse_models_setup_already_called = 0;
+ surf_parse_lex_destroy();
}
/** @brief Add an "host" to the current AS */
if (current_routing->hierarchy_ == SURF_ROUTING_NULL)
current_routing->hierarchy_ = SURF_ROUTING_BASE;
- xbt_assert(!xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL),
- "Reading a router, processing unit \"%s\" already exists",
- router->id);
+ xbt_assert(nullptr == xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL),
+ "Refusing to create a router named '%s': this name already describes a node.", router->id);
- simgrid::surf::NetCard *info = new simgrid::surf::NetCardImpl(router->id, SURF_NETWORK_ELEMENT_ROUTER, current_routing);
- info->setId(current_routing->addComponent(info));
- xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, (void *) info);
- XBT_DEBUG("Having set name '%s' id '%d'", router->id, info->id());
- simgrid::surf::netcardCreatedCallbacks(info);
+ simgrid::surf::NetCard *netcard = new simgrid::surf::NetCardImpl(router->id, SURF_NETWORK_ELEMENT_ROUTER, current_routing);
+ netcard->setId(current_routing->addComponent(netcard));
+ xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, (void *) netcard);
+ XBT_DEBUG("Having set name '%s' id '%d'", router->id, netcard->id());
+ simgrid::surf::netcardCreatedCallbacks(netcard);
if (router->coord && strcmp(router->coord, "")) {
unsigned int cursor;
void sg_platf_new_bypassRoute(sg_platf_route_cbarg_t bypassRoute)
{
- routing_get_current()->parseBypassroute(bypassRoute);
+ routing_get_current()->addBypassRoute(bypassRoute);
}
void sg_platf_new_process(sg_platf_process_cbarg_t process)