{
xbt_assert(sd_global == nullptr, "SD_init() already called");
- surf_init(argc, argv);
-
- sd_global = new simgrid::sd::Global();
+ sd_global = new 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: %zu", sg_host_count(), sg_link_count());
#if SIMGRID_HAVE_JEDULE
#if SIMGRID_HAVE_JEDULE
jedule_sd_exit();
#endif
+ sd_global->engine_->shutdown();
delete sd_global;
}
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "simgrid/s4u/Engine.hpp"
#include "simgrid/simdag.h"
#include "surf/surf.hpp"
#include <set>
namespace sd{
class Global {
public:
+ explicit Global(int* argc, char** argv) : engine_(new simgrid::s4u::Engine(argc, argv)) {}
bool watch_point_reached = false; /* has a task just reached a watch point? */
std::set<SD_task_t> initial_tasks;
std::set<SD_task_t> runnable_tasks;
std::set<SD_task_t> completed_tasks;
std::set<SD_task_t> return_set;
+ s4u::Engine* engine_;
};
std::set<SD_task_t>* simulate (double how_long);