Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Please codacy (delete copy constructor).
[simgrid.git] / src / simdag / simdag_private.hpp
1 /* Copyright (c) 2006-2017. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <set>
8 #include <string>
9 #include <vector>
10 #include "simgrid/simdag.h"
11 #include "surf/surf.h"
12
13 #ifndef SIMDAG_PRIVATE_HPP
14 #define SIMDAG_PRIVATE_HPP
15 #if SIMGRID_HAVE_JEDULE
16 #include "simgrid/jedule/jedule_sd_binding.h"
17 #endif
18
19 namespace simgrid{
20 namespace sd{
21 class Global {
22 public:
23   explicit Global();
24   Global(const Global&) = delete;
25   ~Global();
26   bool watch_point_reached;      /* has a task just reached a watch point? */
27   std::set<SD_task_t> *initial_tasks;
28   std::set<SD_task_t> *runnable_tasks;
29   std::set<SD_task_t> *completed_tasks;
30   std::set<SD_task_t> *return_set;
31 };
32
33 std::set<SD_task_t>* simulate (double how_long);
34 }
35 }
36
37 SG_BEGIN_DECL()
38 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
39
40 /* Task */
41 typedef struct SD_task {
42   e_SD_task_state_t state;
43   void *data;                   /* user data */
44   char *name;
45   e_SD_task_kind_t kind;
46   double amount;
47   double alpha;          /* used by typed parallel tasks */
48   double start_time;
49   double finish_time;
50   surf_action_t surf_action;
51   unsigned short watch_points;  /* bit field xor()ed with masks */
52
53   int marked;                   /* used to check if the task DAG has some cycle*/
54
55   /* dependencies */
56   std::set<SD_task_t> *inputs;
57   std::set<SD_task_t> *outputs;
58   std::set<SD_task_t> *predecessors;
59   std::set<SD_task_t> *successors;
60
61   /* scheduling parameters (only exist in state SD_SCHEDULED) */
62   std::vector<sg_host_t> *allocation;
63   double *flops_amount;
64   double *bytes_amount;
65   double rate;
66 } s_SD_task_t;
67
68 /* SimDag private functions */
69 XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
70 XBT_PRIVATE void SD_task_run(SD_task_t task);
71 XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
72 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
73 XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
74 SG_END_DECL()
75 #endif