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 "simgrid_config.h" // for HAVE_TRACING
14 /* ******************************** Host ************************************ */
15 /** @defgroup m_datatypes_management_details Details on MSG datatypes
16 @ingroup m_datatypes_management*/
17 typedef struct simdata_host *simdata_host_t;
18 /** @brief Host datatype
19 @ingroup m_datatypes_management_details */
20 typedef struct m_host {
21 char *name; /**< @brief host name if any */
22 simdata_host_t simdata; /**< @brief simulator data */
23 void *data; /**< @brief user data */
25 /** @brief Host datatype
26 @ingroup m_datatypes_management
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
35 \see m_host_management
37 typedef struct m_host *m_host_t;
39 /* ******************************** Task ************************************ */
41 typedef struct simdata_task *simdata_task_t;
42 /** @brief Task datatype
43 @ingroup m_datatypes_management_details */
44 typedef struct m_task {
45 char *name; /**< @brief task name if any */
46 simdata_task_t simdata; /**< @brief simulator data */
47 void *data; /**< @brief user data */
49 long long int counter; /* task unique identifier for instrumentation */
50 char *category; /* task category for instrumentation */
53 /** @brief Task datatype
54 @ingroup m_datatypes_management
56 A <em>task</em> may then be defined by a <em>computing
57 amount</em>, a <em>message size</em> and some <em>private
59 \see m_task_management
61 typedef struct m_task *m_task_t;
64 * \brief @brief Communication action
65 * \ingroup m_datatypes_management
67 * Communication actions transfer tasks between processes.
68 * For a given task, the sender and the receiver have distinct objects.
70 typedef struct msg_comm *msg_comm_t;
72 /** \brief Default value for an uninitialized #m_task_t.
73 \ingroup m_datatypes_management
75 #define MSG_TASK_UNINITIALIZED NULL
81 /* ****************************** Process *********************************** */
82 typedef struct simdata_process *simdata_process_t;
83 /** @brief Process datatype
84 @ingroup m_datatypes_management_details @{ */
85 typedef struct m_process {
86 s_xbt_swag_hookup_t process_list_hookup;
87 char *name; /**< @brief process name if any */
88 simdata_process_t simdata;
89 /**< @brief simulator data */
90 void *data; /**< @brief user data */
93 /** @brief Agent datatype
94 @ingroup m_datatypes_management
96 An agent may be defined as a <em>code</em>, with some <em>private
97 data</em>, executing in a <em>location</em>.
98 \see m_process_management
100 typedef struct m_process *m_process_t;
103 /* ********************************* Channel ******************************** */
104 /** @brief Channel datatype
105 @ingroup m_datatypes_management
107 A <em>channel</em> is a number and identifies a mailbox type (just as a
109 \see m_channel_management
111 typedef int m_channel_t;
114 /* ******************************** Mailbox ************************************ */
116 typedef struct s_smx_rvpoint *msg_mailbox_t;
117 /** @brief Mailbox datatype
118 @ingroup m_datatypes_management_details @{ */
120 void MSG_mailbox_free(void *mailbox);
126 /* ***************************** Error handling ***************************** */
127 /** @brief Error handling
128 @ingroup m_datatypes_management
130 *//* Keep these code as binary values: java bindings manipulate | of these values */
132 MSG_OK = 0, /**< @brief Everything is right. Keep on going this way ! */
133 MSG_TIMEOUT = 1, /**< @brief nothing good happened before the timer you provided elapsed */
134 MSG_TRANSFER_FAILURE = 2, /**< @brief There has been a problem during you task
135 transfer. Either the network is down or the remote host has been
137 MSG_HOST_FAILURE = 4, /**< @brief System shutdown. The host on which you are
138 running has just been rebooted. Free your datastructures and
140 MSG_TASK_CANCELLED = 8, /**< @brief Canceled task. This task has been canceled by somebody!*/