Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove some pointer functions. We should go for C++ instead
[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 <stdbool.h>
15 #if HAVE_JEDULE
16 #include "simgrid/jedule/jedule_sd_binding.h"
17 #endif
18
19 SG_BEGIN_DECL()
20
21 /* Global variables */
22
23 typedef struct SD_global {
24   bool watch_point_reached;      /* has a task just reached a watch point? */
25
26   std::set<SD_task_t> *initial_tasks;
27   std::set<SD_task_t> *runnable_tasks;
28   std::set<SD_task_t> *completed_tasks;
29
30   xbt_dynar_t return_set;
31
32 } s_SD_global_t, *SD_global_t;
33
34 extern XBT_PRIVATE SD_global_t sd_global;
35
36 /* Task */
37 typedef struct SD_task {
38   e_SD_task_state_t state;
39   void *data;                   /* user data */
40   char *name;
41   e_SD_task_kind_t kind;
42   double amount;
43   double alpha;          /* used by typed parallel tasks */
44   double start_time;
45   double finish_time;
46   surf_action_t surf_action;
47   unsigned short watch_points;  /* bit field xor()ed with masks */
48
49   int marked;                   /* used to check if the task DAG has some cycle*/
50
51   /* dependencies */
52   std::set<SD_task_t> *inputs;
53   std::set<SD_task_t> *outputs;
54   std::set<SD_task_t> *predecessors;
55   std::set<SD_task_t> *successors;
56
57   /* scheduling parameters (only exist in state SD_SCHEDULED) */
58   std::vector<sg_host_t> *allocation;
59   double *flops_amount;
60   double *bytes_amount;
61   double rate;
62 } s_SD_task_t;
63
64 /* SimDag private functions */
65 XBT_PRIVATE void SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state);
66 XBT_PRIVATE void SD_task_run(SD_task_t task);
67 XBT_PRIVATE bool acyclic_graph_detail(xbt_dynar_t dag);
68 XBT_PRIVATE void uniq_transfer_task_name(SD_task_t task);
69
70 SG_END_DECL()
71 #endif