1 #ifndef SIMDAG_SIMDAG_H
2 #define SIMDAG_SIMDAG_H
4 #include "simdag/datatypes.h"
9 /************************** Link handling ***********************************/
11 /** @defgroup SD_link_management Links
12 * @brief Functions for managing the network links
14 * This section describes the functions for managing the network links.
16 * A link is a network node represented as a <em>name</em>, a <em>current
17 * bandwidth</em> and a <em>current latency</em>. The links are created
18 * when you call the function SD_create_environment.
23 void* SD_link_get_data(SD_link_t link);
24 void SD_link_set_data(SD_link_t link, void *data);
25 const char* SD_link_get_name(SD_link_t link);
26 double SD_link_get_current_bandwidth(SD_link_t link);
27 double SD_link_get_current_latency(SD_link_t link);
30 /************************** Workstation handling ****************************/
32 /** @defgroup SD_workstation_management Workstations
33 * @brief Functions for managing the workstations
35 * This section describes the functions for managing the workstations.
37 * A workstation is a place where a task can be executed.
38 * A workstation is represented as a <em>physical
39 * resource with computing capabilities</em> and has a <em>name</em>.
41 * The workstations are created when you call the function SD_create_environment.
43 * @see SD_workstation_t
46 SD_workstation_t SD_workstation_get_by_name(const char *name);
47 SD_workstation_t* SD_workstation_get_list(void);
48 int SD_workstation_get_number(void);
49 void SD_workstation_set_data(SD_workstation_t workstation, void *data);
50 void* SD_workstation_get_data(SD_workstation_t workstation);
51 const char* SD_workstation_get_name(SD_workstation_t workstation);
52 SD_link_t* SD_workstation_route_get_list(SD_workstation_t src, SD_workstation_t dst);
53 int SD_workstation_route_get_size(SD_workstation_t src, SD_workstation_t dst);
54 double SD_workstation_get_power(SD_workstation_t workstation);
55 double SD_workstation_get_available_power(SD_workstation_t workstation);
58 /************************** Task handling ************************************/
60 /** @defgroup SD_task_management Tasks
61 * @brief Functions for managing the tasks
63 * This section describes the functions for managing the tasks.
65 * A task is some <em>computing amount</em> that can be executed
66 * in parallel on several workstations. A task may depend on other
67 * tasks, this means that the task cannot start until the other tasks are done.
68 * Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether
69 * the task is scheduled, running, done, etc.
71 * @see SD_task_t, SD_task_dependency_management
74 SD_task_t SD_task_create(const char *name, void *data, double amount);
75 void* SD_task_get_data(SD_task_t task);
76 void SD_task_set_data(SD_task_t task, void *data);
77 e_SD_task_state_t SD_task_get_state(SD_task_t task);
78 const char* SD_task_get_name(SD_task_t task);
79 double SD_task_get_amount(SD_task_t task);
80 double SD_task_get_remaining_amount(SD_task_t task);
81 void SD_task_watch(SD_task_t task, e_SD_task_state_t state);
82 void SD_task_unwatch(SD_task_t task, e_SD_task_state_t state);
83 void SD_task_schedule(SD_task_t task, int workstation_nb,
84 const SD_workstation_t *workstation_list, double *computation_amount,
85 double *communication_amount, double rate);
86 void SD_task_unschedule(SD_task_t task);
87 void SD_task_destroy(SD_task_t task);
91 /** @defgroup SD_task_dependency_management Tasks dependencies
92 * @brief Functions for managing the task dependencies
94 * This section describes the functions for managing the dependencies between the tasks.
96 * @see SD_task_management
99 void SD_task_dependency_add(const char *name, void *data, SD_task_t src, SD_task_t dst);
100 void SD_task_dependency_remove(SD_task_t src, SD_task_t dst);
101 void* SD_task_dependency_get_data(SD_task_t src, SD_task_t dst);
104 /************************** Global *******************************************/
106 /** @defgroup SD_simulation Simulation
107 * @brief Functions for creating the environment and launching the simulation
109 * This section describes the functions for initialising SimDag, launching
110 * the simulation and exiting SimDag.
114 void SD_init(int *argc, char **argv);
115 void SD_create_environment(const char *platform_file);
116 SD_task_t* SD_simulate(double how_long);