1 /* Copyright (c) 2006-2021. 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/s4u/Engine.hpp"
7 #include "simgrid/simdag.h"
8 #include "surf/surf.hpp"
13 #ifndef SIMDAG_PRIVATE_HPP
14 #define SIMDAG_PRIVATE_HPP
15 #if SIMGRID_HAVE_JEDULE
16 #include "simgrid/jedule/jedule_sd_binding.h"
23 explicit Global(int* argc, char** argv) : engine_(new simgrid::s4u::Engine(argc, argv)) {}
24 bool watch_point_reached = false; /* has a task just reached a watch point? */
25 std::set<SD_task_t> initial_tasks;
26 std::set<SD_task_t> runnable_tasks;
27 std::set<SD_task_t> completed_tasks;
28 std::set<SD_task_t> return_set;
32 std::set<SD_task_t>* simulate (double how_long);
36 extern XBT_PRIVATE std::unique_ptr<simgrid::sd::Global> sd_global;
40 e_SD_task_state_t state;
41 void *data; /* user data */
43 e_SD_task_kind_t kind;
45 double alpha; /* used by typed parallel tasks */
48 simgrid::kernel::resource::Action* surf_action;
49 unsigned short watch_points; /* bit field xor()ed with masks */
51 bool marked = false; /* used to check if the task DAG has some cycle*/
53 /* dependencies -- cannot be embedded in the struct since it's not handled as a real C++ class */
54 std::set<SD_task_t> *inputs;
55 std::set<SD_task_t> *outputs;
56 std::set<SD_task_t> *predecessors;
57 std::set<SD_task_t> *successors;
59 /* scheduling parameters (only exist in state SD_SCHEDULED) */
60 std::vector<sg_host_t> *allocation;
66 /* SimDag private functions */
67 XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
68 XBT_PRIVATE void SD_task_run(SD_task_t task);
69 XBT_PRIVATE bool acyclic_graph_detail(const_xbt_dynar_t dag);
70 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
71 XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);