Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
9691647fbd447b788abb62e6fc26c95ed498e3f6
[simgrid.git] / src / simdag / simdag_private.h
1 /* Copyright (c) 2006-2015. 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 #ifndef SIMDAG_PRIVATE_H
8 #define SIMDAG_PRIVATE_H
9 #include <set>
10 #include <vector>
11 #include "xbt/dynar.h"
12 #include "simgrid/simdag.h"
13 #include "surf/surf.h"
14 #include "xbt/mallocator.h"
15 #include <stdbool.h>
16 #if HAVE_JEDULE
17 #include "simgrid/jedule/jedule_sd_binding.h"
18 #endif
19
20 SG_BEGIN_DECL()
21
22 /* Global variables */
23
24 typedef struct SD_global {
25   bool watch_point_reached;      /* has a task just reached a watch point? */
26
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
31   xbt_dynar_t return_set;
32
33 } s_SD_global_t, *SD_global_t;
34
35 extern XBT_PRIVATE SD_global_t sd_global;
36
37 /* Task */
38 typedef struct SD_task {
39   e_SD_task_state_t state;
40   void *data;                   /* user data */
41   char *name;
42   e_SD_task_kind_t kind;
43   double amount;
44   double alpha;          /* used by typed parallel tasks */
45   double remains;
46   double start_time;
47   double finish_time;
48   surf_action_t surf_action;
49   unsigned short watch_points;  /* bit field xor()ed with masks */
50
51   int marked;                   /* used to check if the task DAG has some cycle*/
52
53   /* dependencies */
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;
58
59   /* scheduling parameters (only exist in state SD_SCHEDULED) */
60   std::vector<sg_host_t> *allocation;
61   double *flops_amount;
62   double *bytes_amount;
63   double rate;
64 } s_SD_task_t;
65
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(xbt_dynar_t dag);
70 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
71
72 SG_END_DECL()
73 #endif