1 /* Copyright (c) 2004-2014. The SimGrid Team.
2 * All rights reserved. */
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. */
11 #include "simgrid/simix.h"
12 #include "simgrid_config.h" // for HAVE_TRACING
16 /* ******************************** Mailbox ************************************ */
18 /** @brief Mailbox datatype
19 * @ingroup msg_task_usage
21 * Object representing a communication rendez-vous point, on which
22 * the sender finds the receiver it wants to communicate with. As a
23 * MSG user, you will only rarely manipulate any of these objects
24 * directly, since most of the public interface (such as
25 * #MSG_task_send and friends) hide this object behind a string
26 * alias. That mean that you don't provide the mailbox on which you
27 * want to send your task, but only the name of this mailbox. */
28 typedef struct s_smx_rvpoint *msg_mailbox_t;
30 /* ******************************** Environment ************************************ */
31 typedef struct As *msg_as_t;
33 /* ******************************** Host ************************************ */
35 extern int MSG_HOST_LEVEL;
37 /** @brief Host datatype.
38 @ingroup m_host_management
40 A <em>location</em> (or <em>host</em>) is any possible place where
41 a process may run. Thus it is represented as a <em>physical
42 resource with computing capabilities</em>, some <em>mailboxes</em>
43 to enable running process to communicate with remote ones, and
44 some <em>private data</em> that can be only accessed by local
47 typedef xbt_dictelm_t msg_host_t;
48 typedef s_xbt_dictelm_t s_msg_host_t;
50 typedef struct msg_host_priv {
53 double dp_updated_by_deleted_tasks;
56 xbt_dict_t affinity_mask_db;
58 #ifdef MSG_USE_DEPRECATED
59 msg_mailbox_t *mailboxes; /**< the channels */
61 } s_msg_host_priv_t, *msg_host_priv_t;
63 static inline msg_host_priv_t MSG_host_priv(msg_host_t host){
64 return (msg_host_priv_t )xbt_lib_get_level(host, MSG_HOST_LEVEL);
69 /* ******************************** Task ************************************ */
71 typedef struct simdata_task *simdata_task_t;
73 typedef struct msg_task {
74 char *name; /**< @brief task name if any */
75 simdata_task_t simdata; /**< @brief simulator data */
76 void *data; /**< @brief user data */
78 long long int counter; /* task unique identifier for instrumentation */
79 char *category; /* task category for instrumentation */
83 /** @brief Task datatype.
84 @ingroup m_task_management
86 A <em>task</em> may then be defined by a <em>computing
87 amount</em>, a <em>message size</em> and some <em>private
90 typedef struct msg_task *msg_task_t;
92 /* ******************************** VM ************************************* */
93 typedef msg_host_t msg_vm_t;
94 typedef msg_host_priv_t msg_vm_priv_t;
96 static inline msg_vm_priv_t MSG_vm_priv(msg_vm_t vm){
97 return (msg_vm_priv_t) xbt_lib_get_level(vm, MSG_HOST_LEVEL);
100 /** ******************************** File ************************************ */
102 /** @brief File datatype.
103 * @ingroup msg_file_management
105 * You should consider this as an opaque object.
107 typedef xbt_dictelm_t msg_file_t;
108 typedef s_xbt_dictelm_t s_msg_file_t;
110 extern int MSG_FILE_LEVEL;
111 typedef struct simdata_file *simdata_file_t;
113 typedef struct msg_file_priv {
121 simdata_file_t simdata;
122 } s_msg_file_priv_t, *msg_file_priv_t;
124 static inline msg_file_priv_t MSG_file_priv(msg_file_t file){
125 return (msg_file_priv_t )xbt_lib_get_level(file, MSG_FILE_LEVEL);
128 /* ******************************** Storage ************************************ */
129 /* TODO: PV: to comment */
131 extern int MSG_STORAGE_LEVEL;
133 /** @brief Storage datatype.
134 * @ingroup msg_storage_management
136 * You should consider this as an opaque object.
138 typedef xbt_dictelm_t msg_storage_t;
139 typedef s_xbt_dictelm_t s_msg_storage_t;
141 typedef struct msg_storage_priv {
142 const char *hostname;
144 } s_msg_storage_priv_t, *msg_storage_priv_t;
146 static inline msg_storage_priv_t MSG_storage_priv(msg_storage_t storage){
147 return (msg_storage_priv_t )xbt_lib_get_level(storage, MSG_STORAGE_LEVEL);
150 /*************** Begin GPU ***************/
151 typedef struct simdata_gpu_task *simdata_gpu_task_t;
153 typedef struct msg_gpu_task {
154 char *name; /**< @brief task name if any */
155 simdata_gpu_task_t simdata; /**< @brief simulator data */
157 long long int counter; /* task unique identifier for instrumentation */
158 char *category; /* task category for instrumentation */
162 /** @brief GPU task datatype.
163 @ingroup m_task_management
165 A <em>task</em> may then be defined by a <em>computing
166 amount</em>, a <em>dispatch latency</em> and a <em>collect latency</em>.
167 \see m_task_management
169 typedef struct msg_gpu_task *msg_gpu_task_t;
170 /*************** End GPU ***************/
173 * \brief @brief Communication action.
174 * \ingroup msg_task_usage
176 * Object representing an ongoing communication between processes. Such beast is usually obtained by using #MSG_task_isend, #MSG_task_irecv or friends.
178 typedef struct msg_comm *msg_comm_t;
180 /** \brief Default value for an uninitialized #msg_task_t.
181 \ingroup m_task_management
183 #define MSG_TASK_UNINITIALIZED NULL
185 /* ****************************** Process *********************************** */
187 /** @brief Process datatype.
188 @ingroup m_process_management
190 A process may be defined as a <em>code</em>, with some
191 <em>private data</em>, executing in a <em>location</em>.
193 You should not access directly to the fields of the pointed
194 structure, but always use the provided API to interact with
197 typedef struct s_smx_process *msg_process_t;
199 #ifdef MSG_USE_DEPRECATED
201 /* Compatibility typedefs */
202 typedef int m_channel_t;
203 typedef msg_gpu_task_t m_gpu_task_t;
204 typedef msg_host_t m_host_t;
205 typedef msg_process_t m_process_t;
206 typedef msg_task_t m_task_t;
207 typedef s_msg_gpu_task_t s_m_gpu_task_t;
208 typedef s_msg_host_t s_m_host_t;
209 typedef s_msg_task_t s_m_task_t;