X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96b18f4b65694f66c8aea2d702b6f087fdcf9cb7..c527cde5e1ee1bfe22dd33b3bbb77aaae8bcdcb1:/src/surf/sg_platf.cpp diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 59997d93a6..c002ec7d21 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -19,6 +19,7 @@ #include "src/include/simgrid/sg_config.h" #include "src/surf/xml/platf_private.hpp" +#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 @@ -72,7 +73,7 @@ void sg_platf_exit() { surf_parse_lex_destroy(); } -/** @brief Add an "host" to the current AS */ +/** @brief Add an host to the current AS */ void sg_platf_new_host(sg_platf_host_cbarg_t host) { simgrid::kernel::routing::AsImpl* current_routing = routing_get_current(); @@ -85,11 +86,6 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host) simgrid::s4u::Host* h = new simgrid::s4u::Host(host->id); h->pimpl_netcard = netcard; - if(mount_list) { - xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void *) mount_list); - mount_list = nullptr; - } - if (host->coord && strcmp(host->coord, "")) { unsigned int cursor; char*str; @@ -114,7 +110,11 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host) cpu->setStateTrace(host->state_trace); if (host->speed_trace) cpu->setSpeedTrace(host->speed_trace); - surf_host_model->createHost(host->id, netcard, cpu)->attach(h); + + new simgrid::surf::HostImpl(h, mount_list); + xbt_lib_set(storage_lib, host->id, ROUTING_STORAGE_HOST_LEVEL, (void*)mount_list); + + mount_list = nullptr; if (host->properties) { xbt_dict_cursor_t cursor=nullptr;