X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c6367952505ec169142f91d8e97fddb9eaa0cc5a..504b4d20dd2db9ea1eaa9c4b390b2a412d7c9779:/src/include/simix/datatypes.h diff --git a/src/include/simix/datatypes.h b/src/include/simix/datatypes.h index d83d22a536..349698d622 100644 --- a/src/include/simix/datatypes.h +++ b/src/include/simix/datatypes.h @@ -1,6 +1,7 @@ /* $Id$ */ -/* Copyright (c) 2002,2003,2004 Arnaud Legrand. All rights reserved. */ +/* Copyright (c) 2007 Arnaud Legrand, Bruno Donnassolo. + All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -9,6 +10,7 @@ #define SIMIX_DATATYPE_H #include "xbt/misc.h" #include "xbt/swag.h" +#include "xbt/fifo.h" SG_BEGIN_DECL() @@ -16,12 +18,12 @@ SG_BEGIN_DECL() /** @defgroup m_datatypes_management_details Details on SIMIX datatypes @ingroup m_datatypes_management*/ -typedef struct s_simdata_host *simdata_host_t; +typedef struct s_smx_simdata_host *smx_simdata_host_t; /** @brief Host datatype @ingroup m_datatypes_management_details */ typedef struct s_smx_host { char *name; /**< @brief host name if any */ - simdata_host_t simdata; /**< @brief simulator data */ + smx_simdata_host_t simdata; /**< @brief simulator data */ void *data; /**< @brief user data */ } s_smx_host_t; /** @brief Host datatype @@ -47,12 +49,14 @@ typedef struct s_smx_cond *smx_cond_t; /********************************** Action *************************************/ -typedef struct s_simdata_action *simdata_action_t; +typedef struct s_smx_simdata_action *smx_simdata_action_t; /** @brief Action datatype @ingroup m_datatypes_management_details */ typedef struct s_smx_action { - int number; /**< @brief action name if any */ - simdata_action_t simdata; /**< @brief simulator data */ + char *name; /**< @brief action name if any */ + smx_simdata_action_t simdata; /**< @brief simulator data */ + xbt_fifo_t cond_list; /*< conditional variables that must be signaled when the action finish. */ + void *data; /**< @brief user data */ } s_smx_action_t; @@ -60,14 +64,17 @@ typedef struct s_smx_action *smx_action_t; /* ****************************** Process *********************************** */ -typedef struct s_simdata_process *simdata_process_t; +typedef struct s_smx_simdata_process *smx_simdata_process_t; /** @brief Process datatype @ingroup m_datatypes_management_details @{ */ typedef struct s_smx_process { - char *name; /**< @brief process name if any */ - simdata_process_t simdata; /**< @brief simulator data */ - s_xbt_swag_hookup_t process_hookup; - void *data; /**< @brief user data */ + + char *name; /**< @brief process name if any */ + smx_simdata_process_t simdata; /**< @brief simulator data */ + s_xbt_swag_hookup_t process_hookup; + s_xbt_swag_hookup_t synchro_hookup; + s_xbt_swag_hookup_t host_proc_hookup; + void *data; /**< @brief user data */ } s_smx_process_t; /** @} */ /** @brief Agent datatype @@ -80,36 +87,5 @@ typedef struct s_smx_process { typedef struct s_smx_process *smx_process_t; /** @} */ -/** @brief Agent code - @ingroup m_datatypes_management - The code of an agent is a m_process_code_t, i.e. a function with no arguments - returning no value. - \see m_process_management - @{ */ -typedef int(*smx_process_code_t)(int argc,char *argv[]) ; -/** @} */ - - -/* ***************************** Error handling ***************************** */ -/** @brief Error handling - @ingroup m_datatypes_management - @{ -*/ -typedef enum { - SIMIX_OK = 0, /**< @brief Everything is right. Keep on going this way ! */ - SIMIX_WARNING, /**< @brief Mmmh! Something must be not perfectly clean. But I - may be a paranoid freak... ! */ - SIMIX_TRANSFER_FAILURE, /**< @brief There has been a problem during you action - transfer. Either the network is down or the remote host has been - shutdown. */ - SIMIX_HOST_FAILURE, /**< @brief System shutdown. The host on which you are - running has just been rebooted. Free your datastructures and - return now !*/ - SIMIX_ACTION_CANCELLED, /**< @brief Cancelled action. This action has been cancelled - by somebody!*/ - SIMIX_FATAL /**< @brief You've done something wrong. You'd better look at it... */ -} SIMIX_error_t; -/** @} */ - SG_END_DECL() #endif