Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Continue documenting my changes
[simgrid.git] / include / simdag / datatypes.h
1 #ifndef SIMDAG_DATATYPES_H
2 #define SIMDAG_DATATYPES_H
3
4 /** @brief Workstation datatype
5     @ingroup SD_datatypes_management
6     
7     A workstation is a place where a task can be executed.
8     A workstation is represented as a <em>physical
9     resource with computing capabilities</em> and has a <em>name</em>.
10
11     @see SD_workstation_management */
12 typedef struct SD_workstation *SD_workstation_t;
13
14 /** @brief Workstation access mode
15     @ingroup SD_datatypes_management
16
17     By default, a workstation resource is shared, i.e. several tasks
18     can be executed at the same time on a workstation. The CPU power of
19     the workstation is shared between the running tasks on the workstation.
20     In sequential mode, only one task can use the workstation, and the other
21     tasks wait in a FIFO.
22
23     @see SD_workstation_get_access_mode(), SD_workstation_set_access_mode() */
24 typedef enum {
25   SD_WORKSTATION_SHARED_ACCESS,     /**< @brief Several tasks can be executed at the same time */
26   SD_WORKSTATION_SEQUENTIAL_ACCESS  /**< @brief Only one task can be executed, the others wait in a FIFO. */
27 } e_SD_workstation_access_mode_t;
28
29 /** @brief Link datatype
30     @ingroup SD_datatypes_management
31
32     A link is a network node represented as a <em>name</em>, a <em>current
33     bandwidth</em> and a <em>current latency</em>. A route is a list of
34     links between two workstations.
35
36     @see SD_link_management */
37 typedef struct SD_link *SD_link_t;
38
39 /** @brief Task datatype
40     @ingroup SD_datatypes_management
41
42     A task is some <em>computing amount</em> that can be executed
43     in parallel on several workstations. A task may depend on other
44     tasks, this means that the task cannot start until the other tasks are done.
45     Each task has a <em>\ref e_SD_task_state_t "state"</em> indicating whether 
46     the task is scheduled, running, done, etc.
47
48     @see SD_task_management */
49 typedef struct SD_task *SD_task_t;
50
51 /** @brief Task states
52     @ingroup SD_datatypes_management
53
54     @see SD_task_management */
55 typedef enum {
56   SD_NOT_SCHEDULED = 0,      /**< @brief Initial state (not valid for SD_watch and SD_unwatch). */
57   SD_SCHEDULED =     0x0001, /**< @brief A task becomes SD_SCHEDULED when you call function
58                                 SD_task_schedule. SD_simulate will execute it when it becomes SD_READY. */
59   SD_READY =         0x0002, /**< @brief A scheduled task becomes ready is SD_simulate as soon as its dependencies are satisfied. */
60   SD_IN_FIFO =       0x0004, /**< @brief A ready task can have to wait in a workstation fifo if the workstation is sequential */
61   SD_RUNNING =       0x0008, /**< @brief An SD_READY or SD_IN_FIFO becomes SD_RUNNING when it is launched. */
62   SD_DONE =          0x0010, /**< @brief The task is successfuly finished. */
63   SD_FAILED =        0x0020  /**< @brief A problem occured during the execution of the task. */
64 } e_SD_task_state_t;
65
66 #endif