Logo AND Algorithmique Numérique Distribuée

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