3 /* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */
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. */
8 #ifndef SIMIX_DATATYPE_H
9 #define SIMIX_DATATYPE_H
15 /* ******************************** Host ************************************ */
16 /** @defgroup m_datatypes_management_details Details on SIMIX datatypes
17 @ingroup m_datatypes_management*/
19 typedef struct s_simdata_host *simdata_host_t;
20 /** @brief Host datatype
21 @ingroup m_datatypes_management_details */
22 typedef struct s_smx_host {
23 char *name; /**< @brief host name if any */
24 simdata_host_t simdata; /**< @brief simulator data */
25 void *data; /**< @brief user data */
27 /** @brief Host datatype
28 @ingroup m_datatypes_management
30 A <em>location</em> (or <em>host</em>) is any possible place where
31 a process may run. Thus it is represented as a <em>physical
32 resource with computing capabilities</em>, some <em>mailboxes</em>
33 to enable running process to communicate with remote ones, and
34 some <em>private data</em> that can be only accessed by local
37 \see m_host_management
39 typedef struct s_smx_host *smx_host_t;
43 /* ******************************** Syncro ************************************ */
45 typedef struct s_smx_mutex *smx_mutex_t;
46 typedef struct s_smx_cond *smx_cond_t;
49 /********************************** Action *************************************/
50 typedef struct s_simdata_action *simdata_action_t;
51 /** @brief Action datatype
52 @ingroup m_datatypes_management_details */
53 typedef struct s_smx_action {
54 int number; /**< @brief action name if any */
55 simdata_action_t simdata; /**< @brief simulator data */
56 void *data; /**< @brief user data */
59 typedef struct s_smx_action *smx_action_t;
62 /* ****************************** Process *********************************** */
63 typedef struct s_simdata_process *simdata_process_t;
64 /** @brief Process datatype
65 @ingroup m_datatypes_management_details @{ */
66 typedef struct s_smx_process {
67 char *name; /**< @brief process name if any */
68 simdata_process_t simdata; /**< @brief simulator data */
69 s_xbt_swag_hookup_t process_hookup;
70 void *data; /**< @brief user data */
73 /** @brief Agent datatype
74 @ingroup m_datatypes_management
76 An agent may be defined as a <em>code</em>, with some <em>private
77 data</em>, executing in a <em>location</em>.
78 \see m_process_management
80 typedef struct s_smx_process *smx_process_t;
84 @ingroup m_datatypes_management
85 The code of an agent is a m_process_code_t, i.e. a function with no arguments
87 \see m_process_management
89 typedef int(*smx_process_code_t)(int argc,char *argv[]) ;
93 /* ***************************** Error handling ***************************** */
94 /** @brief Error handling
95 @ingroup m_datatypes_management
99 SIMIX_OK = 0, /**< @brief Everything is right. Keep on going this way ! */
100 SIMIX_WARNING, /**< @brief Mmmh! Something must be not perfectly clean. But I
101 may be a paranoid freak... ! */
102 SIMIX_TRANSFER_FAILURE, /**< @brief There has been a problem during you action
103 transfer. Either the network is down or the remote host has been
105 SIMIX_HOST_FAILURE, /**< @brief System shutdown. The host on which you are
106 running has just been rebooted. Free your datastructures and
108 SIMIX_ACTION_CANCELLED, /**< @brief Cancelled action. This action has been cancelled
110 SIMIX_FATAL /**< @brief You've done something wrong. You'd better look at it... */