1 /* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #include "simgrid/jedule/jedule_sd_binding.h"
8 #include "simgrid/jedule/jedule.hpp"
9 #include "src/simdag/simdag_private.hpp"
11 #include "simgrid/s4u/Engine.hpp"
12 #include "simgrid/s4u/NetZone.hpp"
16 XBT_LOG_NEW_CATEGORY(jedule, "Logging specific to Jedule");
17 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_sd, jedule, "Logging specific to Jedule SD binding");
21 void jedule_log_sd_event(SD_task_t task)
23 xbt_assert(task != nullptr);
25 jed_event_t event = new simgrid::jedule::Event(std::string(SD_task_get_name(task)),
26 SD_task_get_start_time(task), SD_task_get_finish_time(task), "SD");
27 event->addResources(task->allocation);
28 my_jedule->event_set.push_back(event);
33 sg_netzone_t root_comp = simgrid::s4u::Engine::instance()->netRoot();
34 XBT_DEBUG("root name %s\n", root_comp->name());
36 my_jedule = new simgrid::jedule::Jedule();
38 jed_container_t root_container = new simgrid::jedule::Container(std::string(root_comp->name()));
39 root_container->createHierarchy(root_comp);
40 my_jedule->root_container = root_container;
43 void jedule_sd_exit(void)
48 void jedule_sd_dump(const char * filename)
53 fname = bprintf("%s.jed", xbt_binary_name);
55 fname = xbt_strdup(filename);
58 FILE *fh = fopen(fname, "w");
60 my_jedule->writeOutput(fh);