Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplify msg_host_t by inlining the simdata field
[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/simix.h"
12 #include "simgrid_config.h"     // for HAVE_TRACING
13
14 SG_BEGIN_DECL()
15
16 /* ******************************** Mailbox ************************************ */
17
18 /** @brief Mailbox datatype
19  *  @ingroup msg_task_usage
20  *
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;
29
30
31 /* ******************************** Host ************************************ */
32
33 typedef struct m_host {
34   char *name;                   /**< @brief host name if any */
35   smx_host_t smx_host;          /**< SIMIX representation of this host   */
36 #ifdef MSG_USE_DEPRECATED
37   msg_mailbox_t *mailboxes;     /**< the channels  */
38 #endif
39 } s_m_host_t;
40
41 /** @brief Host datatype  
42     @ingroup m_host_management
43
44     A <em>location</em> (or <em>host</em>) is any possible place where
45     a process may run. Thus it is represented as a <em>physical
46     resource with computing capabilities</em>, some <em>mailboxes</em>
47     to enable running process to communicate with remote ones, and
48     some <em>private data</em> that can be only accessed by local
49     process.
50  */
51 typedef struct m_host *m_host_t;
52
53 /* ******************************** Task ************************************ */
54
55 typedef struct simdata_task *simdata_task_t;
56
57 typedef struct m_task {
58   char *name;                   /**< @brief task name if any */
59   simdata_task_t simdata;       /**< @brief simulator data */
60   void *data;                   /**< @brief user data */
61 #ifdef HAVE_TRACING
62   long long int counter;        /* task unique identifier for instrumentation */
63   char *category;               /* task category for instrumentation */
64 #endif
65 } s_m_task_t;
66
67 /** @brief Task datatype  
68     @ingroup m_task_management 
69
70     A <em>task</em> may then be defined by a <em>computing
71     amount</em>, a <em>message size</em> and some <em>private
72     data</em>.
73  */
74 typedef struct m_task *m_task_t;
75
76
77 /* ******************************** File ************************************ */
78 typedef struct simdata_file *simdata_file_t;
79
80 typedef struct msg_file {
81   char *name;                   /**< @brief file name */
82   simdata_file_t simdata;                /**< @brief simulator data  */
83   void *data;                   /**< @brief user data */
84 } s_msg_file_t;
85
86 /** @brief File datatype.
87     @ingroup msg_file_management 
88  
89     You should consider this as an opaque object.
90  */
91 typedef struct msg_file *msg_file_t;
92
93 typedef s_file_stat_t s_msg_stat_t, *msg_stat_t;
94
95
96 /*************** Begin GPU ***************/
97 typedef struct simdata_gpu_task *simdata_gpu_task_t;
98
99 typedef struct m_gpu_task {
100   char *name;                   /**< @brief task name if any */
101   simdata_gpu_task_t simdata;       /**< @brief simulator data */
102 #ifdef HAVE_TRACING
103   long long int counter;        /* task unique identifier for instrumentation */
104   char *category;               /* task category for instrumentation */
105 #endif
106 } s_m_gpu_task_t;
107
108 /** @brief GPU task datatype
109     @ingroup m_task_management
110
111     A <em>task</em> may then be defined by a <em>computing
112     amount</em>, a <em>dispatch latency</em> and a <em>collect latency</em>.
113     \see m_task_management
114 */
115 typedef struct m_gpu_task *m_gpu_task_t;
116 /*************** End GPU ***************/
117
118 /**
119  * \brief @brief Communication action.
120  * \ingroup msg_task_usage
121  *
122  * Object representing an ongoing communication between processes. Such beast is usually obtained by using #MSG_task_isend, #MSG_task_irecv or friends.
123  */
124 typedef struct msg_comm *msg_comm_t;
125
126 /** \brief Default value for an uninitialized #m_task_t.
127     \ingroup m_task_management 
128 */
129 #define MSG_TASK_UNINITIALIZED NULL
130
131 /* ****************************** Process *********************************** */
132
133 /** @brief Process datatype.
134     @ingroup m_process_management
135
136     A process may be defined as a <em>code</em>, with some
137     <em>private data</em>, executing in a <em>location</em>. 
138  
139     You should not access directly to the fields of the pointed
140     structure, but always use the provided API to interact with
141     processes.
142  */
143 typedef struct s_smx_process *m_process_t;
144
145 #ifdef MSG_USE_DEPRECATED
146 typedef int m_channel_t;
147 #endif
148
149
150
151 SG_END_DECL()
152 #endif