XBT_LOG_NEW_CATEGORY(sd, "Logging specific to SimDag");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_kernel, sd, "Logging specific to SimDag (kernel)");
-simgrid::sd::Global* sd_global = nullptr;
+std::unique_ptr<simgrid::sd::Global> sd_global = nullptr;
namespace simgrid {
namespace sd {
{
xbt_assert(sd_global == nullptr, "SD_init() already called");
- surf_init(argc, argv);
-
- sd_global = new simgrid::sd::Global();
+ sd_global = std::make_unique<simgrid::sd::Global>(argc, argv);
simgrid::config::set_default<std::string>("host/model", "ptask_L07");
if (simgrid::config::get_value<bool>("debug/clean-atexit"))
*/
void SD_create_environment(const char* platform_file)
{
- simgrid::s4u::Engine::get_instance()->load_platform(platform_file);
+ sd_global->engine_->load_platform(platform_file);
- XBT_DEBUG("Host number: %zu, link number: %d", sg_host_count(), sg_link_count());
+ XBT_DEBUG("Host number: %zu, link number: %zu", sg_host_count(), sg_link_count());
#if SIMGRID_HAVE_JEDULE
jedule_sd_init();
#endif
#if SIMGRID_HAVE_JEDULE
jedule_sd_exit();
#endif
- delete sd_global;
+ sd_global->engine_->shutdown();
}