Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
oups
[simgrid.git] / src / surf / surf_interface.cpp
index dccea91..6f02607 100644 (file)
@@ -4,16 +4,18 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "src/portable.h"
 #include "surf_private.h"
 #include "surf_interface.hpp"
 #include "network_interface.hpp"
 #include "cpu_interface.hpp"
-#include "host_interface.hpp"
+#include "src/surf/HostImpl.hpp"
 #include "src/simix/smx_host_private.h"
 #include "surf_routing.hpp"
 #include "simgrid/sg_config.h"
 #include "mc/mc.h"
 #include "virtual_machine.hpp"
+#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 
 XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
@@ -264,12 +266,6 @@ int find_model_description(s_surf_model_description_t * table,
   return -1;
 }
 
-static XBT_INLINE void routing_asr_prop_free(void *p)
-{
-  //xbt_dict_t elm = (xbt_dict_t) p;
-  //xbt_dict_free(&elm); FIXME: leaking in some case? That's a sometimes double-free with AsCluster::~AsCluster
-}
-
 static XBT_INLINE void surf_storage_free(void *r)
 {
   delete static_cast<simgrid::surf::Storage*>(r);
@@ -316,10 +312,10 @@ void surf_init(int *argc, char **argv)
   sg_host_init();
 
   XBT_DEBUG("Add routing levels");
-  ROUTING_PROP_ASR_LEVEL = xbt_lib_add_level(as_router_lib,routing_asr_prop_free);
+  ROUTING_PROP_ASR_LEVEL = xbt_lib_add_level(as_router_lib, NULL);
 
   XBT_DEBUG("Add SURF levels");
-  simgrid::surf::Host::classInit();
+  simgrid::surf::HostImpl::classInit();
   SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free);
 
   xbt_init(argc, argv);
@@ -378,8 +374,7 @@ void surf_exit(void)
 #endif
 
   tmgr_finalize();
-  surf_parse_lex_destroy();
-  surf_parse_free_callbacks();
+  sg_platf_exit();
 
   NOW = 0;                      /* Just in case the user plans to restart the simulation afterward */
 }