Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
useless cleanup
[simgrid.git] / src / include / surf / surf.h
index 32ba95a..267a97a 100644 (file)
 #include "xbt/swag.h"
 #include "xbt/dynar.h"
 #include "xbt/dict.h"
+#include "xbt/misc.h"
+#include "gras_config.h"
+
+SG_BEGIN_DECL()
+
+
 
 /* Actions and resources are higly connected structures... */
 
  */
 typedef struct surf_action *surf_action_t;
 
+/** \brief Resource datatype
+ *  \ingroup SURF_resources
+ *  
+ *  Generic data structure for a resource. The workstations,
+ *  the CPUs and the network links are examples of resources.
+ */
+typedef struct surf_resource *surf_resource_t;
+
 /** \brief Action structure
  * \ingroup SURF_actions
  *
@@ -84,25 +98,6 @@ typedef struct surf_action_state {
 /* Generic resource object */
 /***************************/
 
-/** \brief Resource datatype
- *  \ingroup SURF_resources
- *  
- *  Generic data structure for a resource. The workstations,
- *  the CPUs and the network links are examples of resources.
- */
-typedef struct surf_resource *surf_resource_t;
-
-/** \brief Resource datatype
- *  \ingroup SURF_resources
- *  
- *  Generic data structure for a resource. The workstations,
- *  the CPUs and the network links are examples of resources.
- */
-typedef struct surf_resource {
-  surf_resource_private_t common_private;
-  surf_resource_public_t common_public;
-} s_surf_resource_t;
-
 /** \brief Public data available on all resources
  *  \ingroup SURF_resources
  *
@@ -136,18 +131,20 @@ typedef struct surf_resource_public {
  */
 typedef struct surf_resource_private *surf_resource_private_t;
 
-/**************************************/
-/* Implementations of resource object */
-/**************************************/
-
-/** \brief Timer resource
+/** \brief Resource datatype
  *  \ingroup SURF_resources
+ *  
+ *  Generic data structure for a resource. The workstations,
+ *  the CPUs and the network links are examples of resources.
  */
-typedef struct surf_timer_resource {
+typedef struct surf_resource {
   surf_resource_private_t common_private;
   surf_resource_public_t common_public;
-  surf_timer_resource_extension_public_t extension_public;
-} s_surf_timer_resource_t, *surf_timer_resource_t;
+} s_surf_resource_t;
+
+/**************************************/
+/* Implementations of resource object */
+/**************************************/
 
 /** \brief Timer resource extension public
  * \ingroup SURF_resource
@@ -160,15 +157,24 @@ typedef struct surf_timer_resource_extension_public {
 } s_surf_timer_resource_extension_public_t,
   *surf_timer_resource_extension_public_t;
 
+/** \brief Timer resource
+ *  \ingroup SURF_resources
+ */
+typedef struct surf_timer_resource {
+  surf_resource_private_t common_private;
+  surf_resource_public_t common_public;
+  surf_timer_resource_extension_public_t extension_public;
+} s_surf_timer_resource_t, *surf_timer_resource_t;
+
 /** \brief The timer resource
  *  \ingroup SURF_resources
  */
-extern surf_timer_resource_t surf_timer_resource;
+XBT_PUBLIC_DATA(surf_timer_resource_t) surf_timer_resource;
 
 /** \brief Initializes the timer resource
  *  \ingroup SURF_resources
  */
-void surf_timer_resource_init(const char *filename);
+XBT_PUBLIC(void) surf_timer_resource_init(const char *filename);
 
 /* Cpu resource */
 
@@ -180,15 +186,6 @@ typedef enum {
   SURF_CPU_OFF = 0             /**< Running      */
 } e_surf_cpu_state_t;
 
-/** \brief CPU resource datatype
- *  \ingroup SURF_resources
- */
-typedef struct surf_cpu_resource {
-  surf_resource_private_t common_private;
-  surf_resource_public_t common_public;
-  surf_cpu_resource_extension_public_t extension_public;
-} s_surf_cpu_resource_t, *surf_cpu_resource_t;
-
 /** \brief CPU resource extension public
  *  \ingroup SURF_resources
  *  
@@ -203,10 +200,19 @@ typedef struct surf_cpu_resource_extension_public {
 } s_surf_cpu_resource_extension_public_t,
     *surf_cpu_resource_extension_public_t;
 
+/** \brief CPU resource datatype
+ *  \ingroup SURF_resources
+ */
+typedef struct surf_cpu_resource {
+  surf_resource_private_t common_private;
+  surf_resource_public_t common_public;
+  surf_cpu_resource_extension_public_t extension_public;
+} s_surf_cpu_resource_t, *surf_cpu_resource_t;
+
 /** \brief The CPU resource
  *  \ingroup SURF_resources
  */
-extern surf_cpu_resource_t 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
@@ -216,19 +222,10 @@ extern surf_cpu_resource_t surf_cpu_resource;
  *
  *  \see surf_workstation_resource_init_CLM03()
  */
-void surf_cpu_resource_init_Cas01(const char *filename);
+XBT_PUBLIC(void) surf_cpu_resource_init_Cas01(const char *filename);
 
 /* Network resource */
 
