Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SURF does not use long doubles. Reverting MSG to doubles.
[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 /** \defgroup m_datatypes_management MSG Data Types 
12     \brief This section describes the different datatypes provided by MSG.
13 */
14
15 /********************************* Host **************************************/
16
17 /** @name Host datatype  
18     \ingroup m_datatypes_management
19
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
25     process.
26
27     \see m_host_management
28 */
29 /*@{*/
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;
36 /*@}*/
37 /********************************* Task **************************************/
38
39 /** @name 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 /*@{*/
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;
54
55 /** \brief Default value for an uninitialized #m_task_t.
56     \ingroup m_datatypes_management 
57 */
58 #define MSG_TASK_UNINITIALIZED NULL
59
60 /*@}*/
61
62 /******************************* Process *************************************/
63
64 /** @name Agent datatype  
65     \ingroup m_datatypes_management 
66
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
70 */
71 /*@{*/
72 typedef struct simdata_process *simdata_process_t;
73 typedef struct m_process {
74   /** A name */
75   /** process name if any */
76   char *name;                   
77   simdata_process_t simdata;    /* simulator data */
78   void *data;                   /* user data */
79 } s_m_process_t, *m_process_t;
80
81 /** 
82     The code of an agent is a m_process_code_t, i.e. a function with no arguments 
83     returning no value.
84     \see m_process_management
85 */
86 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
87 /*@}*/
88
89 /********************************** Channel **********************************/
90 /** @name Channel datatype  
91     \ingroup m_datatypes_management 
92
93     A <em>channel</em>  is a number and identifies a mailbox type (just as a 
94     port number does).
95     \see m_channel_management
96 */
97 /*@{*/
98 typedef int m_channel_t;
99 /*@}*/
100
101 /****************************** Error handling *******************************/
102 /** \brief Error handling
103 */typedef enum {
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
109       shutdown. */
110   MSG_HOST_FAILURE, /**< System shutdown. The host on which you are
111       running has just been rebooted. Free your datastructures and
112       return now !*/
113   MSG_FATAL /**< You've done something wrong. You'd better look at it... */
114 } MSG_error_t;
115
116 typedef enum {
117   MSG_SILENT = 0,
118   MSG_SOME,
119   MSG_VERBOSE
120 } MSG_outputmode_t;
121
122 /** \deprecated Network sharing mechanism
123     \ingroup m_datatypes_management*/
124 typedef enum {
125   MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
126   MSG_TCP
127 } MSG_sharing_t;
128
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...
135  */
136 typedef struct m_link *m_link_t;
137 #endif