Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
prefixing name functions by xbt_
[simgrid.git] / include / msg / datatypes.h
1 /*      $Id$     */
2
3 /* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved.        */
4
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. */
7
8 #ifndef MSG_DATATYPE_H
9 #define MSG_DATATYPE_H
10
11 /********************************* Host **************************************/
12
13 struct s_m_host {
14   char *name;                   /* host name if any */
15   void *simdata;                /* simulator data */
16   void *data;                   /* user data */
17 };
18 /** \brief Host datatype  
19     \ingroup m_datatypes_management
20
21     A <em>location</em> (or <em>host</em>) is any possible place where
22     a process may run. Thus it is represented as a <em>physical
23     resource with computing capabilities</em>, some <em>mailboxes</em>
24     to enable running process to communicate with remote ones, and
25     some <em>private data</em> that can be only accessed by local
26     process.
27
28     \see m_host_management
29 */
30 typedef struct s_m_host *m_host_t;
31
32 /********************************* Task **************************************/
33
34 struct s_m_task {
35   char *name;                   /* host name if any */
36   void *simdata;                /* simulator data */
37   void *data;                   /* user data */
38 };
39 /** \brief Task datatype  
40     \ingroup m_datatypes_management 
41
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
44     data</em>.
45     \see m_task_management
46 */
47 typedef struct s_m_task *m_task_t;
48
49 /** \brief Default value for an uninitialized #m_task_t.
50     \ingroup m_datatypes_management 
51 */
52 #define MSG_TASK_UNINITIALIZED NULL
53 /******************************* Process *************************************/
54
55 struct s_m_process {
56   char *name;                   /* process name if any */
57   void *simdata;                /* simulator data */
58   void *data;                   /* user data */
59 };
60 /** \brief Agent datatype  
61     \ingroup m_datatypes_management 
62     An agent may be defined as a <em>code</em>, with some <em>private
63     data</em>, executing in a <em>location</em>.
64     \see m_process_management
65 */
66 typedef struct s_m_process *m_process_t;
67 /** \brief Agent code datatype  
68     \ingroup m_datatypes_management 
69     The code of an agent is a m_process_code_t, i.e. a function with no arguments 
70     returning no value.
71     \see m_process_management
72 */
73 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
74
75 /********************************** Channel **********************************/
76 /** \brief Channel datatype  
77     \ingroup m_datatypes_management 
78     A <em>channel</em>  is a number and identifies a mailbox type (just as a 
79     port number does).
80     \see m_channel_management
81 */
82 typedef int m_channel_t;
83
84 /****************************** Error handling *******************************/
85 /** \brief Error handling
86 */typedef enum {
87   MSG_OK = 0,  /**< Everything is right. Keep on going this way ! */
88   MSG_WARNING, /**< Mmmh! Something must be not perfectly clean. But I
89       may be a paranoid freak... ! */
90   MSG_TRANSFER_FAILURE, /**< There has been a problem during you task
91       transfer. Either the network is down or the remote host has been
92       shutdown. */
93   MSG_HOST_FAILURE, /**< System shutdown. The host on which you are
94       running has just been rebooted. Free your datastructures and
95       return now !*/
96   MSG_FATAL /**< You've done something wrong. You'd better look at it... */
97 } MSG_error_t;
98
99 typedef enum {
100   MSG_SILENT = 0,
101   MSG_SOME,
102   MSG_VERBOSE
103 } MSG_outputmode_t;
104
105 typedef enum {
106   MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
107   MSG_TCP
108 } MSG_sharing_t;
109
110 /************************ deprecated *****************************************/
111 /* /\********************************* Link **************************************\/ */
112 /* struct s_m_link { */
113 /*   char *name;                        /\* link name if any *\/ */
114 /*   void *simdata;             /\* simulator data *\/ */
115 /*   void *data;                        /\* user data *\/ */
116 /* }; */
117
118 /* /\** \brief Link datatype   */
119 /*     \ingroup m_datatypes_management */
120
121 /*     A <em>link</em> is an agglomeration of communicating resources */
122 /*     representing a set of physical network links. */
123
124 /*     \see m_link_management */
125 /* *\/ */
126 /* typedef struct s_m_link *m_link_t; */
127
128 #endif