X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7a3a100990355eb757dc81106b5aac6daed0b8e1..51c23076e2b42ff07dc167dea1cb0e3a4ab3cf68:/src/surf/surf_interface.cpp diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 54f61e8a80..85b2bd3cdd 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -6,17 +6,15 @@ #include "surf_interface.hpp" #include "mc/mc.h" #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 "src/kernel/routing/NetPoint.hpp" +#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 -#include #include -#include #ifdef _WIN32 #include @@ -38,19 +36,13 @@ std::vector host_that_restart; std::set watched_hosts; extern std::map storage_types; -namespace simgrid { -namespace surf { - -simgrid::xbt::signal surfExitCallbacks; -} -} - #include // FIXME: this plug-in should not be linked to the core #include // FIXME: this plug-in should not be linked to the core s_surf_model_description_t surf_plugin_description[] = { - {"Energy", "Cpu energy consumption.", &sg_host_energy_plugin_init}, - {"Load", "Cpu load.", &sg_host_load_plugin_init}, + {"host_energy", "Cpu energy consumption.", &sg_host_energy_plugin_init}, + {"link_energy", "Link energy consumption.", &sg_link_energy_plugin_init}, + {"host_load", "Cpu load.", &sg_host_load_plugin_init}, {nullptr, nullptr, nullptr} /* this array must be nullptr terminated */ }; @@ -128,12 +120,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(); @@ -144,7 +130,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()) { @@ -167,7 +153,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) @@ -319,8 +305,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) { @@ -334,11 +318,8 @@ void surf_exit() delete model; delete all_existing_models; - - if (future_evt_set) { - delete future_evt_set; - future_evt_set = nullptr; - } + delete future_evt_set; + future_evt_set = nullptr; tmgr_finalize(); sg_platf_exit();