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. */
11 /** \defgroup m_datatypes_management MSG Data Types
12 \brief This section describes the different datatypes provided by MSG.
15 /********************************* Host **************************************/
17 /** @name Host datatype
18 \ingroup m_datatypes_management
20 A <em>location</em> (or <em>host</em>) is any possible place where
21 a process may run. Thus it is represented as a <em>physical
22 resource with computing capabilities</em>, some <em>mailboxes</em>
23 to enable running process to communicate with remote ones, and
24 some <em>private data</em> that can be only accessed by local
27 \see m_host_management
30 typedef struct simdata_host *simdata_host_t;
31 typedef struct m_host {
32 char *name; /**< host name if any */
33 simdata_host_t simdata; /**< simulator data */
34 void *data; /**< user data */
35 } s_m_host_t, *m_host_t;
37 /********************************* Task **************************************/
39 /** @name Task datatype
40 \ingroup m_datatypes_management
42 A <em>task</em> may then be defined by a <em>computing
43 amount</em>, a <em>message size</em> and some <em>private
45 \see m_task_management
48 typedef struct simdata_task *simdata_task_t;
49 typedef struct m_task {
50 char *name; /* host name if any */
51 simdata_task_t simdata; /* simulator data */
52 void *data; /* user data */
53 } s_m_task_t, *m_task_t;
55 /** \brief Default value for an uninitialized #m_task_t.
56 \ingroup m_datatypes_management
58 #define MSG_TASK_UNINITIALIZED NULL
62 /******************************* Process *************************************/
64 /** @name Agent datatype
65 \ingroup m_datatypes_management
67 An agent may be defined as a <em>code</em>, with some <em>private
68 data</em>, executing in a <em>location</em>.
69 \see m_process_management
72 typedef struct simdata_process *simdata_process_t;
73 typedef struct m_process {
75 /** process name if any */
77 simdata_process_t simdata; /* simulator data */
78 void *data; /* user data */
79 } s_m_process_t, *m_process_t;
82 The code of an agent is a m_process_code_t, i.e. a function with no arguments
84 \see m_process_management
86 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
89 /********************************** Channel **********************************/
90 /** @name Channel datatype
91 \ingroup m_datatypes_management
93 A <em>channel</em> is a number and identifies a mailbox type (just as a
95 \see m_channel_management
98 typedef int m_channel_t;
101 /****************************** Error handling *******************************/
102 /** \brief Error handling
104 MSG_OK = 0, /**< Everything is right. Keep on going this way ! */
105 MSG_WARNING, /**< Mmmh! Something must be not perfectly clean. But I
106 may be a paranoid freak... ! */
107 MSG_TRANSFER_FAILURE, /**< There has been a problem during you task
108 transfer. Either the network is down or the remote host has been
110 MSG_HOST_FAILURE, /**< System shutdown. The host on which you are
111 running has just been rebooted. Free your datastructures and
113 MSG_FATAL /**< You've done something wrong. You'd better look at it... */
122 /** \deprecated Network sharing mechanism
123 \ingroup m_datatypes_management*/
125 MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
129 /** \deprecated Link datatype
130 * \ingroup m_datatypes_management
131 * The notion of <em>link</em> was present in the earliest versions of MSG.
132 * It was an agglomeration of communicating resources representing a set of
133 * physical network links. This abstraction a disappeared because in real-life,
134 * it is generally not possible to interact directly with a link...
136 typedef struct m_link *m_link_t;