3 /* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
14 /** \defgroup m_datatypes_management MSG Data Types
15 \brief This section describes the different datatypes provided by MSG.
18 /********************************* Host **************************************/
20 /** @name Host datatype
21 \ingroup m_datatypes_management
23 A <em>location</em> (or <em>host</em>) is any possible place where
24 a process may run. Thus it is represented as a <em>physical
25 resource with computing capabilities</em>, some <em>mailboxes</em>
26 to enable running process to communicate with remote ones, and
27 some <em>private data</em> that can be only accessed by local
30 \see m_host_management
33 typedef struct simdata_host *simdata_host_t;
34 typedef struct m_host {
35 char *name; /**< host name if any */
36 simdata_host_t simdata; /**< simulator data */
37 void *data; /**< user data */
38 } s_m_host_t, *m_host_t;
40 /********************************* Task **************************************/
42 /** @name Task datatype
43 \ingroup m_datatypes_management
45 A <em>task</em> may then be defined by a <em>computing
46 amount</em>, a <em>message size</em> and some <em>private
48 \see m_task_management
51 typedef struct simdata_task *simdata_task_t;
52 typedef struct m_task {
53 char *name; /* host name if any */
54 simdata_task_t simdata; /* simulator data */
55 void *data; /* user data */
56 } s_m_task_t, *m_task_t;
58 /** \brief Default value for an uninitialized #m_task_t.
59 \ingroup m_datatypes_management
61 #define MSG_TASK_UNINITIALIZED NULL
65 /******************************* Process *************************************/
67 /** @name Agent datatype
68 \ingroup m_datatypes_management
70 An agent may be defined as a <em>code</em>, with some <em>private
71 data</em>, executing in a <em>location</em>.
72 \see m_process_management
75 typedef struct simdata_process *simdata_process_t;
76 typedef struct m_process {
78 /** process name if any */
80 simdata_process_t simdata; /* simulator data */
81 void *data; /* user data */
82 } s_m_process_t, *m_process_t;
85 The code of an agent is a m_process_code_t, i.e. a function with no arguments
87 \see m_process_management
89 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
92 /********************************** Channel **********************************/
93 /** @name Channel datatype
94 \ingroup m_datatypes_management
96 A <em>channel</em> is a number and identifies a mailbox type (just as a
98 \see m_channel_management
101 typedef int m_channel_t;
104 /****************************** Error handling *******************************/
105 /** \brief Error handling
107 MSG_OK = 0, /**< Everything is right. Keep on going this way ! */
108 MSG_WARNING, /**< Mmmh! Something must be not perfectly clean. But I
109 may be a paranoid freak... ! */
110 MSG_TRANSFER_FAILURE, /**< There has been a problem during you task
111 transfer. Either the network is down or the remote host has been
113 MSG_HOST_FAILURE, /**< System shutdown. The host on which you are
114 running has just been rebooted. Free your datastructures and
116 MSG_FATAL /**< You've done something wrong. You'd better look at it... */
125 /** \deprecated Network sharing mechanism
126 \ingroup m_datatypes_management*/
128 MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
132 /** \deprecated Link datatype
133 * \ingroup m_datatypes_management
134 * The notion of <em>link</em> was present in the earliest versions of MSG.
135 * It was an agglomeration of communicating resources representing a set of
136 * physical network links. This abstraction a disappeared because in real-life,
137 * it is generally not possible to interact directly with a link...
139 typedef struct m_link *m_link_t;