Logo AND Algorithmique Numérique Distribuée

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