1 /* Copyright (c) 2004-2012. The SimGrid Team. All rights reserved. */
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. */
10 #include "simgrid/simix.h"
11 #include "simgrid_config.h" // for HAVE_TRACING
15 /* ******************************** Mailbox ************************************ */
17 /** @brief Mailbox datatype
18 * @ingroup msg_task_usage
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;
29 /* ******************************** Environment ************************************ */
30 typedef struct s_as *msg_as_t;
32 /* ******************************** Host ************************************ */
34 extern int MSG_HOST_LEVEL;
36 /** @brief Host datatype.
37 @ingroup m_host_management
39 A <em>location</em> (or <em>host</em>) is any possible place where
40 a process may run. Thus it is represented as a <em>physical
41 resource with computing capabilities</em>, some <em>mailboxes</em>
42 to enable running process to communicate with remote ones, and
43 some <em>private data</em> that can be only accessed by local
46 typedef xbt_dictelm_t msg_host_t;
47 typedef s_xbt_dictelm_t s_msg_host_t;
49 typedef struct msg_host_priv {
52 double dp_updated_by_deleted_tasks;
54 #ifdef MSG_USE_DEPRECATED
55 msg_mailbox_t *mailboxes; /**< the channels */
57 } s_msg_host_priv_t, *msg_host_priv_t;
59 static inline msg_host_priv_t MSG_host_priv(msg_host_t host){
60 return (msg_host_priv_t )xbt_lib_get_level(host, MSG_HOST_LEVEL);
65 /* ******************************** Task ************************************ */
67 typedef struct simdata_task *simdata_task_t;
69 typedef struct msg_task {
70 char *name; /**< @brief task name if any */
71 simdata_task_t simdata; /**< @brief simulator data */
72 void *data; /**< @brief user data */
74 long long int counter; /* task unique identifier for instrumentation */
75 char *category; /* task category for instrumentation */
79 /** @brief Task datatype.
80 @ingroup m_task_management
82 A <em>task</em> may then be defined by a <em>computing
83 amount</em>, a <em>message size</em> and some <em>private
86 typedef struct msg_task *msg_task_t;
88 /* ******************************** VM ************************************* */
89 typedef msg_host_t msg_vm_t;
90 typedef msg_host_priv_t msg_vm_priv_t;
92 static inline msg_vm_priv_t MSG_vm_priv(msg_vm_t vm){
93 return xbt_lib_get_level(vm, MSG_HOST_LEVEL);
96 /* ******************************** File ************************************ */
97 typedef struct simdata_file *simdata_file_t;
99 typedef struct msg_file {
100 char *name; /**< @brief file name */
102 simdata_file_t simdata; /**< @brief simulator data */
103 void *data; /**< @brief user data */
106 /** @brief File datatype.
107 @ingroup msg_file_management
109 You should consider this as an opaque object.
111 typedef struct msg_file *msg_file_t;
113 /*************** Begin GPU ***************/
114 typedef struct simdata_gpu_task *simdata_gpu_task_t;
116 typedef struct msg_gpu_task {
117 char *name; /**< @brief task name if any */
118 simdata_gpu_task_t simdata; /**< @brief simulator data */
120 long long int counter; /* task unique identifier for instrumentation */
121 char *category; /* task category for instrumentation */
125 /** @brief GPU task datatype.
126 @ingroup m_task_management
128 A <em>task</em> may then be defined by a <em>computing
129 amount</em>, a <em>dispatch latency</em> and a <em>collect latency</em>.
130 \see m_task_management
132 typedef struct msg_gpu_task *msg_gpu_task_t;
133 /*************** End GPU ***************/
136 * \brief @brief Communication action.
137 * \ingroup msg_task_usage
139 * Object representing an ongoing communication between processes. Such beast is usually obtained by using #MSG_task_isend, #MSG_task_irecv or friends.
141 typedef struct msg_comm *msg_comm_t;
143 /** \brief Default value for an uninitialized #msg_task_t.
144 \ingroup m_task_management
146 #define MSG_TASK_UNINITIALIZED NULL
148 /* ****************************** Process *********************************** */
150 /** @brief Process datatype.
151 @ingroup m_process_management
153 A process may be defined as a <em>code</em>, with some
154 <em>private data</em>, executing in a <em>location</em>.
156 You should not access directly to the fields of the pointed
157 structure, but always use the provided API to interact with
160 typedef struct s_smx_process *msg_process_t;
162 #ifdef MSG_USE_DEPRECATED
164 /* Compatibility typedefs */
165 typedef int m_channel_t;
166 typedef msg_gpu_task_t m_gpu_task_t;
167 typedef msg_host_t m_host_t;
168 typedef msg_process_t m_process_t;
169 typedef msg_task_t m_task_t;
170 typedef s_msg_gpu_task_t s_m_gpu_task_t;
171 typedef s_msg_host_t s_m_host_t;
172 typedef s_msg_task_t s_m_task_t;