#include "src/surf/HostImpl.hpp"
#include "surf/surf.h"
+#include "simgrid/s4u/engine.hpp"
+#include "src/kernel/EngineImpl.hpp"
#include "src/simix/smx_private.h"
#include "src/include/simgrid/sg_config.h"
#include "src/surf/HostImpl.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
-#include "surf/surf_routing.h" // FIXME: brain dead public header
-#include "src/kernel/routing/AsImpl.hpp"
#include "src/kernel/routing/AsCluster.hpp"
-#include "src/kernel/routing/AsClusterTorus.hpp"
-#include "src/kernel/routing/AsClusterFatTree.hpp"
#include "src/kernel/routing/AsClusterDragonfly.hpp"
+#include "src/kernel/routing/AsClusterFatTree.hpp"
+#include "src/kernel/routing/AsClusterTorus.hpp"
#include "src/kernel/routing/AsDijkstra.hpp"
#include "src/kernel/routing/AsFloyd.hpp"
#include "src/kernel/routing/AsFull.hpp"
+#include "src/kernel/routing/AsImpl.hpp"
#include "src/kernel/routing/AsNone.hpp"
#include "src/kernel/routing/AsVivaldi.hpp"
+#include "src/kernel/routing/NetCard.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
"Refusing to create a router named '%s': this name already describes a node.", router->id);
simgrid::kernel::routing::NetCard* netcard =
- new simgrid::kernel::routing::NetCardImpl(router->id, simgrid::kernel::routing::NetCard::Type::Router, current_routing);
+ new simgrid::kernel::routing::NetCard(router->id, simgrid::kernel::routing::NetCard::Type::Router, current_routing);
xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, netcard);
XBT_DEBUG("Router '%s' has the id %d", router->id, netcard->id());
if ((cluster->properties != nullptr) && (!xbt_dict_is_empty(cluster->properties))) {
xbt_dict_cursor_t cursor=nullptr;
char *key,*data;
- host.properties = xbt_dict_new();
+ host.properties = xbt_dict_new_homogeneous(free);
xbt_dict_foreach(cluster->properties,cursor,key,data) {
- xbt_dict_set(host.properties, key, xbt_strdup(data),free);
+ xbt_dict_set(host.properties, key, xbt_strdup(data), nullptr);
}
}
static void surf_config_models_setup()
{
const char* host_model_name = xbt_cfg_get_string("host/model");
- const char* vm_model_name = xbt_cfg_get_string("vm/model");
const char* network_model_name = xbt_cfg_get_string("network/model");
const char* cpu_model_name = xbt_cfg_get_string("cpu/model");
const char* storage_model_name = xbt_cfg_get_string("storage/model");
surf_host_model_description[host_id].model_init_preparse();
XBT_DEBUG("Call vm_model_init");
- int vm_id = find_model_description(surf_vm_model_description, vm_model_name);
- surf_vm_model_description[vm_id].model_init_preparse();
+ surf_vm_model_init_HL13();
XBT_DEBUG("Call storage_model_init");
int storage_id = find_model_description(surf_storage_model_description, storage_model_name);
break;
}
+ if (current_routing == nullptr) { /* it is the first one */
+ xbt_assert(simgrid::s4u::Engine::instance()->pimpl->rootAs_ == nullptr,
+ "All defined components must belong to a AS");
+ simgrid::s4u::Engine::instance()->pimpl->rootAs_ = new_as;
- if (current_routing == nullptr && routing_platf->root_ == nullptr) { /* it is the first one */
- routing_platf->root_ = new_as;
-
- } else if (current_routing != nullptr && routing_platf->root_ != nullptr) {
+ } else {
/* set the father behavior */
if (current_routing->hierarchy_ == simgrid::kernel::routing::AsImpl::RoutingMode::unset)
current_routing->hierarchy_ = simgrid::kernel::routing::AsImpl::RoutingMode::recursive;
/* add to the sons dictionary */
xbt_dict_set(current_routing->children(), AS->id, (void *) new_as, nullptr);
-
- } else {
- THROWF(arg_error, 0, "All defined components must belong to a AS");
}
/* set the new current component of the tree */