Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove the argc/argv version of simcall_process_create
[simgrid.git] / src / simdag / simdag_private.hpp
1 /* Copyright (c) 2006-2018. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #include "simgrid/simdag.h"
7 #include "surf/surf.hpp"
8 #include <set>
9 #include <string>
10 #include <vector>
11
12 #ifndef SIMDAG_PRIVATE_HPP
13 #define SIMDAG_PRIVATE_HPP
14 #if SIMGRID_HAVE_JEDULE
15 #include "simgrid/jedule/jedule_sd_binding.h"
16 #endif
17
18 namespace simgrid{
19 namespace sd{
20 class Global {
21 public:
22   explicit Global();
23   Global(const Global&) = delete;
24   Global& operator=(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 extern XBT_PRIVATE simgrid::sd::Global *sd_global;
38
39 /* Task */
40 struct s_SD_task_t {
41   e_SD_task_state_t state;
42   void *data;                   /* user data */
43   char *name;
44   e_SD_task_kind_t kind;
45   double amount;
46   double alpha;          /* used by typed parallel tasks */
47   double start_time;
48   double finish_time;
49   simgrid::kernel::resource::Action* surf_action;
50   unsigned short watch_points;  /* bit field xor()ed with masks */
51
52   bool marked = false; /* used to check if the task DAG has some cycle*/
53
54   /* dependencies -- cannot be embedded in the struct since it's not handled as a real C++ class */
55   std::set<SD_task_t> *inputs;
56   std::set<SD_task_t> *outputs;
57   std::set<SD_task_t> *predecessors;
58   std::set<SD_task_t> *successors;
59
60   /* scheduling parameters (only exist in state SD_SCHEDULED) */
61   std::vector<sg_host_t> *allocation;
62   double *flops_amount;
63   double *bytes_amount;
64   double rate;
65 };
66
67 /* SimDag private functions */
68 XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
69 XBT_PRIVATE void SD_task_run(SD_task_t task);
70 XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
71 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
72 XBT_PRIVATE const char *__get_state_name(e_SD_task_state_t state);
73 #endif