Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : memcmp on space really used in fragment
[simgrid.git] / include / simix / datatypes.h
1 /* Copyright (c) 2007, 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 _SIMIX_DATATYPES_H
8 #define _SIMIX_DATATYPES_H
9 #include "xbt/misc.h"
10 #include "xbt/swag.h"
11 #include "xbt/fifo.h"
12 #include "xbt/dict.h"
13
14 SG_BEGIN_DECL()
15
16 /* ****************************** File *********************************** */
17 typedef struct s_smx_file *smx_file_t;
18
19
20
21 /* ******************************** Host ************************************ */
22 /** @defgroup m_datatypes_management_details Details on SIMIX datatypes */
23 /** @brief Host datatype  
24     @ingroup m_datatypes_management
25
26     A <em>location</em> (or <em>host</em>) is any possible place where
27     a process may run. Thus it is represented as a <em>physical
28     resource with computing capabilities</em>, some <em>mailboxes</em>
29     to enable running process to communicate with remote ones, and
30     some <em>private data</em> that can be only accessed by local
31     process.
32
33     \see m_host_management
34   @{ */
35 typedef struct s_smx_host *smx_host_t;
36 typedef enum {
37   SIMIX_WAITING,
38   SIMIX_READY,
39   SIMIX_RUNNING,
40   SIMIX_DONE,
41   SIMIX_CANCELED,
42   SIMIX_FAILED,
43   SIMIX_SRC_HOST_FAILURE,
44   SIMIX_DST_HOST_FAILURE,
45   SIMIX_SRC_TIMEOUT,
46   SIMIX_DST_TIMEOUT,
47   SIMIX_LINK_FAILURE,
48 } e_smx_state_t;
49 /** @} */
50
51
52 typedef struct s_smx_timer* smx_timer_t;
53
54
55 /* ******************************** Synchro ************************************ */
56 typedef struct s_smx_mutex *smx_mutex_t;
57 typedef struct s_smx_cond *smx_cond_t;
58 typedef struct s_smx_sem *smx_sem_t;
59
60 /********************************** Action *************************************/
61 typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized action handlers */
62
63
64
65 /* ****************************** Process *********************************** */
66 /** @brief Agent datatype  
67     @ingroup m_datatypes_management 
68
69     An agent may be defined as a <em>code</em>, with some <em>private
70     data</em>, executing in a <em>location</em>.
71     \see m_process_management
72   @{ */
73 typedef struct s_smx_process *smx_process_t;
74 /** @} */
75
76
77 /*
78  * Type of function that creates a process.
79  * The function must accept the following parameters:
80  * void* process: the process created will be stored there
81  * const char *name: a name for the object. It is for user-level information and can be NULL
82  * xbt_main_func_t code: is a function describing the behavior of the agent
83  * void *data: data a pointer to any data one may want to attach to the new object.
84  * smx_host_t host: the location where the new agent is executed
85  * int argc, char **argv: parameters passed to code
86  * xbt_dict_t pros: properties
87  */
88 typedef void (*smx_creation_func_t) ( /* process */ smx_process_t*,
89                                       /* name */ const char*,
90                                       /* code */ xbt_main_func_t,
91                                       /* userdata */ void*,
92                                       /* hostname */ const char*,
93                                       /* argc */ int,
94                                       /* argv */ char**,
95                                       /* props */ xbt_dict_t);
96
97
98 /******************************* Networking ***********************************/
99 typedef struct s_smx_rvpoint *smx_rdv_t;
100
101
102 SG_END_DECL()
103 #endif