1 /* Copyright (c) 2004, 2005, 2007, 2008, 2009, 2010. 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. */
10 #include "xbt/file_stat.h"
11 #include "simgrid_config.h" // for HAVE_TRACING
15 /* ******************************** Host ************************************ */
17 /** @defgroup m_datatypes_management_details Details on MSG datatypes
18 @ingroup m_datatypes_management*/
19 typedef struct simdata_host *simdata_host_t;
21 /** @brief Host datatype
22 @ingroup m_datatypes_management_details */
23 typedef struct m_host {
24 char *name; /**< @brief host name if any */
25 simdata_host_t simdata; /**< @brief simulator data */
26 void *data; /**< @brief user data */
29 /** @brief Host datatype
30 @ingroup m_datatypes_management
32 A <em>location</em> (or <em>host</em>) is any possible place where
33 a process may run. Thus it is represented as a <em>physical
34 resource with computing capabilities</em>, some <em>mailboxes</em>
35 to enable running process to communicate with remote ones, and
36 some <em>private data</em> that can be only accessed by local
39 \see m_host_management
41 typedef struct m_host *m_host_t;
44 /* ******************************** Task ************************************ */
46 typedef struct simdata_task *simdata_task_t;
48 /** @brief Task datatype
49 @ingroup m_datatypes_management_details */
50 typedef struct m_task {
51 char *name; /**< @brief task name if any */
52 simdata_task_t simdata; /**< @brief simulator data */
53 void *data; /**< @brief user data */
55 long long int counter; /* task unique identifier for instrumentation */
56 char *category; /* task category for instrumentation */
60 /** @brief Task datatype
61 @ingroup m_datatypes_management
63 A <em>task</em> may then be defined by a <em>computing
64 amount</em>, a <em>message size</em> and some <em>private
66 \see m_task_management
68 typedef struct m_task *m_task_t;
70 /* ******************************** File ************************************ */
72 typedef struct simdata_file *simdata_file_t;
74 /** @brief File datatype
75 @ingroup m_datatypes_management_details */
76 typedef struct msg_file {
77 char *name; /**< @brief file name */
78 simdata_file_t simdata; /**< @brief simulator data */
79 void *data; /**< @brief user data */
81 /** @brief File datatype
82 @ingroup m_datatypes_management_details */
84 typedef struct msg_file *msg_file_t;
86 typedef s_file_stat_t s_msg_stat_t, *msg_stat_t;
89 /*************** Begin GPU ***************/
90 typedef struct simdata_gpu_task *simdata_gpu_task_t;
92 /** @brief GPU task datatype
93 @ingroup m_datatypes_management_details */
94 typedef struct m_gpu_task {
95 char *name; /**< @brief task name if any */
96 simdata_gpu_task_t simdata; /**< @brief simulator data */
98 long long int counter; /* task unique identifier for instrumentation */
99 char *category; /* task category for instrumentation */
103 /** @brief GPU task datatype
104 @ingroup m_datatypes_management
106 A <em>task</em> may then be defined by a <em>computing
107 amount</em>, a <em>dispatch latency</em> and a <em>collect latency</em>.
108 \see m_task_management
110 typedef struct m_gpu_task *m_gpu_task_t;
111 /*************** End GPU ***************/
114 * \brief @brief Communication action
115 * \ingroup m_datatypes_management
117 * Communication actions transfer tasks between processes.
118 * For a given task, the sender and the receiver have distinct objects.
120 typedef struct msg_comm *msg_comm_t;
122 /** \brief Default value for an uninitialized #m_task_t.
123 \ingroup m_datatypes_management
125 #define MSG_TASK_UNINITIALIZED NULL
129 /* ****************************** Process *********************************** */
131 /** @brief Process datatype
132 @ingroup m_datatypes_management
134 A process may be defined as a <em>code</em>, with some <em>private
135 data</em>, executing in a <em>location</em>.
136 \see m_process_management
138 typedef struct s_smx_process *m_process_t;
141 #ifdef MSG_USE_DEPRECATED
142 /* ********************************* Channel ******************************** */
143 /** @brief Channel datatype
144 @ingroup msg_deprecated_functions
146 A <em>channel</em> is a number and identifies a mailbox type (just as a
148 \see m_channel_management
150 typedef int m_channel_t;
154 /* ******************************** Mailbox ************************************ */
156 typedef struct s_smx_rvpoint *msg_mailbox_t;
157 /** @brief Mailbox datatype
158 @ingroup m_datatypes_management_details @{ */
160 void MSG_mailbox_free(void *mailbox);
166 /* ***************************** Error handling ***************************** */
167 /** @brief Error handling
168 @ingroup m_datatypes_management
170 *//* Keep these code as binary values: java bindings manipulate | of these values */
172 MSG_OK = 0, /**< @brief Everything is right. Keep on going this way ! */
173 MSG_TIMEOUT = 1, /**< @brief nothing good happened before the timer you provided elapsed */
174 MSG_TRANSFER_FAILURE = 2, /**< @brief There has been a problem during you task
175 transfer. Either the network is down or the remote host has been
177 MSG_HOST_FAILURE = 4, /**< @brief System shutdown. The host on which you are
178 running has just been rebooted. Free your datastructures and
180 MSG_TASK_CANCELED = 8 /**< @brief Canceled task. This task has been canceled by somebody!*/