1 /* Copyright (c) 2006-2020. 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/simdag.h"
7 #include "surf/surf.hpp"
12 #ifndef SIMDAG_PRIVATE_HPP
13 #define SIMDAG_PRIVATE_HPP
14 #if SIMGRID_HAVE_JEDULE
15 #include "simgrid/jedule/jedule_sd_binding.h"
22 bool watch_point_reached = false; /* has a task just reached a watch point? */
23 std::set<SD_task_t> initial_tasks;
24 std::set<SD_task_t> runnable_tasks;
25 std::set<SD_task_t> completed_tasks;
26 std::set<SD_task_t> return_set;
29 std::set<SD_task_t>* simulate (double how_long);
33 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
37 e_SD_task_state_t state;
38 void *data; /* user data */
40 e_SD_task_kind_t kind;
42 double alpha; /* used by typed parallel tasks */
45 simgrid::kernel::resource::Action* surf_action;
46 unsigned short watch_points; /* bit field xor()ed with masks */
48 bool marked = false; /* used to check if the task DAG has some cycle*/
50 /* dependencies -- cannot be embedded in the struct since it's not handled as a real C++ class */
51 std::set<SD_task_t> *inputs;
52 std::set<SD_task_t> *outputs;
53 std::set<SD_task_t> *predecessors;
54 std::set<SD_task_t> *successors;
56 /* scheduling parameters (only exist in state SD_SCHEDULED) */
57 std::vector<sg_host_t> *allocation;
63 /* SimDag private functions */
64 XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
65 XBT_PRIVATE void SD_task_run(SD_task_t task);
66 XBT_PRIVATE bool acyclic_graph_detail(const_xbt_dynar_t dag);
67 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
68 XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);