-/** \brief Network resource datatype
- *  \ingroup SURF_resources
- */
-typedef struct surf_network_resource {
-  surf_resource_private_t common_private;
-  surf_resource_public_t common_public;
-  surf_network_resource_extension_public_t extension_public;
-} s_surf_network_resource_t, *surf_network_resource_t;
-
 /** \brief Network resource extension public
  *  \ingroup SURF_resources
  *
@@ -245,6 +242,15 @@ typedef struct surf_network_resource_extension_public {
 } s_surf_network_resource_extension_public_t,
     *surf_network_resource_extension_public_t;
 
+/** \brief Network resource datatype
+ *  \ingroup SURF_resources
+ */
+typedef struct surf_network_resource {
+  surf_resource_private_t common_private;
+  surf_resource_public_t common_public;
+  surf_network_resource_extension_public_t extension_public;
+} s_surf_network_resource_t, *surf_network_resource_t;
+
 /** \brief The network resource
  *  \ingroup SURF_resources
  *
@@ -253,7 +259,7 @@ typedef struct surf_network_resource_extension_public {
  *  resource should be accessed because depending on the platform model,
  *  the network resource can be NULL.
  */
-extern surf_network_resource_t 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
@@ -264,17 +270,7 @@ extern surf_network_resource_t surf_network_resource;
  *
  *  \see surf_workstation_resource_init_CLM03()
  */
-void surf_network_resource_init_CM02(const char *filename);
-
-/** \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;
+XBT_PUBLIC(void) surf_network_resource_init_CM02(const char *filename);
 
 /** \brief Workstation resource extension public
  *  \ingroup SURF_resources
@@ -305,6 +301,16 @@ typedef struct surf_workstation_resource_extension_public {
 } 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
  *
@@ -313,7 +319,7 @@ typedef struct surf_workstation_resource_extension_public {
  *  because depending on the platform model, the network resource and the CPU resource
  *  may not exist.
  */
-extern surf_workstation_resource_t surf_workstation_resource;
+XBT_PUBLIC_DATA(surf_workstation_resource_t) surf_workstation_resource;
 
 /** \brief Initializes the platform with the workstation model CLM03
  *  \ingroup SURF_resources
@@ -327,7 +333,7 @@ extern surf_workstation_resource_t surf_workstation_resource;
  *
  *  \see surf_workstation_resource_init_KCCFLN05()
  */
-void surf_workstation_resource_init_CLM03(const char *filename);
+XBT_PUBLIC(void) surf_workstation_resource_init_CLM03(const char *filename);
 
 /** \brief Initializes the platform with the model KCCFLN05
  *  \ingroup SURF_resources
@@ -339,7 +345,15 @@ void surf_workstation_resource_init_CLM03(const char *filename);
  *
  *  \see surf_workstation_resource_init_CLM03()
  */
-void surf_workstation_resource_init_KCCFLN05(const char *filename);
+
+XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05(const char *filename);
+
+
+XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05_proportionnal(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
@@ -348,7 +362,7 @@ void surf_workstation_resource_init_KCCFLN05(const char *filename);
  *
  *  \see workstation_set
  */
-extern xbt_dict_t network_link_set;
+XBT_PUBLIC_DATA(xbt_dict_t) network_link_set;
 
 /** \brief The workstations
  *  \ingroup SURF_resources
@@ -357,12 +371,12 @@ extern xbt_dict_t network_link_set;
  *
  *  \see network_link_set
  */
-extern xbt_dict_t workstation_set;
+XBT_PUBLIC_DATA(xbt_dict_t)  workstation_set;
 
 /** \brief List of initialized resources
  *  \ingroup SURF_resources
  */
-extern xbt_dynar_t resource_list;
+XBT_PUBLIC_DATA(xbt_dynar_t)  resource_list;
 
 /*******************************************/
 /*** SURF Globals **************************/
@@ -380,7 +394,7 @@ extern xbt_dynar_t resource_list;
  *  \see surf_timer_resource_init(), surf_workstation_resource_init_CLM03(),
  *  surf_workstation_resource_init_KCCFLN05(), surf_exit()
  */
-void surf_init(int *argc, char **argv);        /* initialize common structures */
+XBT_PUBLIC(void) surf_init(int *argc, char **argv);    /* initialize common structures */
 
 /** \brief Performs a part of the simulation
  *  \ingroup SURF_simulation
@@ -392,14 +406,14 @@ void surf_init(int *argc, char **argv);   /* initialize common structures */
  *  are not executed immediately but only when you call surf_solve.
  *  Note that the returned elapsed time can be zero.
  */
-double surf_solve(void);
+XBT_PUBLIC(double) surf_solve(void);
 
 /** \brief Return the current time
  *  \ingroup SURF_simulation
  *
  *  Return the current time in millisecond.
  */
-double surf_get_clock(void);
+XBT_PUBLIC(double)surf_get_clock(void);
 
 /** \brief Exit SURF
  *  \ingroup SURF_simulation
@@ -408,6 +422,8 @@ double surf_get_clock(void);
  *
  *  \see surf_init()
  */
-void surf_exit(void);
+XBT_PUBLIC(void) surf_exit(void);
+
+SG_END_DECL()
 
 #endif                         /* _SURF_SURF_H */