Logo AND Algorithmique Numérique Distribuée

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