XBT_PUBLIC int SIMIX_is_maestro();
/********************************** Global ************************************/
-/* Initialization and exit */
-XBT_PUBLIC void SIMIX_global_init(int* argc, char** argv);
-
/* Set some code to execute in the maestro (must be used before the engine creation)
*
* If no maestro code is registered (the default), the main thread
#include "src/instr/instr_private.hpp"
#include "src/kernel/EngineImpl.hpp"
#include "src/kernel/activity/CommImpl.hpp"
+#include "src/kernel/actor/ActorImpl.hpp"
#include "src/mc/mc_replay.hpp"
#include "src/surf/network_interface.hpp"
#include "surf/surf.hpp" // routing_platf. FIXME:KILLME. SOON
XBT_LOG_NEW_CATEGORY(s4u, "Log channels of the S4U (Simgrid for you) interface");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_engine, s4u, "Logging specific to S4U (engine)");
+static simgrid::kernel::actor::ActorCode maestro_code;
+
namespace simgrid {
namespace s4u {
xbt::signal<void()> Engine::on_platform_creation;
Engine::instance_ = this;
instr::init();
pimpl->initialize(argc, argv);
- SIMIX_global_init(argc, argv);
+ // Either create a new context with maestro or create
+ // a context object with the current context maestro):
+ kernel::actor::create_maestro(maestro_code);
}
Engine::Engine(std::string name) : pimpl(new kernel::EngineImpl(nullptr, nullptr))
{
return simgrid::s4u::Engine::get_instance()->get_actor_count();
}
+
+void SIMIX_set_maestro(void (*code)(void*), void* data)
+{
+#ifdef _WIN32
+ XBT_INFO("WARNING, SIMIX_set_maestro is believed to not work on windows. Please help us investigating this issue if "
+ "you need that feature");
+#endif
+ maestro_code = std::bind(code, data);
+}
} // namespace simix
} // namespace simgrid
-
-static simgrid::kernel::actor::ActorCode maestro_code;
-void SIMIX_set_maestro(void (*code)(void*), void* data)
-{
-#ifdef _WIN32
- XBT_INFO("WARNING, SIMIX_set_maestro is believed to not work on windows. Please help us investigating this issue if "
- "you need that feature");
-#endif
- maestro_code = std::bind(code, data);
-}
-
-void SIMIX_global_init(int* argc, char** argv)
-{
-
- // Either create a new context with maestro or create
- // a context object with the current context maestro):
- simgrid::kernel::actor::create_maestro(maestro_code);
-}
-
/**
* @ingroup SIMIX_API
* @brief A clock (in second).