Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Starting MSG. To ensure backward compability, those two headers won't really
[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 /********************************* Link **************************************/
33 struct s_m_link {
34   char *name;                   /* link name if any */
35   void *simdata;                /* simulator data */
36   void *data;                   /* user data */
37 };
38
39 /** \brief Link datatype  
40     \ingroup m_datatypes_management
41
42     A <em>link</em> is an agglomeration of communicating resources
43     representing a set of physical network links.
44
45     \see m_link_management
46 */
47 typedef struct s_m_link *m_link_t;
48
49 /********************************* Task **************************************/
50
51 struct s_m_task {
52   char *name;                   /* host name if any */
53   void *simdata;                /* simulator data */
54   void *data;                   /* user data */
55 };
56 /** \brief Task datatype  
57     \ingroup m_datatypes_management 
58
59     A <em>task</em> may then be defined by a <em>computing
60     amount</em>, a <em>message size</em> and some <em>private
61     data</em>.
62     \see m_task_management
63 */
64 typedef struct s_m_task *m_task_t;
65
66 /** \brief Default value for an uninitialized #m_task_t.
67     \ingroup m_datatypes_management 
68 */
69 #define MSG_TASK_UNINITIALIZED NULL
70 /******************************* Process *************************************/
71
72 struct s_m_process {
73   char *name;                   /* process name if any */
74   void *simdata;                /* simulator data */
75   void *data;                   /* user data */
76 };
77 /** \brief Agent datatype  
78     \ingroup m_datatypes_management 
79     An agent may be defined as a <em>code</em>, with some <em>private
80     data</em>, executing in a <em>location</em>.
81     \see m_process_management
82 */
83 typedef struct s_m_process *m_process_t;
84 /** \brief Agent code datatype  
85     \ingroup m_datatypes_management 
86     The code of an agent is a m_process_code_t, i.e. a function with no arguments 
87     returning no value.
88     \see m_process_management
89 */
90 typedef int(*m_process_code_t)(int argc,char *argv[]) ;
91
92 /********************************** Channel **********************************/
93 /** \brief Channel datatype  
94     \ingroup m_datatypes_management 
95     A <em>channel</em>  is a number and identifies a mailbox type (just as a 
96     port number does).
97     \see m_channel_management
98 */
99 typedef int m_channel_t;
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 typedef enum {
123   MSG_STORE_AND_FORWARD = 1, /* 0 means uninitialized value */
124   MSG_TCP
125 } MSG_sharing_t;
126
127 #endif