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 /********************************* Host **************************************/
13 /** @name Host datatype
14 \ingroup m_datatypes_management
16 A <em>location</em> (or <em>host</em>) is any possible place where
17 a process may run. Thus it is represented as a <em>physical
18 resource with computing capabilities</em>, some <em>mailboxes</em>
19 to enable running process to communicate with remote ones, and
20 some <em>private data</em> that can be only accessed by local
23 \see m_host_management
26 typedef struct simdata_host *simdata_host_t;
27 typedef struct m_host {
28 char *name; /**< host name if any */
29 simdata_host_t simdata; /**< simulator data */
30 void *data; /**< user data */
31 } s_m_host_t, *m_host_t;
33 /********************************* Task **************************************/
35 /** @name Task datatype
36 \ingroup m_datatypes_management
38 A <em>task</em> may then be defined by a <em>computing
39 amount</em>, a <em>message size</em> and some <em>private
41 \see m_task_management
44 typedef struct simdata_task *simdata_task_t;
45 typedef struct m_task {
46 char *name; /* host name if any */
47 simdata_task_t simdata; /* simulator data */
48 void *data; /* user data */
49 } s_m_task_t, *m_task_t;
51 /** \brief Default value for an uninitialized #m_task_t.
52 \ingroup m_datatypes_management
54 #define MSG_TASK_UNINITIALIZED NULL
58 /******************************* Process *************************************/
60 /** @name Agent datatype
61 \ingroup m_datatypes_management
63 An agent may be defined as a <em>code</em>, with some <em>private
64 data</em>, executing in a <em>location</em>.
65 \see m_process_management
68 typedef struct simdata_process *simdata_process_t;
69 typedef struct m_process {
71 /** process name if any */
73 simdata_process_t simdata; /* simulator data */
74 void *data; /* user data */
75 } s_m_process_t, *m_process_t;
78 The code of an agent is a m_process_code_t, i.e. a function with no arguments
80 \see m_process_management
82 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
85 /********************************** Channel **********************************/
86 /** @name Channel datatype
87 \ingroup m_datatypes_management
89 A <em>channel</em> is a number and identifies a mailbox type (just as a
91 \see m_channel_management
94 typedef int m_channel_t;
97 /****************************** Error handling *******************************/
98 /** \brief Error handling
100 MSG_OK = 0, /**< Everything is right. Keep on going this way ! */
101 MSG_WARNING, /**< Mmmh! Something must be not perfectly clean. But I
102 may be a paranoid freak... ! */
103 MSG_TRANSFER_FAILURE, /**< There has been a problem during you task
104 transfer. Either the network is down or the remote host has been
106 MSG_HOST_FAILURE, /**< System shutdown. The host on which you are
107 running has just been rebooted. Free your datastructures and
109 MSG_FATAL /**< You've done something wrong. You'd better look at it... */
118 /** \deprecated Network sharing mechanism
119 \ingroup m_datatypes_management*/
121 MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
125 /** \deprecated Link datatype
126 * \ingroup m_datatypes_management
127 * The notion of <em>link</em> was present in the earliest versions of MSG.
128 * It was an agglomeration of communicating resources representing a set of
129 * physical network links. This abstraction a disappeared because in real-life,
130 * it is generally not possible to interact directly with a link...
132 typedef struct m_link *m_link_t;