X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4e7daeaec907ca6e74dcc5faaf2f23deae766aa4..5a00c16b5ea7fd8c37f39544914acfcb0f6e07b2:/src/include/surf/surf.h diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 37450859f7..840cd70383 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -12,6 +12,7 @@ #include "xbt/dynar.h" #include "xbt/dict.h" #include "xbt/misc.h" +#include "gras_config.h" SG_BEGIN_DECL() @@ -168,7 +169,7 @@ typedef struct surf_timer_resource { /** \brief The timer resource * \ingroup SURF_resources */ -extern surf_timer_resource_t XBT_PUBLIC_DATA surf_timer_resource; +XBT_PUBLIC_DATA(surf_timer_resource_t) surf_timer_resource; /** \brief Initializes the timer resource * \ingroup SURF_resources @@ -211,7 +212,7 @@ typedef struct surf_cpu_resource { /** \brief The CPU resource * \ingroup SURF_resources */ -extern surf_cpu_resource_t XBT_PUBLIC_DATA surf_cpu_resource; +XBT_PUBLIC_DATA(surf_cpu_resource_t) surf_cpu_resource; /** \brief Initializes the CPU resource with the model Cas01 * \ingroup SURF_resources @@ -258,19 +259,32 @@ typedef struct surf_network_resource { * resource should be accessed because depending on the platform model, * the network resource can be NULL. */ -extern surf_network_resource_t XBT_PUBLIC_DATA surf_network_resource; +XBT_PUBLIC_DATA(surf_network_resource_t) surf_network_resource; /** \brief Initializes the platform with the network model CM02 * \ingroup SURF_resources * \param filename XML platform file name * * This function is called by surf_workstation_resource_init_CLM03 - * so you shouldn't call it by yourself. + * or by yourself only if you plan using surf_workstation_resource_init_compound * * \see surf_workstation_resource_init_CLM03() */ XBT_PUBLIC(void) surf_network_resource_init_CM02(const char *filename); +#ifdef USE_GTNETS +/** \brief Initializes the platform with the network model GTNETS + * \ingroup SURF_resources + * \param filename XML platform file name + * + * This function is called by surf_workstation_resource_init_GTNETS + * or by yourself only if you plan using surf_workstation_resource_init_compound + * + * \see surf_workstation_resource_init_GTNETS() + */ +XBT_PUBLIC(void) surf_network_resource_init_GTNETS(const char *filename); +#endif + /** \brief Workstation resource extension public * \ingroup SURF_resources * @@ -318,7 +332,17 @@ typedef struct surf_workstation_resource { * because depending on the platform model, the network resource and the CPU resource * may not exist. */ -extern surf_workstation_resource_t XBT_PUBLIC_DATA surf_workstation_resource; +XBT_PUBLIC_DATA(surf_workstation_resource_t) surf_workstation_resource; + +/** \brief Initializes the platform with a compound workstation model + * \ingroup SURF_resources + * \param filename XML platform file name + * + * This function should be called after a cpu_resource and a + * network_resource have been set up. + * + */ +XBT_PUBLIC(void) surf_workstation_resource_init_compound(const char *filename); /** \brief Initializes the platform with the workstation model CLM03 * \ingroup SURF_resources @@ -344,14 +368,68 @@ XBT_PUBLIC(void) surf_workstation_resource_init_CLM03(const char *filename); * * \see surf_workstation_resource_init_CLM03() */ - XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05(const char *filename); +/** \brief Initializes the platform with the model KCCFLN05 using the proportional + * approach as described in [TAG03]. + * + * \ingroup SURF_resources + * \param filename XML platform file name + * + * This function implements the proportional fairness known as the maximization + * of sum ( x1*x2*...*xn ). + * + * Reference: + * + * [TAG03]. Corinne Touati, Eitan Altman, and Jérôme Galtier. + * Semi-definite programming approach for bandwidth allocation and routing in networks. + * Game Theory and Applications, 9:169-179, December 2003. Nova publisher. + * With this model, the workstations and the network are handled together. + * There is no network resource. This platform model is the default one for + * MSG and SimDag. + * + * \see surf_workstation_resource_init_CLM03() + */ +XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05_proportional(const char *filename); + +/** \brief Initializes the platform with the model KCCFLN05 using a lagrange + * optimization approach to compute the effectivet bandwidth of each flow based + * on the Vegas TCP flavor fairness as shown in [LOW03]. + * + * \ingroup SURF_resources + * \param filename XML platform file name + * + * This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent + * to the proportional fairness. + * + * Reference: + * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms. + * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003. + * + */ +XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05_Vegas(const char *filename); + +/** \brief Initializes the platform with the model KCCFLN05 using a lagrange + * optimization approach to compute the effectivet bandwidth of each flow based + * on the Reno TCP flavor fairness as shown in [LOW03]. + * + * \ingroup SURF_resources + * \param filename XML platform file name + * + * The problem is related to max( sum( arctan(C * Df * xi) ) ). + * + * Reference: + * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms. + * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003. + * + * \see surf_workstation_resource_init_KCCFLN05_Vegas() + */ +XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05_Reno(const char *filename); + + -XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05_proportionnal(const char *filename); #ifdef USE_GTNETS -/* For GTNetS*/ XBT_PUBLIC(void) surf_workstation_resource_init_GTNETS(const char *filename); #endif @@ -362,7 +440,7 @@ XBT_PUBLIC(void) surf_workstation_resource_init_GTNETS(const char *filename); * * \see workstation_set */ -extern xbt_dict_t XBT_PUBLIC_DATA network_link_set; +XBT_PUBLIC_DATA(xbt_dict_t) network_link_set; /** \brief The workstations * \ingroup SURF_resources @@ -371,12 +449,12 @@ extern xbt_dict_t XBT_PUBLIC_DATA network_link_set; * * \see network_link_set */ -extern xbt_dict_t XBT_PUBLIC_DATA workstation_set; +XBT_PUBLIC_DATA(xbt_dict_t) workstation_set; /** \brief List of initialized resources * \ingroup SURF_resources */ -extern xbt_dynar_t XBT_PUBLIC_DATA resource_list; +XBT_PUBLIC_DATA(xbt_dynar_t) resource_list; /*******************************************/ /*** SURF Globals **************************/ @@ -424,6 +502,7 @@ XBT_PUBLIC(double)surf_get_clock(void); */ XBT_PUBLIC(void) surf_exit(void); + SG_END_DECL() #endif /* _SURF_SURF_H */