Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add private structures and functions + wrapping for Surf links and workstations
[simgrid.git] / include / simdag / simdag.h
1 #ifndef SIMDAG_SIMDAG_H
2 #define SIMDAG_SIMDAG_H
3
4 #include "simdag/datatypes.h"
5 #include "xbt/misc.h"
6
7 SG_BEGIN_DECL()
8
9 /************************** Link handling ***********************************/
10
11 /* private (called by SG_environment_create)
12 SG_link_t    SG_link_create(void *data, const char *name,
13 double bandwidth, double latency);*/
14 void*        SG_link_get_data(SG_link_t link);
15 void         SG_link_set_data(SG_link_t link, void *data);
16 const char*  SG_link_get_name(SG_link_t link);
17 double       SG_link_get_capacity(SG_link_t link);
18 double       SG_link_get_current_bandwidth(SG_link_t link);
19 double       SG_link_get_current_latency(SG_link_t link);
20 /* private (called by SG_clean)
21 void         SG_link_destroy(SG_link_t link);
22 */
23
24 /************************** Workstation handling ****************************/
25
26 /* private (called by SG_environment_create)
27 SG_workstation_t   SG_workstation_create(void *data, const char *name, double power,
28   double available_power);*/
29 SG_workstation_t   SG_workstation_get_by_name(const char *name);
30 SG_workstation_t*  SG_workstation_get_list(void);
31 int                SG_workstation_get_number(void);
32 void               SG_workstation_set_data(SG_workstation_t workstation, void *data);
33 void*              SG_workstation_get_data(SG_workstation_t workstation);
34 const char*        SG_workstation_get_name(SG_workstation_t workstation);
35 SG_link_t*         SG_workstation_route_get_list(SG_workstation_t src, SG_workstation_t dst);
36 int                SG_workstation_route_get_size(SG_workstation_t src, SG_workstation_t dst);
37 double             SG_workstation_get_power(SG_workstation_t workstation);
38 double             SG_workstation_get_available_power(SG_workstation_t workstation);
39 /* private (called by SG_clean)
40 void               SG_workstation_destroy(SG_workstation_t workstation);
41 */
42
43 /************************** Task handling ************************************/
44
45 SG_task_t         SG_task_create(const char *name, void *data, double amount);
46 int               SG_task_schedule(SG_task_t task, int workstation_nb,
47                                    SG_workstation_t **workstation_list, double *computation_amount,
48                                    double *communication_amount, double rate);
49
50 void*             SG_task_get_data(SG_task_t task);
51 void              SG_task_set_data(SG_task_t task, void *data);
52 const char*       SG_task_get_name(SG_task_t task);
53 double            SG_task_get_amount(SG_task_t task);
54 double            SG_task_get_remaining_amount(SG_task_t task);
55 void              SG_task_dependency_add(const char *name, void *data, SG_task_t src, SG_task_t dst);
56 void              SG_task_dependency_remove(SG_task_t src, SG_task_t dst); 
57 SG_task_state_t   SG_task_get_state(SG_task_t task);
58 /* SG_task_state_t can be either SG_SCHEDULED, SG_RUNNING, SG_DONE, or SG_FAILED */
59
60 void              SG_task_watch(SG_task_t task, SG_task_state_t state);
61 /* SG_simulate will stop as soon as the state of this task is the one given in argument.
62    Watch-point is then automatically removed */
63
64 void              SG_task_unwatch(SG_task_t task, SG_task_state_t state);
65 void              SG_task_unschedule(SG_task_t task); /* change state and rerun */
66 void              SG_task_destroy(SG_task_t task);
67
68 /************************** Global *******************************************/
69
70 void              SG_init(int *argc, char **argv);
71 void              SG_create_environment(const char *platform_file);
72 SG_task_t         *SG_simulate(double how_long); /* returns a NULL-terminated array of SG_task_t whose state has changed */
73 void              SG_clean(); /* cleans everything */
74
75 SG_END_DECL()
76
77 #endif