#include "xbt/dict.h"
#include "xbt/misc.h"
#include "portable.h"
+#include "xbt/config.h"
SG_BEGIN_DECL()
/* Actions and models are higly connected structures... */
/** \brief Action datatype
* \ingroup SURF_actions
- *
+ *
* An action is some working amount on a model.
* It is represented as a cost, a priority, a duration and a state.
*
/** \brief Model datatype
* \ingroup SURF_models
- *
+ *
* Generic data structure for a model. The workstations,
* the CPUs and the network links are examples of models.
*/
*
* Never create s_surf_action_t by yourself ! The actions are created
* on the fly when you call execute or communicate on a model.
- *
+ *
* \see e_surf_action_state_t
*/
typedef struct surf_action {
/** \brief Model datatype
* \ingroup SURF_models
- *
+ *
* Generic data structure for a model. The workstations,
* the CPUs and the network links are examples of models.
*/
typedef struct surf_model {
+ s_surf_model_public_t common_public;
surf_model_private_t common_private;
- surf_model_public_t common_public;
} s_surf_model_t;
+ void surf_model_init(surf_model_t model);
+ void surf_model_exit(surf_model_t model);
+
+
/**************************************/
/* Implementations of model object */
/**************************************/
* \ingroup SURF_models
*/
typedef struct surf_timer_model {
+ s_surf_model_public_t common_public;
surf_model_private_t common_private;
- surf_model_public_t common_public;
surf_timer_model_extension_public_t extension_public;
} s_surf_timer_model_t, *surf_timer_model_t;
/** \brief CPU model extension public
* \ingroup SURF_models
- *
+ *
* Public functions specific to the CPU model.
*/
typedef struct surf_cpu_model_extension_public {
* \ingroup SURF_models
*/
typedef struct surf_cpu_model {
+ s_surf_model_public_t common_public;
surf_model_private_t common_private;
- surf_model_public_t common_public;
surf_cpu_model_extension_public_t extension_public;
} s_surf_cpu_model_t, *surf_cpu_model_t;
* \ingroup SURF_models
*/
typedef struct surf_network_model {
+ s_surf_model_public_t common_public;
surf_model_private_t common_private;
- surf_model_public_t common_public;
surf_network_model_extension_public_t extension_public;
} s_surf_network_model_t, *surf_network_model_t;
* \ingroup SURF_models
* \param filename XML platform file name
*
- * This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent
+ * This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent
* to the proportional fairness.
*
* Reference:
*
* Reference:
*
- * [TAG03]. Corinne Touati, Eitan Altman, and Jerome Galtier.
+ * [TAG03]. Corinne Touati, Eitan Altman, and Jerome Galtier.
* Semi-definite programming approach for bandwidth allocation and routing in networks.
* Game Theory and Applications, 9:169-179, December 2003. Nova publisher.
*
*
*/
typedef struct surf_workstation_model {
+ s_surf_model_public_t common_public;
surf_model_private_t common_private;
- surf_model_public_t common_public;
surf_workstation_model_extension_public_t extension_public;
} s_surf_workstation_model_t, *surf_workstation_model_t;
/*******************************************/
/*** SURF Globals **************************/
/*******************************************/
+XBT_PUBLIC_DATA(xbt_cfg_t) _surf_cfg_set;
/** \brief Initialize SURF
* \ingroup SURF_simulation
*/
XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structures */
+/** \brief Initialize the used models.
+ *
+ * Must be called after the surf_init so that configuration infrastructure is created
+ * Must be called before parsing/creating the environment
+ * Must not be called within the initialization process so that the use get a chance to change the settings from
+ * its code between, say, MSG_init and MSG_create_environment using MSG_config
+ */
+XBT_PUBLIC(void) surf_config_models_setup(const char *platform_file);
+
+/** \brief create the elements of the models
+ *
+ * Must be called after parsing the platform file and before using any elements
+ */
+XBT_PUBLIC(void) surf_config_models_create_elms(void);
+
/** \brief Finish simulation initialization
* \ingroup SURF_simulation
*