Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
surfExitCallbacks are gone.
[simgrid.git] / src / surf / surf_interface.cpp
index 79a3f27..5fb89fb 100644 (file)
@@ -5,19 +5,16 @@
 
 #include "surf_interface.hpp"
 #include "mc/mc.h"
-#include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/s4u/Engine.hpp"
-#include "simgrid/sg_config.h"
-#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
-#include "src/kernel/lmm/maxmin.hpp"   // Constraint
+#include "simgrid/sg_config.hpp"
+#include "src/internal_config.h"
 #include "src/surf/HostImpl.hpp"
-#include "xbt/utility.hpp"
 #include "src/surf/xml/platf.hpp"
+#include "surf/surf.hpp"
+#include "xbt/module.h"
 
 #include <fstream>
-#include <set>
 #include <string>
-#include <vector>
 
 #ifdef _WIN32
 #include <windows.h>
@@ -39,13 +36,6 @@ std::vector<simgrid::s4u::Host*> host_that_restart;
 std::set<std::string> watched_hosts;
 extern std::map<std::string, simgrid::surf::StorageType*> storage_types;
 
-namespace simgrid {
-namespace surf {
-
-simgrid::xbt::signal<void()> surfExitCallbacks;
-}
-}
-
 #include <simgrid/plugins/energy.h> // FIXME: this plug-in should not be linked to the core
 #include <simgrid/plugins/load.h>   // FIXME: this plug-in should not be linked to the core
 
@@ -129,12 +119,6 @@ double surf_get_clock()
   return NOW;
 }
 
-#ifdef _WIN32
-# define FILE_DELIM "\\"
-#else
-# define FILE_DELIM "/"         /* FIXME: move to better location */
-#endif
-
 std::ifstream* surf_ifsopen(std::string name)
 {
   std::ifstream* fs = new std::ifstream();
@@ -145,7 +129,7 @@ std::ifstream* surf_ifsopen(std::string name)
 
   /* search relative files in the path */
   for (auto const& path_elm : surf_path) {
-    std::string buff = path_elm + FILE_DELIM + name;
+    std::string buff = path_elm + "/" + name;
     fs->open(buff.c_str(), std::ifstream::in);
 
     if (not fs->fail()) {
@@ -168,7 +152,7 @@ FILE *surf_fopen(const char *name, const char *mode)
 
   /* search relative files in the path */
   for (auto const& path_elm : surf_path) {
-    std::string buff = path_elm + FILE_DELIM + name;
+    std::string buff = path_elm + "/" + name;
     file             = fopen(buff.c_str(), mode);
 
     if (file)
@@ -320,8 +304,6 @@ void surf_init(int *argc, char **argv)
 
 void surf_exit()
 {
-  TRACE_end();                  /* Just in case it was not called by the upper layer (or there is no upper layer) */
-
   simgrid::s4u::Engine::shutdown();
   sg_link_exit();
   for (auto const& e : storage_types) {