- xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t),NULL);
-
- xbt_dict_cursor_t cursor = nullptr;
- const char* name = nullptr;
- simgrid::Host* host = nullptr;
- xbt_dict_foreach(host_list, cursor, name, host)
- if(routing_get_network_element_type(name) == SURF_NETWORK_ELEMENT_HOST)
- xbt_dynar_push(res, &host);
- return res;
-}
-
-// ========= Layering madness ==============
-
-int MSG_HOST_LEVEL;
-int SD_HOST_LEVEL;
-int SIMIX_HOST_LEVEL;
-int ROUTING_HOST_LEVEL;
-int USER_HOST_LEVEL;
-
-#include "src/msg/msg_private.h" // MSG_host_priv_free. FIXME: killme by initializing that level in msg when used
-#include "src/simdag/simdag_private.h" // __SD_workstation_destroy. FIXME: killme by initializing that level in simdag when used
-#include "src/simix/smx_host_private.h" // SIMIX_host_destroy. FIXME: killme by initializing that level in simix when used
-#include "src/surf/cpu_interface.hpp"
-#include "src/surf/surf_routing.hpp"
-
-void sg_host_init()
-{
- MSG_HOST_LEVEL = simgrid::Host::extension_create([](void *p) {
- __MSG_host_priv_free((msg_host_priv_t) p);
- });
-
- ROUTING_HOST_LEVEL = simgrid::Host::extension_create([](void *p) {
- delete static_cast<simgrid::surf::NetCard*>(p);
- });