Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
chainsend: change tesh to test with 8192 pieces
[simgrid.git] / include / msg / datatypes.h
1 /* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef MSG_DATATYPE_H
7 #define MSG_DATATYPE_H
8 #include "xbt/misc.h"
9 #include "xbt/file_stat.h"
10 #include "simgrid/simix.h"
11 #include "simgrid_config.h"     // for HAVE_TRACING
12
13 SG_BEGIN_DECL()
14
15 /* ******************************** Mailbox ************************************ */
16
17 /** @brief Mailbox datatype
18  *  @ingroup msg_task_usage
19  *
20  * Object representing a communication rendez-vous point, on which
21  * the sender finds the receiver it wants to communicate with. As a
22  * MSG user, you will only rarely manipulate any of these objects
23  * directly, since most of the public interface (such as
24  * #MSG_task_send and friends) hide this object behind a string
25  * alias. That mean that you don't provide the mailbox on which you
26  * want to send your task, but only the name of this mailbox. */
27 typedef struct s_smx_rvpoint *msg_mailbox_t;
28
29
30 /* ******************************** Host ************************************ */
31
32 typedef struct msg_host {
33   xbt_swag_t vms;
34   smx_host_t smx_host;          /**< SIMIX representation of this host   */
35 #ifdef MSG_USE_DEPRECATED
36   msg_mailbox_t *mailboxes;     /**< the channels  */
37 #endif
38 } s_msg_host_t;
39
40 /** @brief Host datatype.
41     @ingroup m_host_management
42
43     A <em>location</em> (or <em>host</em>) is any possible place where
44     a process may run. Thus it is represented as a <em>physical
45     resource with computing capabilities</em>, some <em>mailboxes</em>
46     to enable running process to communicate with remote ones, and
47     some <em>private data</em> that can be only accessed by local
48     process.
49  */
50 typedef struct msg_host *msg_host_t;
51
52 /* ******************************** Task ************************************ */
53
54 typedef struct simdata_task *simdata_task_t;
55
56 typedef struct msg_task {
57   char *name;                   /**< @brief task name if any */
58   simdata_task_t simdata;       /**< @brief simulator data */
59   void *data;                   /**< @brief user data */
60 #ifdef HAVE_TRACING
61   long long int counter;        /* task unique identifier for instrumentation */
62   char *category;               /* task category for instrumentation */
63 #endif
64 } s_msg_task_t;
65
66 /** @brief Task datatype.
67     @ingroup m_task_management 
68
69     A <em>task</em> may then be defined by a <em>computing
70     amount</em>, a <em>message size</em> and some <em>private
71     data</em>.
72  */
73 typedef struct msg_task *msg_task_t;
74
75
76 /* ******************************** File ************************************ */
77 typedef struct simdata_file *simdata_file_t;
78
79 typedef struct msg_file {
80   char *name;                   /**< @brief file name */
81   simdata_file_t simdata;                /**< @brief simulator data  */
82   void *data;                   /**< @brief user data */
83 } s_msg_file_t;
84
85 /** @brief File datatype.
86     @ingroup msg_file_management 
87  
88     You should consider this as an opaque object.
89  */
90 typedef struct msg_file *msg_file_t;
91
92
93 /** @brief File datatype.
94     @ingroup msg_file_management
95
96     You should consider this as an opaque object.
97  */
98 typedef s_file_stat_t s_msg_stat_t, *msg_stat_t;
99
100
101 /*************** Begin GPU ***************/
102 typedef struct simdata_gpu_task *simdata_gpu_task_t;
103
104 typedef struct msg_gpu_task {
105   char *name;                   /**< @brief task name if any */
106   simdata_gpu_task_t simdata;       /**< @brief simulator data */
107 #ifdef HAVE_TRACING
108   long long int counter;        /* task unique identifier for instrumentation */
109   char *category;               /* task category for instrumentation */
110 #endif
111 } s_msg_gpu_task_t;
112
113 /** @brief GPU task datatype.
114     @ingroup m_task_management
115
116     A <em>task</em> may then be defined by a <em>computing
117     amount</em>, a <em>dispatch latency</em> and a <em>collect latency</em>.
118     \see m_task_management
119 */
120 typedef struct msg_gpu_task *msg_gpu_task_t;
121 /*************** End GPU ***************/
122
123 /**
124  * \brief @brief Communication action.
125  * \ingroup msg_task_usage
126  *
127  * Object representing an ongoing communication between processes. Such beast is usually obtained by using #MSG_task_isend, #MSG_task_irecv or friends.
128  */
129 typedef struct msg_comm *msg_comm_t;
130
131 /** \brief Default value for an uninitialized #msg_task_t.
132     \ingroup m_task_management 
133 */
134 #define MSG_TASK_UNINITIALIZED NULL
135
136 /* ****************************** Process *********************************** */
137
138 /** @brief Process datatype.
139     @ingroup m_process_management
140
141     A process may be defined as a <em>code</em>, with some
142     <em>private data</em>, executing in a <em>location</em>. 
143  
144     You should not access directly to the fields of the pointed
145     structure, but always use the provided API to interact with
146     processes.
147  */
148 typedef struct s_smx_process *msg_process_t;
149
150 #ifdef MSG_USE_DEPRECATED
151
152 /* Compatibility typedefs */
153 typedef int                     m_channel_t;
154 typedef msg_gpu_task_t          m_gpu_task_t;
155 typedef msg_host_t              m_host_t;
156 typedef msg_process_t           m_process_t;
157 typedef msg_task_t              m_task_t;
158 typedef s_msg_gpu_task_t        s_m_gpu_task_t;
159 typedef s_msg_host_t            s_m_host_t;
160 typedef s_msg_task_t            s_m_task_t;
161 #endif
162
163 SG_END_DECL()
164 #endif