]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/surf_interface.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplification
[simgrid.git] / src / surf / surf_interface.cpp
index 41806829f34ccf049de365e5405b466edfe592c1..3e020d74515f1431a05a639dc72c7e039a08a530 100644 (file)
@@ -11,9 +11,9 @@
 #include "src/kernel/resource/profile/Profile.hpp"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf.hpp"
-#include "src/xbt_modinter.h" /* whether initialization was already done */
 #include "surf/surf.hpp"
 #include "xbt/module.h"
+#include "xbt/xbt_modinter.h" /* whether initialization was already done */
 
 #include <fstream>
 #include <string>
@@ -29,8 +29,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf, "Logging specific to SURF (ke
  * Utils *
  *********/
 
-std::vector<simgrid::kernel::resource::Model*> all_existing_models; /* to destroy models correctly */
-
 simgrid::kernel::profile::FutureEvtSet future_evt_set;
 std::vector<std::string> surf_path;
 
@@ -196,8 +194,7 @@ int find_model_description(const std::vector<surf_model_description_t>& table, c
   if (pos != table.end())
     return static_cast<int>(std::distance(table.begin(), pos));
 
-  if (table.empty())
-    xbt_die("No model is valid! This is a bug.");
+  xbt_assert(not table.empty(), "No model is valid! This is a bug.");
 
   std::string sep;
   std::string name_list;
@@ -224,9 +221,6 @@ void surf_exit()
 {
   simgrid::s4u::Engine::shutdown();
 
-  for (auto const& model : all_existing_models)
-    delete model;
-
   tmgr_finalize();
   sg_platf_exit();