3 /* Copyright (c) 2007 Arnaud Legrand, Bruno Donnassolo.
4 All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #ifndef SIMIX_DATATYPE_H
10 #define SIMIX_DATATYPE_H
16 /* ******************************** Host ************************************ */
17 /** @defgroup m_datatypes_management_details Details on SIMIX datatypes
18 @ingroup m_datatypes_management*/
20 typedef struct s_smx_simdata_host *smx_simdata_host_t;
21 /** @brief Host datatype
22 @ingroup m_datatypes_management_details */
23 typedef struct s_smx_host {
24 char *name; /**< @brief host name if any */
25 smx_simdata_host_t simdata; /**< @brief simulator data */
26 void *data; /**< @brief user data */
28 /** @brief Host datatype
29 @ingroup m_datatypes_management
31 A <em>location</em> (or <em>host</em>) is any possible place where
32 a process may run. Thus it is represented as a <em>physical
33 resource with computing capabilities</em>, some <em>mailboxes</em>
34 to enable running process to communicate with remote ones, and
35 some <em>private data</em> that can be only accessed by local
38 \see m_host_management
40 typedef struct s_smx_host *smx_host_t;
44 /* ******************************** Syncro ************************************ */
46 typedef struct s_smx_mutex *smx_mutex_t;
47 typedef struct s_smx_cond *smx_cond_t;
50 /********************************** Action *************************************/
51 typedef struct s_smx_simdata_action *smx_simdata_action_t;
52 /** @brief Action datatype
53 @ingroup m_datatypes_management_details */
54 typedef struct s_smx_action {
55 char *name; /**< @brief action name if any */
56 smx_simdata_action_t simdata; /**< @brief simulator data */
57 xbt_fifo_t cond_list; /*< conditional variables that must be signaled when the action finish. */
59 void *data; /**< @brief user data */
62 typedef struct s_smx_action *smx_action_t;
65 /* ****************************** Process *********************************** */
66 typedef struct s_smx_simdata_process *smx_simdata_process_t;
67 /** @brief Process datatype
68 @ingroup m_datatypes_management_details @{ */
69 typedef struct s_smx_process {
70 char *name; /**< @brief process name if any */
71 smx_simdata_process_t simdata; /**< @brief simulator data */
72 s_xbt_swag_hookup_t process_hookup;
73 s_xbt_swag_hookup_t synchro_hookup;
74 s_xbt_swag_hookup_t host_proc_hookup;
75 void *data; /**< @brief user data */
78 /** @brief Agent datatype
79 @ingroup m_datatypes_management
81 An agent may be defined as a <em>code</em>, with some <em>private
82 data</em>, executing in a <em>location</em>.
83 \see m_process_management
85 typedef struct s_smx_process *smx_process_t;
89 @ingroup m_datatypes_management
90 The code of an agent is a m_process_code_t, i.e. a function with no arguments
92 \see m_process_management
94 typedef int(*smx_process_code_t)(int argc,char *argv[]) ;