Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
updating the doc
[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 /** @name Host datatype  
14     \ingroup m_datatypes_management
15
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
21     process.
22
23     \see m_host_management
24 */
25 /*@{*/
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;
32 /*@}*/
33 /********************************* Task **************************************/
34
35 /** @name Task datatype  
36     \ingroup m_datatypes_management 
37
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
40     data</em>.
41     \see m_task_management
42 */
43 /*@{*/
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;
50
51 /** \brief Default value for an uninitialized #m_task_t.
52     \ingroup m_datatypes_management 
53 */
54 #define MSG_TASK_UNINITIALIZED NULL
55
56 /*@}*/
57
58 /******************************* Process *************************************/
59
60 /** @name Agent datatype  
61     \ingroup m_datatypes_management 
62
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
66 */
67 /*@{*/
68 typedef struct simdata_process *simdata_process_t;
69 typedef struct m_process {
70   /** A name */
71   /** process name if any */
72   char *name;                   
73   simdata_process_t simdata;    /* simulator data */
74   void *data;                   /* user data */
75 } s_m_process_t, *m_process_t;
76
77 /** 
78     The code of an agent is a m_process_code_t, i.e. a function with no arguments 
79     returning no value.
80     \see m_process_management
81 */
82 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
83 /*@}*/
84
85 /********************************** Channel **********************************/
86 /** @name Channel datatype  
87     \ingroup m_datatypes_management 
88
89     A <em>channel</em>  is a number and identifies a mailbox type (just as a 
90     port number does).
91     \see m_channel_management
92 */
93 /*@{*/
94 typedef int m_channel_t;
95 /*@}*/
96
97 /****************************** Error handling *******************************/
98 /** \brief Error handling
99 */typedef enum {
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
105       shutdown. */
106   MSG_HOST_FAILURE, /**< System shutdown. The host on which you are
107       running has just been rebooted. Free your datastructures and
108       return now !*/
109   MSG_FATAL /**< You've done something wrong. You'd better look at it... */
110 } MSG_error_t;
111
112 typedef enum {
113   MSG_SILENT = 0,
114   MSG_SOME,
115   MSG_VERBOSE
116 } MSG_outputmode_t;
117
118 /** \deprecated Network sharing mechanism
119     \ingroup m_datatypes_management*/
120 typedef enum {
121   MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
122   MSG_TCP
123 } MSG_sharing_t;
124
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...
131  */
132 typedef struct m_link *m_link_t;
133 #endif