+/** \brief The network resource
+ * \ingroup SURF_resources
+ *
+ * When creating a new API on top on SURF, you shouldn't use the
+ * network resource unless you know what you are doing. Only the workstation
+ * resource should be accessed because depending on the platform model,
+ * the network resource can be NULL.
+ */
+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.
+ *
+ * \see surf_workstation_resource_init_CLM03()
+ */
+XBT_PUBLIC(void) surf_network_resource_init_CM02(const char *filename);
+
+/** \brief Workstation resource extension public
+ * \ingroup SURF_resources
+ *
+ * Public functions specific to the workstation resource.
+ */
+typedef struct surf_workstation_resource_extension_public {
+ surf_action_t(*execute) (void *workstation, double size); /**< Execute a computation amount on a workstation
+ and create the corresponding action */
+ surf_action_t(*sleep) (void *workstation, double duration); /**< Make a workstation sleep during a given duration */
+ e_surf_cpu_state_t(*get_state) (void *workstation); /**< Return the CPU state of a workstation */
+ double (*get_speed) (void *workstation, double load); /**< Return the speed of a workstation */
+ double (*get_available_speed) (void *workstation); /**< Return tha available speed of a workstation */
+ surf_action_t(*communicate) (void *workstation_src, /**< Execute a communication amount between two workstations */
+ void *workstation_dst, double size,
+ double max_rate);
+ surf_action_t(*execute_parallel_task) (int workstation_nb, /**< Execute a parallel task on several workstations */
+ void **workstation_list,
+ double *computation_amount,
+ double *communication_amount,
+ double amount,
+ double rate);
+ const void** (*get_route) (void *src, void *dst); /**< Return the network link list between two workstations */
+ int (*get_route_size) (void *src, void *dst); /**< Return the route size between two workstations */
+ const char* (*get_link_name) (const void *link); /**< Return the name of a network link */
+ double (*get_link_bandwidth) (const void *link); /**< Return the current bandwidth of a network link */
+ double (*get_link_latency) (const void *link); /**< Return the current latency of a network link */
+} s_surf_workstation_resource_extension_public_t,
+ *surf_workstation_resource_extension_public_t;
+
+/** \brief Workstation resource datatype.
+ * \ingroup SURF_resources
+ *
+ */
+typedef struct surf_workstation_resource {
+ surf_resource_private_t common_private;
+ surf_resource_public_t common_public;
+ surf_workstation_resource_extension_public_t extension_public;
+} s_surf_workstation_resource_t, *surf_workstation_resource_t;
+
+/** \brief The workstation resource
+ * \ingroup SURF_resources
+ *
+ * Note that when you create an API on top of SURF,
+ * the workstation resource should be the only one you use
+ * because depending on the platform model, the network resource and the CPU resource
+ * may not exist.
+ */
+XBT_PUBLIC_DATA(surf_workstation_resource_t) surf_workstation_resource;
+
+/** \brief Initializes the platform with the workstation model CLM03
+ * \ingroup SURF_resources
+ * \param filename XML platform file name
+ *
+ * This platform model seperates the workstation resource and the network resource.
+ * The workstation resource will be initialized with the model CLM03, the network
+ * resource with the model CM02 and the CPU resource with the model Cas01.
+ * In future releases, some other network models will be implemented and will be
+ * combined with the workstation model CLM03.
+ *
+ * \see surf_workstation_resource_init_KCCFLN05()
+ */
+XBT_PUBLIC(void) surf_workstation_resource_init_CLM03(const char *filename);
+
+/** \brief Initializes the platform with the model KCCFLN05
+ * \ingroup SURF_resources
+ * \param filename XML platform file name
+ *
+ * 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(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_proportionnal(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);
+
+
+
+
+#ifdef USE_GTNETS
+XBT_PUBLIC(void) surf_workstation_resource_init_GTNETS(const char *filename);
+#endif
+
+/** \brief The network links
+ * \ingroup SURF_resources
+ *
+ * This dict contains all network links.
+ *
+ * \see workstation_set
+ */
+XBT_PUBLIC_DATA(xbt_dict_t) network_link_set;
+
+/** \brief The workstations
+ * \ingroup SURF_resources
+ *
+ * This dict contains all workstations.
+ *
+ * \see network_link_set
+ */
+XBT_PUBLIC_DATA(xbt_dict_t) workstation_set;
+
+/** \brief List of initialized resources
+ * \ingroup SURF_resources
+ */
+XBT_PUBLIC_DATA(xbt_dynar_t) resource_list;