Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
improve the doc of MSG datatypes (and dispatch them in the relevant modules)
[simgrid.git] / include / msg / datatypes.h
1 /* Copyright (c) 2004, 2005, 2007, 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 MSG_DATATYPE_H
8 #define MSG_DATATYPE_H
9 #include "xbt/misc.h"
10 #include "xbt/file_stat.h"
11 #include "simgrid_config.h"     // for HAVE_TRACING
12
13 SG_BEGIN_DECL()
14
15 /* ******************************** Host ************************************ */
16
17 typedef struct simdata_host *simdata_host_t;
18
19 typedef struct m_host {
20   char *name;                   /**< @brief host name if any */
21   simdata_host_t simdata;       /**< @brief simulator data */
22   void *data;                   /**< @brief user data */
23 } s_m_host_t;
24
25 /** @brief Host datatype  
26     @ingroup m_host_management
27
28     A <em>location</em> (or <em>host</em>) is any possible place where
29     a process may run. Thus it is represented as a <em>physical
30     resource with computing capabilities</em>, some <em>mailboxes</em>
31     to enable running process to communicate with remote ones, and
32     some <em>private data</em> that can be only accessed by local
33     process.
34  */
35 typedef struct m_host *m_host_t;
36
37 /* ******************************** Task ************************************ */
38
39 typedef struct simdata_task *simdata_task_t;
40
41 typedef struct m_task {
42   char *name;                   /**< @brief task name if any */
43   simdata_task_t simdata;       /**< @brief simulator data */
44   void *data;                   /**< @brief user data */
45 #ifdef HAVE_TRACING
46   long long int counter;        /* task unique identifier for instrumentation */
47   char *category;               /* task category for instrumentation */
48 #endif
49 } s_m_task_t;
50
51 /** @brief Task datatype  
52     @ingroup m_task_management 
53
54     A <em>task</em> may then be defined by a <em>computing
55     amount</em>, a <em>message size</em> and some <em>private
56     data</em>.
57  */
58 typedef struct m_task *m_task_t;
59
60
61 /* ******************************** File ************************************ */
62 typedef struct simdata_file *simdata_file_t;
63
64 typedef struct msg_file {
65   char *name;                   /**< @brief file name */
66   simdata_file_t simdata;                /**< @brief simulator data  */
67   void *data;                   /**< @brief user data */
68 } s_msg_file_t;
69
70 /** @brief File datatype.
71     @ingroup msg_file_management 
72  
73     You should consider this as an opaque object.
74  */
75 typedef struct msg_file *msg_file_t;
76
77 typedef s_file_stat_t s_msg_stat_t, *msg_stat_t;
78
79
80 /*************** Begin GPU ***************/
81 typedef struct simdata_gpu_task *simdata_gpu_task_t;
82
83 typedef struct m_gpu_task {
84   char *name;                   /**< @brief task name if any */
85   simdata_gpu_task_t simdata;       /**< @brief simulator data */
86 #ifdef HAVE_TRACING
87   long long int counter;        /* task unique identifier for instrumentation */
88   char *category;               /* task category for instrumentation */
89 #endif
90 } s_m_gpu_task_t;
91
92 /** @brief GPU task datatype
93     @ingroup m_task_management
94
95     A <em>task</em> may then be defined by a <em>computing
96     amount</em>, a <em>dispatch latency</em> and a <em>collect latency</em>.
97     \see m_task_management
98 */
99 typedef struct m_gpu_task *m_gpu_task_t;
100 /*************** End GPU ***************/
101
102 /**
103  * \brief @brief Communication action.
104  * \ingroup m_datatypes_management
105  *
106  * Communication actions transfer tasks between processes.
107  * For a given task, the sender and the receiver have distinct objects.
108  */
109 typedef struct msg_comm *msg_comm_t;
110
111 /** \brief Default value for an uninitialized #m_task_t.
112     \ingroup m_task_management 
113 */
114 #define MSG_TASK_UNINITIALIZED NULL
115
116 /* ****************************** Process *********************************** */
117
118 /** @brief Process datatype.
119     @ingroup m_process_management
120
121     A process may be defined as a <em>code</em>, with some
122     <em>private data</em>, executing in a <em>location</em>. 
123  
124     You should not access directly to the fields of the pointed
125     structure, but always use the provided API to interact with
126     processes.
127  */
128 typedef struct s_smx_process *m_process_t;
129
130 #ifdef MSG_USE_DEPRECATED
131 typedef int m_channel_t;
132 #endif
133
134 /* ******************************** Mailbox ************************************ */
135
136 /** @brief Mailbox datatype
137     @ingroup m_datatypes_management
138  */
139 typedef struct s_smx_rvpoint *msg_mailbox_t;
140
141
142 SG_END_DECL()
143 #endif