1 /* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef _SIMIX_DATATYPES_H
8 #define _SIMIX_DATATYPES_H
16 /* ******************************** Host ************************************ */
17 /** @defgroup m_datatypes_management_details Details on SIMIX datatypes */
18 /** @brief Host datatype
19 @ingroup m_datatypes_management
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
28 \see m_host_management
30 typedef struct s_smx_host *smx_host_t;
38 SIMIX_SRC_HOST_FAILURE,
39 SIMIX_DST_HOST_FAILURE,
47 typedef struct s_smx_timer* smx_timer_t;
49 /* ******************************** Synchro ************************************ */
50 typedef struct s_smx_mutex *smx_mutex_t;
51 typedef struct s_smx_cond *smx_cond_t;
52 typedef struct s_smx_sem *smx_sem_t;
54 /********************************** File *************************************/
55 typedef struct s_smx_file *smx_file_t;
56 typedef struct s_smx_stat *smx_stat_t;
58 /********************************** Action *************************************/
59 typedef struct s_smx_action *smx_action_t; /* FIXME: replace by specialized action handlers */
63 /* ****************************** Process *********************************** */
64 /** @brief Agent datatype
65 @ingroup m_datatypes_management
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
71 typedef struct s_smx_process *smx_process_t;
76 * Type of function that creates a process.
77 * The function must accept the following parameters:
78 * void* process: the process created will be stored there
79 * const char *name: a name for the object. It is for user-level information and can be NULL
80 * xbt_main_func_t code: is a function describing the behavior of the agent
81 * void *data: data a pointer to any data one may want to attach to the new object.
82 * smx_host_t host: the location where the new agent is executed
83 * int argc, char **argv: parameters passed to code
84 * xbt_dict_t pros: properties
86 typedef void (*smx_creation_func_t) ( /* process */ smx_process_t*,
87 /* name */ const char*,
88 /* code */ xbt_main_func_t,
90 /* hostname */ const char*,
93 /* props */ xbt_dict_t);
96 /******************************* Networking ***********************************/
97 typedef struct s_smx_rvpoint *smx_rdv_t;