Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
08a6b2626d8172a1f524c0a62eadf41d78c3225b
[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 msg_task_usage
105  *
106  * Object representing an ongoing communication between processes. Such beast is usually obtained by using #MSG_task_isend, #MSG_task_irecv or friends.
107  */
108 typedef struct msg_comm *msg_comm_t;
109
110 /** \brief Default value for an uninitialized #m_task_t.
111     \ingroup m_task_management 
112 */
113 #define MSG_TASK_UNINITIALIZED NULL
114
115 /* ****************************** Process *********************************** */
116
117 /** @brief Process datatype.
118     @ingroup m_process_management
119
120     A process may be defined as a <em>code</em>, with some
121     <em>private data</em>, executing in a <em>location</em>. 
122  
123     You should not access directly to the fields of the pointed
124     structure, but always use the provided API to interact with
125     processes.
126  */
127 typedef struct s_smx_process *m_process_t;
128
129 #ifdef MSG_USE_DEPRECATED
130 typedef int m_channel_t;
131 #endif
132
133 /* ******************************** Mailbox ************************************ */
134
135 /** @brief Mailbox datatype
136  *  @ingroup msg_task_usage
137  * 
138  * Object representing a communication rendez-vous point, on which
139  * the sender finds the receiver it wants to communicate with. As a
140  * MSG user, you will only rarely manipulate any of these objects
141  * directly, since most of the public interface (such as
142  * #MSG_task_send and friends) hide this object behind a string
143  * alias. That mean that you don't provide the mailbox on which you
144  * want to send your task, but only the name of this mailbox. */
145 typedef struct s_smx_rvpoint *msg_mailbox_t;
146
147
148 SG_END_DECL()
149 #endif