Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Substitution of the word "resource" by "model" in every surf related identifier
authorvelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 16 Aug 2007 15:33:48 +0000 (15:33 +0000)
committervelho <velho@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 16 Aug 2007 15:33:48 +0000 (15:33 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4096 48e7efb5-ca39-0410-a469-dd3cf9ba447f

32 files changed:
src/include/surf/surf.h
src/include/surf/trace_mgr.h
src/simdag/sd_global.c
src/simdag/sd_task.c
src/simdag/sd_workstation.c
src/simix/private.h
src/simix/smx_action.c
src/simix/smx_config.c
src/simix/smx_deployment.c
src/simix/smx_environment.c
src/simix/smx_global.c
src/simix/smx_host.c
src/simix/smx_process.c
src/surf/cpu.c
src/surf/cpu_private.h
src/surf/network.c
src/surf/network_gtnets.c
src/surf/network_gtnets_private.h
src/surf/network_private.h
src/surf/surf.c
src/surf/surf_private.h
src/surf/surf_timer.c
src/surf/surf_timer_private.h
src/surf/trace_mgr.c
src/surf/trace_mgr_private.h
src/surf/workstation.c
src/surf/workstation_KCCFLN05.c
src/surf/workstation_KCCFLN05_private.h
src/surf/workstation_private.h
src/surf/workstation_ptask_L07.c
testsuite/surf/surf_usage.c
testsuite/surf/surf_usage2.c

index 1a59662..1715b65 100644 (file)
@@ -18,12 +18,12 @@ SG_BEGIN_DECL()
 
 
 
-/* Actions and resources are higly connected structures... */
+/* Actions and models are higly connected structures... */
 
 /** \brief Action datatype
  *  \ingroup SURF_actions
  *  
- * An action is some working amount on a resource.
+ * An action is some working amount on a model.
  * It is represented as a cost, a priority, a duration and a state.
  *
  * \see e_surf_action_state_t
@@ -31,27 +31,27 @@ SG_BEGIN_DECL()
 typedef struct surf_action *surf_action_t;
 
 /** \brief Resource datatype
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  
- *  Generic data structure for a resource. The workstations,
- *  the CPUs and the network links are examples of resources.
+ *  Generic data structure for a model. The workstations,
+ *  the CPUs and the network links are examples of models.
  */
-typedef struct surf_resource *surf_resource_t;
+typedef struct surf_model *surf_model_t;
 
 /** \brief Resource model description
  */
-typedef struct surf_resource_description {
+typedef struct surf_model_description {
   const char *name;
-  surf_resource_t resource;
-  void (* resource_init) (const char *filename);
-} s_surf_resource_description_t, *surf_resource_description_t;
+  surf_model_t model;
+  void (* model_init) (const char *filename);
+} s_surf_model_description_t, *surf_model_description_t;
 
-XBT_PUBLIC(void) update_resource_description(s_surf_resource_description_t *table,
+XBT_PUBLIC(void) update_model_description(s_surf_model_description_t *table,
                                             int table_size,
                                             const char* name, 
-                                            surf_resource_t resource
+                                            surf_model_t model
                                             );
-XBT_PUBLIC(int) find_resource_description(s_surf_resource_description_t *table,
+XBT_PUBLIC(int) find_model_description(s_surf_model_description_t *table,
                                          int table_size,
                                          const char* name);
 
@@ -59,7 +59,7 @@ XBT_PUBLIC(int) find_resource_description(s_surf_resource_description_t *table,
  * \ingroup SURF_actions
  *
  *  Never create s_surf_action_t by yourself ! The actions are created
- *  on the fly when you call execute or communicate on a resource.
+ *  on the fly when you call execute or communicate on a model.
  *  
  *  \see e_surf_action_state_t
  */
@@ -77,7 +77,7 @@ typedef struct surf_action {
                                 * and fluctuates until the task is completed */
   void *data;                  /**< for your convenience */
   int using;
-  surf_resource_t resource_type;
+  surf_model_t model_type;
 } s_surf_action_t;
 
 /** \brief Action states
@@ -112,18 +112,18 @@ typedef struct surf_action_state {
 } s_surf_action_state_t, *surf_action_state_t;
 
 /***************************/
-/* Generic resource object */
+/* Generic model object */
 /***************************/
 
-/** \brief Public data available on all resources
- *  \ingroup SURF_resources
+/** \brief Public data available on all models
+ *  \ingroup SURF_models
  *
- *  These functions are implemented by all resources.
+ *  These functions are implemented by all models.
  */
-typedef struct surf_resource_public {
-  s_surf_action_state_t states;        /**< Any living action on this resource */
-  void *(*name_service) (const char *name); /**< Return a resource given its name */
-  const char *(*get_resource_name) (void *resource_id); /**< Return the name of a resource */
+typedef struct surf_model_public {
+  s_surf_action_state_t states;        /**< Any living action on this model */
+  void *(*name_service) (const char *name); /**< Return a model given its name */
+  const char *(*get_model_name) (void *model_id); /**< Return the name of a model */
 
   e_surf_action_state_t(*action_get_state) (surf_action_t action); /**< Return the state of an action */
   double (*action_get_start_time) (surf_action_t action); /**< Return the start time of an action */
@@ -140,121 +140,121 @@ typedef struct surf_resource_public {
   int (*is_suspended) (surf_action_t action); /**< Return whether an action is suspended */
   void (*set_max_duration) (surf_action_t action, double duration); /**< Set the max duration of an action*/
   void (*set_priority) (surf_action_t action, double priority); /**< Set the priority of an action */
-  const char *name; /**< Name of this resource */
-} s_surf_resource_public_t, *surf_resource_public_t;
+  const char *name; /**< Name of this model */
+} s_surf_model_public_t, *surf_model_public_t;
 
-/** \brief Private data available on all resources
- *  \ingroup SURF_resources
+/** \brief Private data available on all models
+ *  \ingroup SURF_models
  */
-typedef struct surf_resource_private *surf_resource_private_t;
+typedef struct surf_model_private *surf_model_private_t;
 
 /** \brief Resource datatype
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  
- *  Generic data structure for a resource. The workstations,
- *  the CPUs and the network links are examples of resources.
+ *  Generic data structure for a model. The workstations,
+ *  the CPUs and the network links are examples of models.
  */
-typedef struct surf_resource {
-  surf_resource_private_t common_private;
-  surf_resource_public_t common_public;
-} s_surf_resource_t;
+typedef struct surf_model {
+  surf_model_private_t common_private;
+  surf_model_public_t common_public;
+} s_surf_model_t;
 
 /**************************************/
-/* Implementations of resource object */
+/* Implementations of model object */
 /**************************************/
 
-/** \brief Timer resource extension public
- * \ingroup SURF_resource
+/** \brief Timer model extension public
+ * \ingroup SURF_model
  *
- * Additionnal functions specific to the timer resource
+ * Additionnal functions specific to the timer model
  */
-typedef struct surf_timer_resource_extension_public {
+typedef struct surf_timer_model_extension_public {
   void (*set) (double date, void *function, void *arg);
   int (*get)  (void **function, void **arg);
-} s_surf_timer_resource_extension_public_t,
-  *surf_timer_resource_extension_public_t;
+} s_surf_timer_model_extension_public_t,
+  *surf_timer_model_extension_public_t;
 
-/** \brief Timer resource
- *  \ingroup SURF_resources
+/** \brief Timer model
+ *  \ingroup SURF_models
  */
-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;
+typedef struct surf_timer_model {
+  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 The timer resource
- *  \ingroup SURF_resources
+/** \brief The timer model
+ *  \ingroup SURF_models
  */
-XBT_PUBLIC_DATA(surf_timer_resource_t) surf_timer_resource;
+XBT_PUBLIC_DATA(surf_timer_model_t) surf_timer_model;
 
-/** \brief Initializes the timer resource
- *  \ingroup SURF_resources
+/** \brief Initializes the timer model
+ *  \ingroup SURF_models
  */
-XBT_PUBLIC(void) surf_timer_resource_init(const char *filename);
+XBT_PUBLIC(void) surf_timer_model_init(const char *filename);
 
-/* Cpu resource */
+/* Cpu model */
 
 /** \brief CPU state
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  */
 typedef enum {
   SURF_CPU_ON = 1,             /**< Ready        */
   SURF_CPU_OFF = 0             /**< Running      */
 } e_surf_cpu_state_t;
 
-/** \brief CPU resource extension public
- *  \ingroup SURF_resources
+/** \brief CPU model extension public
+ *  \ingroup SURF_models
  *  
- *  Public functions specific to the CPU resource.
+ *  Public functions specific to the CPU model.
  */
-typedef struct surf_cpu_resource_extension_public {
+typedef struct surf_cpu_model_extension_public {
   surf_action_t(*execute) (void *cpu, double size);
   surf_action_t(*sleep) (void *cpu, double duration);
   e_surf_cpu_state_t(*get_state) (void *cpu);
   double (*get_speed) (void *cpu, double load);
   double (*get_available_speed) (void *cpu);
-} s_surf_cpu_resource_extension_public_t,
-    *surf_cpu_resource_extension_public_t;
+} s_surf_cpu_model_extension_public_t,
+    *surf_cpu_model_extension_public_t;
 
-/** \brief CPU resource datatype
- *  \ingroup SURF_resources
+/** \brief CPU model datatype
+ *  \ingroup SURF_models
  */
-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;
+typedef struct surf_cpu_model {
+  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;
 
-/** \brief The CPU resource
- *  \ingroup SURF_resources
+/** \brief The CPU model
+ *  \ingroup SURF_models
  */
-XBT_PUBLIC_DATA(surf_cpu_resource_t) surf_cpu_resource;
+XBT_PUBLIC_DATA(surf_cpu_model_t) surf_cpu_model;
 
-/** \brief Initializes the CPU resource with the model Cas01
- *  \ingroup SURF_resources
+/** \brief Initializes the CPU model with the model Cas01
+ *  \ingroup SURF_models
  *
- *  This function is called by surf_workstation_resource_init_CLM03
+ *  This function is called by surf_workstation_model_init_CLM03
  *  so you shouldn't have to call it by yourself.
  *
- *  \see surf_workstation_resource_init_CLM03()
+ *  \see surf_workstation_model_init_CLM03()
  */
-XBT_PUBLIC(void) surf_cpu_resource_init_Cas01(const char *filename);
+XBT_PUBLIC(void) surf_cpu_model_init_Cas01(const char *filename);
 
-extern XBT_PUBLIC_DATA(int) surf_cpu_resource_description_size;
-/** \brief The list of all available cpu resource models
- *  \ingroup SURF_resources
+extern XBT_PUBLIC_DATA(int) surf_cpu_model_description_size;
+/** \brief The list of all available cpu model models
+ *  \ingroup SURF_models
  */
-extern XBT_PUBLIC_DATA(s_surf_resource_description_t) surf_cpu_resource_description[];
+extern XBT_PUBLIC_DATA(s_surf_model_description_t) surf_cpu_model_description[];
 
-/* Network resource */
+/* Network model */
 
-/** \brief Network resource extension public
- *  \ingroup SURF_resources
+/** \brief Network model extension public
+ *  \ingroup SURF_models
  *
- *  Public functions specific to the network resource
+ *  Public functions specific to the network model
  */
-typedef struct surf_network_resource_extension_public {
+typedef struct surf_network_model_extension_public {
   surf_action_t(*communicate) (void *src, void *dst, double size,
                               double max_rate);
   const void** (*get_route) (void *src, void *dst);
@@ -262,54 +262,54 @@ typedef struct surf_network_resource_extension_public {
   const char* (*get_link_name) (const void *link);
   double (*get_link_bandwidth) (const void *link);
   double (*get_link_latency) (const void *link);
-} s_surf_network_resource_extension_public_t,
-    *surf_network_resource_extension_public_t;
+} s_surf_network_model_extension_public_t,
+    *surf_network_model_extension_public_t;
 
-/** \brief Network resource datatype
- *  \ingroup SURF_resources
+/** \brief Network model datatype
+ *  \ingroup SURF_models
  */
-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;
+typedef struct surf_network_model {
+  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;
 
-/** \brief The network resource
- *  \ingroup SURF_resources
+/** \brief The network model
+ *  \ingroup SURF_models
  *
  *  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.
+ *  network model unless you know what you are doing. Only the workstation
+ *  model should be accessed because depending on the platform model,
+ *  the network model can be NULL.
  */
-XBT_PUBLIC_DATA(surf_network_resource_t) surf_network_resource;
+XBT_PUBLIC_DATA(surf_network_model_t) surf_network_model;
 
 /** \brief Initializes the platform with the network model CM02
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \param filename XML platform file name
  *
- *  This function is called by surf_workstation_resource_init_CLM03
- *  or by yourself only if you plan using surf_workstation_resource_init_compound
+ *  This function is called by surf_workstation_model_init_CLM03
+ *  or by yourself only if you plan using surf_workstation_model_init_compound
  *
- *  \see surf_workstation_resource_init_CLM03()
+ *  \see surf_workstation_model_init_CLM03()
  */
-XBT_PUBLIC(void) surf_network_resource_init_CM02(const char *filename);
+XBT_PUBLIC(void) surf_network_model_init_CM02(const char *filename);
 
 #ifdef HAVE_GTNETS
 /** \brief Initializes the platform with the network model GTNETS
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \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
+ *  This function is called by surf_workstation_model_init_GTNETS
+ *  or by yourself only if you plan using surf_workstation_model_init_compound
  *
- *  \see surf_workstation_resource_init_GTNETS()
+ *  \see surf_workstation_model_init_GTNETS()
  */
-XBT_PUBLIC(void) surf_network_resource_init_GTNETS(const char *filename);
+XBT_PUBLIC(void) surf_network_model_init_GTNETS(const char *filename);
 #endif
 
 /** \brief Initializes the platform with the network model Reno
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \param filename XML platform file name
  *
  *  The problem is related to max( sum( arctan(C * Df * xi) ) ).
@@ -318,13 +318,13 @@ XBT_PUBLIC(void) surf_network_resource_init_GTNETS(const char *filename);
  *  [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
  *  IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
  *
- *  Call this function only if you plan using surf_workstation_resource_init_compound.
+ *  Call this function only if you plan using surf_workstation_model_init_compound.
  *
  */
-XBT_PUBLIC(void) surf_network_resource_init_Reno(const char *filename);
+XBT_PUBLIC(void) surf_network_model_init_Reno(const char *filename);
 
 /** \brief Initializes the platform with the network model Vegas
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \param filename XML platform file name
  *
  *  This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent 
@@ -334,14 +334,14 @@ XBT_PUBLIC(void) surf_network_resource_init_Reno(const char *filename);
  *  [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
  *  IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
  *
- *  Call this function only if you plan using surf_workstation_resource_init_compound.
+ *  Call this function only if you plan using surf_workstation_model_init_compound.
  *
  */
-XBT_PUBLIC(void) surf_network_resource_init_Vegas(const char *filename);
+XBT_PUBLIC(void) surf_network_model_init_Vegas(const char *filename);
 
 #ifdef HAVE_SDP
 /** \brief Initializes the platform with the network model based on SDP
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \param filename XML platform file name
  *
  *  This function implements the proportional fairness known as the maximization
@@ -353,25 +353,25 @@ XBT_PUBLIC(void) surf_network_resource_init_Vegas(const char *filename);
  *  Semi-definite programming approach for bandwidth allocation and routing in networks.
  *  Game Theory and Applications, 9:169-179, December 2003. Nova publisher.
  *
- *  Call this function only if you plan using surf_workstation_resource_init_compound.
+ *  Call this function only if you plan using surf_workstation_model_init_compound.
  */
-XBT_PUBLIC(void) surf_network_resource_init_SDP(const char *filename);
+XBT_PUBLIC(void) surf_network_model_init_SDP(const char *filename);
 #endif
 
 
 
-extern XBT_PUBLIC_DATA(int) surf_network_resource_description_size;
-/** \brief The list of all available network resource models
- *  \ingroup SURF_resources
+extern XBT_PUBLIC_DATA(int) surf_network_model_description_size;
+/** \brief The list of all available network model models
+ *  \ingroup SURF_models
  */
-extern XBT_PUBLIC_DATA(s_surf_resource_description_t) surf_network_resource_description[];
+extern XBT_PUBLIC_DATA(s_surf_model_description_t) surf_network_model_description[];
 
-/** \brief Workstation resource extension public
- *  \ingroup SURF_resources
+/** \brief Workstation model extension public
+ *  \ingroup SURF_models
  *
- *  Public functions specific to the workstation resource.
+ *  Public functions specific to the workstation model.
  */
-typedef struct surf_workstation_resource_extension_public {
+typedef struct surf_workstation_model_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 */
@@ -392,55 +392,55 @@ typedef struct surf_workstation_resource_extension_public {
   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;
+} s_surf_workstation_model_extension_public_t,
+    *surf_workstation_model_extension_public_t;
 
-/** \brief Workstation resource datatype.
- *  \ingroup SURF_resources
+/** \brief Workstation model datatype.
+ *  \ingroup SURF_models
  *
  */
-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;
+typedef struct surf_workstation_model {
+  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;
 
-/** \brief The workstation resource
- *  \ingroup SURF_resources
+/** \brief The workstation model
+ *  \ingroup SURF_models
  *
  *  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
+ *  the workstation model should be the only one you use
+ *  because depending on the platform model, the network model and the CPU model
  *  may not exist.
  */
-XBT_PUBLIC_DATA(surf_workstation_resource_t) surf_workstation_resource;
+XBT_PUBLIC_DATA(surf_workstation_model_t) surf_workstation_model;
 
 /** \brief Initializes the platform with a compound workstation model
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \param filename XML platform file name
  *
- *  This function should be called after a cpu_resource and a
- *  network_resource have been set up.
+ *  This function should be called after a cpu_model and a
+ *  network_model have been set up.
  *
  */
-XBT_PUBLIC(void) surf_workstation_resource_init_compound(const char *filename);
+XBT_PUBLIC(void) surf_workstation_model_init_compound(const char *filename);
 
 /** \brief Initializes the platform with the workstation model CLM03
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \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.
+ *  This platform model seperates the workstation model and the network model.
+ *  The workstation model will be initialized with the model CLM03, the network
+ *  model with the model CM02 and the CPU model 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()
+ *  \see surf_workstation_model_init_KCCFLN05()
  */
-XBT_PUBLIC(void) surf_workstation_resource_init_CLM03(const char *filename);
+XBT_PUBLIC(void) surf_workstation_model_init_CLM03(const char *filename);
 
 /** \brief Initializes the platform with the model KCCFLN05
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \param filename XML platform file name
  *
  *  With this model, the workstations and the network are handled
@@ -450,27 +450,27 @@ XBT_PUBLIC(void) surf_workstation_resource_init_CLM03(const char *filename);
  *  SimDag.
  *
  */
-XBT_PUBLIC(void) surf_workstation_resource_init_KCCFLN05(const char *filename);
+XBT_PUBLIC(void) surf_workstation_model_init_KCCFLN05(const char *filename);
 
 /** \brief Initializes the platform with the model KCCFLN05
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *  \param filename XML platform file name
  *
  *  With this model, only parallel tasks can be used. Resource sharing
  *  is done by identifying bottlenecks and giving an equal share of
- *  the resource to each action.
+ *  the model to each action.
  *
  */
-XBT_PUBLIC(void) surf_workstation_resource_init_ptask_L07(const char *filename);
+XBT_PUBLIC(void) surf_workstation_model_init_ptask_L07(const char *filename);
 
-extern XBT_PUBLIC_DATA(int) surf_workstation_resource_description_size;
-/** \brief The list of all available workstation resource models
- *  \ingroup SURF_resources
+extern XBT_PUBLIC_DATA(int) surf_workstation_model_description_size;
+/** \brief The list of all available workstation model models
+ *  \ingroup SURF_models
  */
-extern XBT_PUBLIC_DATA(s_surf_resource_description_t) surf_workstation_resource_description[];
+extern XBT_PUBLIC_DATA(s_surf_model_description_t) surf_workstation_model_description[];
 
 /** \brief The network links
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *
  *  This dict contains all network links.
  *
@@ -479,7 +479,7 @@ extern XBT_PUBLIC_DATA(s_surf_resource_description_t) surf_workstation_resource_
 XBT_PUBLIC_DATA(xbt_dict_t) network_link_set;
 
 /** \brief The workstations
- *  \ingroup SURF_resources
+ *  \ingroup SURF_models
  *
  *  This dict contains all workstations.
  *
@@ -487,10 +487,10 @@ XBT_PUBLIC_DATA(xbt_dict_t) network_link_set;
  */
 XBT_PUBLIC_DATA(xbt_dict_t)  workstation_set;
 
-/** \brief List of initialized resources
- *  \ingroup SURF_resources
+/** \brief List of initialized models
+ *  \ingroup SURF_models
  */
-XBT_PUBLIC_DATA(xbt_dynar_t)  resource_list;
+XBT_PUBLIC_DATA(xbt_dynar_t)  model_list;
 
 /*******************************************/
 /*** SURF Globals **************************/
@@ -503,12 +503,12 @@ XBT_PUBLIC_DATA(xbt_dynar_t)  resource_list;
  *
  *  This function has to be called to initialize the common
  *  structures.  Then you will have to create the environment by
- *  calling surf_timer_resource_init() and
- *  e.g. surf_workstation_resource_init_CLM03() or
- *  surf_workstation_resource_init_KCCFLN05().
+ *  calling surf_timer_model_init() and
+ *  e.g. surf_workstation_model_init_CLM03() or
+ *  surf_workstation_model_init_KCCFLN05().
  *
- *  \see surf_timer_resource_init(), surf_workstation_resource_init_CLM03(),
- *  surf_workstation_resource_init_KCCFLN05(), surf_workstation_resource_init_compound(), surf_exit()
+ *  \see surf_timer_model_init(), surf_workstation_model_init_CLM03(),
+ *  surf_workstation_model_init_KCCFLN05(), surf_workstation_model_init_compound(), surf_exit()
  */
 XBT_PUBLIC(void) surf_init(int *argc, char **argv);    /* initialize common structures */
 
@@ -518,7 +518,7 @@ XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structu
  *
  *  This function execute all possible events, update the action states
  *  and returns the time elapsed.
- *  When you call execute or communicate on a resource, the corresponding actions
+ *  When you call execute or communicate on a model, the corresponding actions
  *  are not executed immediately but only when you call surf_solve.
  *  Note that the returned elapsed time can be zero.
  */
index a642046..c3600e5 100644 (file)
@@ -27,14 +27,14 @@ XBT_PUBLIC(void) tmgr_trace_free(tmgr_trace_t trace);
 XBT_PUBLIC(tmgr_trace_event_t) tmgr_history_add_trace(tmgr_history_t history,
                                          tmgr_trace_t trace,
                                          double start_time, int offset,
-                                         void *resource);
+                                         void *model);
 
 /* Access functions */
 XBT_PUBLIC(double) tmgr_history_next_date(tmgr_history_t history);
 XBT_PUBLIC(tmgr_trace_event_t) tmgr_history_get_next_event_leq(tmgr_history_t history,
                                                   double date,
                                                   double *value,
-                                                  void **resource);
+                                                  void **model);
 
 XBT_PUBLIC(void) tmgr_finalize(void);
 
index 0f7a75d..d439547 100644 (file)
@@ -34,8 +34,8 @@ static void _sd_cfg_cb__workstation_model(const char *name, int pos)
              "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sd_cfg_set, name);
-  find_resource_description(surf_workstation_resource_description,
-                           surf_workstation_resource_description_size,
+  find_model_description(surf_workstation_model_description,
+                           surf_workstation_model_description_size,
                            val);
 }
 
@@ -48,8 +48,8 @@ static void _sd_cfg_cb__cpu_model(const char *name, int pos)
              "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sd_cfg_set, name);
-  find_resource_description(surf_cpu_resource_description,
-                           surf_cpu_resource_description_size, val);
+  find_model_description(surf_cpu_model_description,
+                           surf_cpu_model_description_size, val);
 }
 
 /* callback of the workstation_model variable */
@@ -61,8 +61,8 @@ static void _sd_cfg_cb__network_model(const char *name, int pos)
              "Cannot change the model after the initialization");
 
   val = xbt_cfg_get_string(_sd_cfg_set, name);
-  find_resource_description(surf_network_resource_description,
-                           surf_network_resource_description_size, val);
+  find_model_description(surf_network_model_description,
+                           surf_network_model_description_size, val);
 }
 
 /* create the config set and register what should be */
@@ -299,15 +299,15 @@ void SD_create_environment(const char *platform_file) {
   DEBUG0("SD_create_environment");
 
   sd_config_init();
-  surf_timer_resource_init(platform_file);
+  surf_timer_model_init(platform_file);
 
   workstation_model_name =
       xbt_cfg_get_string(_sd_cfg_set, "workstation_model");
 
   DEBUG1("Model : %s", workstation_model_name);
   workstation_id =
-      find_resource_description(surf_workstation_resource_description,
-                               surf_workstation_resource_description_size,
+      find_model_description(surf_workstation_model_description,
+                               surf_workstation_model_description_size,
                                workstation_model_name);
   if (!strcmp(workstation_model_name, "compound")) {
     xbt_ex_t e;
@@ -343,21 +343,21 @@ void SD_create_environment(const char *platform_file) {
     }
 
     network_id =
-       find_resource_description(surf_network_resource_description,
-                                 surf_network_resource_description_size,
+       find_model_description(surf_network_model_description,
+                                 surf_network_model_description_size,
                                  network_model_name);
     cpu_id =
-       find_resource_description(surf_cpu_resource_description,
-                                 surf_cpu_resource_description_size,
+       find_model_description(surf_cpu_model_description,
+                                 surf_cpu_model_description_size,
                                  cpu_model_name);
 
-    surf_cpu_resource_description[cpu_id].resource_init(platform_file);
-    surf_network_resource_description[network_id].resource_init(platform_file);
+    surf_cpu_model_description[cpu_id].model_init(platform_file);
+    surf_network_model_description[network_id].model_init(platform_file);
   }
 
-  DEBUG0("Call workstation_resource_init");
-  surf_workstation_resource_description[workstation_id].
-      resource_init(platform_file);
+  DEBUG0("Call workstation_model_init");
+  surf_workstation_model_description[workstation_id].
+      model_init(platform_file);
 
   _sd_init_status = 2;
 
@@ -412,7 +412,7 @@ SD_task_t* SD_simulate(double how_long)
   }
 
   if(how_long>0) {
-    surf_timer_resource->extension_public->set(surf_get_clock()+how_long,
+    surf_timer_model->extension_public->set(surf_get_clock()+how_long,
                                               NULL,NULL);
   }
   sd_global->watch_point_reached = 0;
@@ -437,7 +437,7 @@ SD_task_t* SD_simulate(double how_long)
   while (elapsed_time >= 0.0 &&
         (how_long < 0.0 || total_time < how_long) &&
         !sd_global->watch_point_reached) {
-    surf_resource_t resource = NULL;
+    surf_model_t model = NULL;
     /* dumb variables */
     void *fun = NULL;
     void *arg = NULL;
@@ -451,8 +451,8 @@ SD_task_t* SD_simulate(double how_long)
       total_time += elapsed_time;
 
     /* let's see which tasks are done */
-    xbt_dynar_foreach(resource_list, i, resource) {
-      while ((action = xbt_swag_extract(resource->common_public->
+    xbt_dynar_foreach(model_list, i, model) {
+      while ((action = xbt_swag_extract(model->common_public->
                                        states.done_action_set))) {
        task = action->data;
        INFO1("Task '%s' done", SD_task_get_name(task));
@@ -497,11 +497,11 @@ SD_task_t* SD_simulate(double how_long)
       }
 
       /* let's see which tasks have just failed */
-      while ((action = xbt_swag_extract(resource->common_public->states.failed_action_set))) {
+      while ((action = xbt_swag_extract(model->common_public->states.failed_action_set))) {
        task = action->data;
        INFO1("Task '%s' failed", SD_task_get_name(task));
        __SD_task_set_state(task, SD_FAILED);
-       surf_workstation_resource->common_public->action_free(action);
+       surf_workstation_model->common_public->action_free(action);
        task->surf_action = NULL;
        
        if (!task->state_changed) {
@@ -518,7 +518,7 @@ SD_task_t* SD_simulate(double how_long)
       }
     }
 
-    while (surf_timer_resource->extension_public->get(&fun,(void*)&arg)) {
+    while (surf_timer_model->extension_public->get(&fun,(void*)&arg)) {
     }
   }
 
index c9931c2..361f544 100644 (file)
@@ -124,12 +124,12 @@ void __SD_task_set_state(SD_task_t task, e_SD_task_state_t new_state) {
     break;
   case SD_RUNNING:
     task->state_set = sd_global->running_task_set;
-    task->start_time = surf_workstation_resource->common_public->
+    task->start_time = surf_workstation_model->common_public->
       action_get_start_time(task->surf_action);
     break;
   case SD_DONE:
     task->state_set = sd_global->done_task_set;
-    task->finish_time = surf_workstation_resource->common_public->
+    task->finish_time = surf_workstation_model->common_public->
       action_get_finish_time(task->surf_action);
     task->remains = 0;
     break;
@@ -589,7 +589,7 @@ void SD_task_unschedule(SD_task_t task) {
     __SD_task_destroy_scheduling_data(task);
 
   if (__SD_task_is_running(task)) /* the task should become SD_FAILED */
-    surf_workstation_resource->common_public->action_cancel(task->surf_action);
+    surf_workstation_model->common_public->action_cancel(task->surf_action);
   else
     __SD_task_set_state(task, SD_NOT_SCHEDULED);
   task->remains = task->amount;
@@ -648,11 +648,11 @@ void __SD_task_really_run(SD_task_t task) {
   task->surf_action = NULL;
   if((task->workstation_nb==1) &&
      (task->communication_amount[0]==0.0)) {
-    task->surf_action = surf_workstation_resource->extension_public->
+    task->surf_action = surf_workstation_model->extension_public->
       execute(surf_workstations[0], task->computation_amount[0]);
   } else if((task->workstation_nb==1) &&
            (task->computation_amount[0]==0.0)) {
-    task->surf_action = surf_workstation_resource->extension_public->
+    task->surf_action = surf_workstation_model->extension_public->
       communicate(surf_workstations[0], surf_workstations[0],
                  task->communication_amount[0],task->rate);
   } else if((task->workstation_nb==2) &&
@@ -668,13 +668,13 @@ void __SD_task_really_run(SD_task_t task) {
       }
     }
     if(nb==1) {
-      task->surf_action = surf_workstation_resource->extension_public->
+      task->surf_action = surf_workstation_model->extension_public->
        communicate(surf_workstations[0], surf_workstations[1],
                    value, task->rate);
     }
   }
   if(!task->surf_action) 
-    task->surf_action = surf_workstation_resource->extension_public->
+    task->surf_action = surf_workstation_model->extension_public->
       execute_parallel_task(task->workstation_nb,
                            surf_workstations,
                            task->computation_amount,
@@ -682,7 +682,7 @@ void __SD_task_really_run(SD_task_t task) {
                            task->amount,
                            task->rate);
 
-  surf_workstation_resource->common_public->action_set_data(task->surf_action, task);
+  surf_workstation_model->common_public->action_set_data(task->surf_action, task);
   task->state_changed = 1;
 
   DEBUG1("surf_action = %p",  task->surf_action);
@@ -763,7 +763,7 @@ void __SD_task_just_done(SD_task_t task) {
   candidates = xbt_new(SD_task_t, 8);
 
   __SD_task_set_state(task, SD_DONE);
-  surf_workstation_resource->common_public->action_free(task->surf_action);
+  surf_workstation_model->common_public->action_free(task->surf_action);
   task->surf_action = NULL;
 
   DEBUG0("Looking for candidates");
@@ -896,7 +896,7 @@ double SD_task_get_start_time(SD_task_t task) {
   SD_CHECK_INIT_DONE();
   xbt_assert0(task != NULL, "Invalid parameter");
   if(task->surf_action)
-    return surf_workstation_resource->common_public->action_get_start_time(task->surf_action);
+    return surf_workstation_model->common_public->action_get_start_time(task->surf_action);
   else 
     return task->start_time;
 }
@@ -917,7 +917,7 @@ double SD_task_get_finish_time(SD_task_t task) {
   xbt_assert0(task != NULL, "Invalid parameter");
 
   if(task->surf_action) /* should never happen as actions are destroyed right after their completion */
-    return surf_workstation_resource->common_public->action_get_finish_time(task->surf_action);
+    return surf_workstation_model->common_public->action_get_finish_time(task->surf_action);
   else 
     return task->finish_time;
 }
@@ -946,7 +946,7 @@ void SD_task_destroy(SD_task_t task) {
     xbt_free(task->name);
 
   if (task->surf_action != NULL)
-    surf_workstation_resource->common_public->action_free(task->surf_action);
+    surf_workstation_model->common_public->action_free(task->surf_action);
 
   if (task->workstation_list != NULL)
     xbt_free(task->workstation_list);
index 8205c4c..eb42434 100644 (file)
@@ -126,7 +126,7 @@ void SD_workstation_set_data(SD_workstation_t workstation, void *data) {
 const char* SD_workstation_get_name(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
-  return surf_workstation_resource->common_public->get_resource_name(workstation->surf_workstation);
+  return surf_workstation_model->common_public->get_model_name(workstation->surf_workstation);
 }
 
 /**
@@ -157,12 +157,12 @@ const SD_link_t* SD_route_get_list(SD_workstation_t src, SD_workstation_t dst) {
   surf_src = src->surf_workstation;
   surf_dst = dst->surf_workstation;
 
-  surf_route = surf_workstation_resource->extension_public->get_route(surf_src, surf_dst);
-  route_size = surf_workstation_resource->extension_public->get_route_size(surf_src, surf_dst);
+  surf_route = surf_workstation_model->extension_public->get_route(surf_src, surf_dst);
+  route_size = surf_workstation_model->extension_public->get_route_size(surf_src, surf_dst);
 
 
   for (i = 0; i < route_size; i++) {
-    link_name = surf_workstation_resource->extension_public->get_link_name(surf_route[i]);
+    link_name = surf_workstation_model->extension_public->get_link_name(surf_route[i]);
     sd_global->recyclable_route[i] = xbt_dict_get(sd_global->links, link_name);
   }
 
@@ -179,7 +179,7 @@ const SD_link_t* SD_route_get_list(SD_workstation_t src, SD_workstation_t dst) {
  */
 int SD_route_get_size(SD_workstation_t src, SD_workstation_t dst) {
   SD_CHECK_INIT_DONE();
-  return surf_workstation_resource->extension_public->
+  return surf_workstation_model->extension_public->
     get_route_size(src->surf_workstation, dst->surf_workstation);
 }
 
@@ -193,7 +193,7 @@ int SD_route_get_size(SD_workstation_t src, SD_workstation_t dst) {
 double SD_workstation_get_power(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
-  return surf_workstation_resource->extension_public->get_speed(workstation->surf_workstation, 1.0);
+  return surf_workstation_model->extension_public->get_speed(workstation->surf_workstation, 1.0);
 }
 
 /**
@@ -206,7 +206,7 @@ double SD_workstation_get_power(SD_workstation_t workstation) {
 double SD_workstation_get_available_power(SD_workstation_t workstation) {
   SD_CHECK_INIT_DONE();
   xbt_assert0(workstation != NULL, "Invalid parameter");
-  return surf_workstation_resource->extension_public->get_available_speed(workstation->surf_workstation);
+  return surf_workstation_model->extension_public->get_available_speed(workstation->surf_workstation);
 }
 
 /**
@@ -351,7 +351,7 @@ double SD_route_get_communication_time(SD_workstation_t src, SD_workstation_t ds
 /**
  * \brief Sets the access mode for the tasks that will be executed on a workstation
  *
- * By default, a workstation resource is shared, i.e. several tasks
+ * By default, a workstation model is shared, i.e. several tasks
  * can be executed at the same time on a workstation. The CPU power of
  * the workstation is shared between the running tasks on the workstation.
  * In sequential mode, only one task can use the workstation, and the other
index e2d7d04..b9d0499 100644 (file)
@@ -110,7 +110,7 @@ extern int _simix_init_status;      /* 0: beginning of time;
 extern xbt_cfg_t _simix_cfg_set;
 
 
-#define SIMIX_CHECK_HOST()  xbt_assert0(surf_workstation_resource->extension_public-> \
+#define SIMIX_CHECK_HOST()  xbt_assert0(surf_workstation_model->extension_public-> \
                                  get_state(SIMIX_host_self()->simdata->host)==SURF_CPU_ON,\
                                   "Host failed, you cannot call this function.")
 
index 2abb7c5..c56f305 100644 (file)
@@ -29,12 +29,12 @@ smx_action_t SIMIX_action_communicate(smx_host_t sender,
                                      double size, double rate)
 {
   /* check if the host is active */
-  if (surf_workstation_resource->extension_public->
+  if (surf_workstation_model->extension_public->
       get_state(sender->simdata->host) != SURF_CPU_ON) {
     THROW1(network_error, 0,
           "Host %s failed, you cannot call this function", sender->name);
   }
-  if (surf_workstation_resource->extension_public->
+  if (surf_workstation_model->extension_public->
       get_state(receiver->simdata->host) != SURF_CPU_ON) {
     THROW1(network_error, 0,
           "Host %s failed, you cannot call this function",
@@ -52,10 +52,10 @@ smx_action_t SIMIX_action_communicate(smx_host_t sender,
   simdata->source = sender;
 
 
-  simdata->surf_action = surf_workstation_resource->extension_public->
+  simdata->surf_action = surf_workstation_model->extension_public->
       communicate(sender->simdata->host,
                  receiver->simdata->host, size, rate);
-  surf_workstation_resource->common_public->action_set_data(simdata->
+  surf_workstation_model->common_public->action_set_data(simdata->
                                                            surf_action,
                                                            act);
 
@@ -75,7 +75,7 @@ smx_action_t SIMIX_action_execute(smx_host_t host, char *name,
                                  double amount)
 {
   /* check if the host is active */
-  if (surf_workstation_resource->extension_public->
+  if (surf_workstation_model->extension_public->
       get_state(host->simdata->host) != SURF_CPU_ON) {
     THROW1(host_error, 0, "Host %s failed, you cannot call this function",
           host->name);
@@ -92,10 +92,10 @@ smx_action_t SIMIX_action_execute(smx_host_t host, char *name,
   act->name = xbt_strdup(name);
 
   /* set communication */
-  simdata->surf_action = surf_workstation_resource->extension_public->
+  simdata->surf_action = surf_workstation_model->extension_public->
       execute(host->simdata->host, amount);
 
-  surf_workstation_resource->common_public->action_set_data(simdata->
+  surf_workstation_model->common_public->action_set_data(simdata->
                                                            surf_action,
                                                            act);
 
@@ -115,7 +115,7 @@ smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
   char name[] = "sleep";
 
   /* check if the host is active */
-  if (surf_workstation_resource->extension_public->
+  if (surf_workstation_model->extension_public->
       get_state(host->simdata->host) != SURF_CPU_ON) {
     THROW1(host_error, 0, "Host %s failed, you cannot call this function",
           host->name);
@@ -131,10 +131,10 @@ smx_action_t SIMIX_action_sleep(smx_host_t host, double duration)
   simdata->source = host;
   act->name = xbt_strdup(name);
 
-  simdata->surf_action = surf_workstation_resource->extension_public->
+  simdata->surf_action = surf_workstation_model->extension_public->
       sleep(host->simdata->host, duration);
 
-  surf_workstation_resource->common_public->action_set_data(simdata->
+  surf_workstation_model->common_public->action_set_data(simdata->
                                                            surf_action,
                                                            act);
 
@@ -154,7 +154,7 @@ void SIMIX_action_cancel(smx_action_t action)
 
   DEBUG1("Cancel action %p", action);
   if (action->simdata->surf_action) {
-    surf_workstation_resource->common_public->action_cancel(action->
+    surf_workstation_model->common_public->action_cancel(action->
                                                            simdata->
                                                            surf_action);
   }
@@ -173,7 +173,7 @@ void SIMIX_action_set_priority(smx_action_t action, double priority)
   xbt_assert0((action != NULL)
              && (action->simdata != NULL), "Invalid parameter");
 
-  surf_workstation_resource->common_public->
+  surf_workstation_model->common_public->
       set_priority(action->simdata->surf_action, priority);
   return;
 }
@@ -199,7 +199,7 @@ void SIMIX_action_destroy(smx_action_t action)
   xbt_fifo_free(action->cond_list);
 
   if (action->simdata->surf_action)
-    action->simdata->surf_action->resource_type->common_public->
+    action->simdata->surf_action->model_type->common_public->
        action_free(action->simdata->surf_action);
 
   xbt_free(action->simdata);
@@ -279,12 +279,12 @@ smx_action_t SIMIX_action_parallel_execute(char *name, int workstation_nb,
 
   /* set communication */
   simdata->surf_action =
-      surf_workstation_resource->extension_public->
+      surf_workstation_model->extension_public->
       execute_parallel_task(workstation_nb, workstation_list,
                            computation_amount, communication_amount,
                            amount, rate);
 
-  surf_workstation_resource->common_public->action_set_data(simdata->
+  surf_workstation_model->common_public->action_set_data(simdata->
                                                            surf_action,
                                                            act);
 
@@ -294,7 +294,7 @@ smx_action_t SIMIX_action_parallel_execute(char *name, int workstation_nb,
 e_surf_action_state_t SIMIX_action_get_state(smx_action_t action)
 {
   xbt_assert0((action != NULL), "Invalid parameter");
-  return surf_workstation_resource->common_public->
+  return surf_workstation_model->common_public->
       action_get_state(action->simdata->surf_action);
 
 }
index 0d46693..8ca058b 100644 (file)
@@ -26,8 +26,8 @@ static void _simix_cfg_cb__workstation_model(const char *name, int pos)
   val = xbt_cfg_get_string(_simix_cfg_set, name);
   /* New Module missing */
 
-  find_resource_description(surf_workstation_resource_description,
-                           surf_workstation_resource_description_size,
+  find_model_description(surf_workstation_model_description,
+                           surf_workstation_model_description_size,
                            val);
 }
 
@@ -41,8 +41,8 @@ static void _simix_cfg_cb__cpu_model(const char *name, int pos)
 
   val = xbt_cfg_get_string(_simix_cfg_set, name);
   /* New Module missing */
-  find_resource_description(surf_cpu_resource_description,
-                           surf_cpu_resource_description_size, val);
+  find_model_description(surf_cpu_model_description,
+                           surf_cpu_model_description_size, val);
 }
 
 /* callback of the workstation_model variable */
@@ -55,8 +55,8 @@ static void _simix_cfg_cb__network_model(const char *name, int pos)
 
   val = xbt_cfg_get_string(_simix_cfg_set, name);
   /* New Module missing */
-  find_resource_description(surf_network_resource_description,
-                           surf_network_resource_description_size, val);
+  find_model_description(surf_network_model_description,
+                           surf_network_model_description_size, val);
 }
 
 /* create the config set and register what should be */
index b1e90f1..61c03d7 100644 (file)
@@ -62,12 +62,12 @@ static void parse_process_finalize(void)
     DEBUG3("Process %s(%s) will be started at time %f", arg->name,
           arg->hostname, start_time);
     if (simix_global->create_process_function)
-      surf_timer_resource->extension_public->set(start_time,
+      surf_timer_model->extension_public->set(start_time,
                                                 (void *) simix_global->
                                                 create_process_function,
                                                 arg);
     else
-      surf_timer_resource->extension_public->set(start_time, (void *)
+      surf_timer_model->extension_public->set(start_time, (void *)
                                                 &SIMIX_process_create,
                                                 arg);
 
@@ -87,12 +87,12 @@ static void parse_process_finalize(void)
 
     if (kill_time > SIMIX_get_clock()) {
       if (simix_global->kill_process_function)
-       surf_timer_resource->extension_public->set(start_time,
+       surf_timer_model->extension_public->set(start_time,
                                                   (void *) simix_global->
                                                   kill_process_function,
                                                   arg);
       else
-       surf_timer_resource->extension_public->set(kill_time, (void *)
+       surf_timer_model->extension_public->set(kill_time, (void *)
                                                   &SIMIX_process_kill,
                                                   (void *) process);
     }
index 8ce4451..65ef329 100644 (file)
@@ -38,7 +38,7 @@ void SIMIX_create_environment(const char *file)
   int workstation_id = -1;
 
   simix_config_init();         /* make sure that our configuration set is created */
-  surf_timer_resource_init(file);
+  surf_timer_model_init(file);
 
   /* which model do you want today? */
   workstation_model_name =
@@ -46,8 +46,8 @@ void SIMIX_create_environment(const char *file)
 
   DEBUG1("Model : %s", workstation_model_name);
   workstation_id =
-      find_resource_description(surf_workstation_resource_description,
-                               surf_workstation_resource_description_size,
+      find_model_description(surf_workstation_model_description,
+                               surf_workstation_model_description_size,
                                workstation_model_name);
   if (!strcmp(workstation_model_name, "compound")) {
     xbt_ex_t e;
@@ -83,20 +83,20 @@ void SIMIX_create_environment(const char *file)
     }
 
     network_id =
-       find_resource_description(surf_network_resource_description,
-                                 surf_network_resource_description_size,
+       find_model_description(surf_network_model_description,
+                                 surf_network_model_description_size,
                                  network_model_name);
     cpu_id =
-       find_resource_description(surf_cpu_resource_description,
-                                 surf_cpu_resource_description_size,
+       find_model_description(surf_cpu_model_description,
+                                 surf_cpu_model_description_size,
                                  cpu_model_name);
 
-    surf_cpu_resource_description[cpu_id].resource_init(file);
-    surf_network_resource_description[network_id].resource_init(file);
+    surf_cpu_model_description[cpu_id].model_init(file);
+    surf_network_model_description[network_id].model_init(file);
   }
 
-  surf_workstation_resource_description[workstation_id].
-      resource_init(file);
+  surf_workstation_model_description[workstation_id].
+      model_init(file);
 
   _simix_init_status = 2;      /* inited; don't change settings now */
 
index 9752664..046f275 100644 (file)
@@ -346,15 +346,15 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
 
   {
     surf_action_t action = NULL;
-    surf_resource_t resource = NULL;
+    surf_model_t model = NULL;
     smx_action_t smx_action = NULL;
 
     void *fun = NULL;
     void *arg = NULL;
 
-    xbt_dynar_foreach(resource_list, i, resource) {
-      if (xbt_swag_size(resource->common_public->states.failed_action_set)
-         || xbt_swag_size(resource->common_public->states.
+    xbt_dynar_foreach(model_list, i, model) {
+      if (xbt_swag_size(model->common_public->states.failed_action_set)
+         || xbt_swag_size(model->common_public->states.
                           done_action_set)) {
        state_modifications = 1;
       }
@@ -366,7 +366,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
       DEBUG1("Elapsed_time %f", elapsed_time);
     }
 
-    while (surf_timer_resource->extension_public->get(&fun, (void *) &arg)) {
+    while (surf_timer_model->extension_public->get(&fun, (void *) &arg)) {
       DEBUG2("got %p %p", fun, arg);
       if (fun == SIMIX_process_create) {
        smx_process_arg_t args = arg;
@@ -375,7 +375,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
                                       args->data, args->hostname,
                                       args->argc, args->argv);
        if (args->kill_time > SIMIX_get_clock()) {
-         surf_timer_resource->extension_public->set(args->kill_time,
+         surf_timer_model->extension_public->set(args->kill_time,
                                                     (void *)
                                                     &SIMIX_process_kill,
                                                     (void *) process);
@@ -391,9 +391,9 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
     }
 
     /* Wake up all process waiting for the action finish */
-    xbt_dynar_foreach(resource_list, i, resource) {
+    xbt_dynar_foreach(model_list, i, model) {
       while ((action =
-             xbt_swag_extract(resource->common_public->states.
+             xbt_swag_extract(model->common_public->states.
                               failed_action_set))) {
        smx_action = action->data;
        if (smx_action) {
@@ -401,7 +401,7 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
        }
       }
       while ((action =
-             xbt_swag_extract(resource->common_public->states.
+             xbt_swag_extract(model->common_public->states.
                               done_action_set))) {
        smx_action = action->data;
        if (smx_action) {
@@ -440,12 +440,12 @@ double SIMIX_solve(xbt_fifo_t actions_done, xbt_fifo_t actions_failed)
  */
 void SIMIX_timer_set(double date, void *function, void *arg)
 {
-  surf_timer_resource->extension_public->set(date, function, arg);
+  surf_timer_model->extension_public->set(date, function, arg);
 }
 
 int SIMIX_timer_get(void **function, void **arg)
 {
-  return surf_timer_resource->extension_public->get(function, arg);
+  return surf_timer_model->extension_public->get(function, arg);
 }
 
 /**
index 7367c49..c532b2a 100644 (file)
@@ -169,7 +169,7 @@ double SIMIX_host_get_speed(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
-  return (surf_workstation_resource->
+  return (surf_workstation_model->
          extension_public->get_speed(host->simdata->host, 1.0));
 }
 
@@ -183,7 +183,7 @@ double SIMIX_host_get_available_speed(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
-  return (surf_workstation_resource->
+  return (surf_workstation_model->
          extension_public->get_available_speed(host->simdata->host));
 }
 
@@ -221,7 +221,7 @@ int SIMIX_host_get_state(smx_host_t host)
 {
   xbt_assert0((host != NULL), "Invalid parameters");
 
-  return (surf_workstation_resource->
+  return (surf_workstation_model->
          extension_public->get_state(host->simdata->host));
 
 }
index ea86881..f8d8337 100644 (file)
@@ -292,7 +292,7 @@ void SIMIX_process_suspend(smx_process_t process)
       simdata->suspended = 1;
       c = simdata->cond;
       xbt_fifo_foreach(c->actions, i, act, smx_action_t) {
-       surf_workstation_resource->common_public->suspend(act->simdata->
+       surf_workstation_model->common_public->suspend(act->simdata->
                                                          surf_action);
       }
     } else {
@@ -307,7 +307,7 @@ void SIMIX_process_suspend(smx_process_t process)
 
     cond = SIMIX_cond_init();
     dummy = SIMIX_action_execute(SIMIX_process_get_host(process), name, 0);
-    surf_workstation_resource->common_public->set_priority(dummy->simdata->
+    surf_workstation_model->common_public->set_priority(dummy->simdata->
                                                           surf_action,
                                                           0.0);
     SIMIX_register_action_to_condition(dummy, cond);
@@ -350,7 +350,7 @@ void SIMIX_process_resume(smx_process_t process)
     simdata->suspended = 0;
     c = simdata->cond;
     xbt_fifo_foreach(c->actions, i, act, smx_action_t) {
-      surf_workstation_resource->common_public->resume(act->simdata->
+      surf_workstation_model->common_public->resume(act->simdata->
                                                       surf_action);
     }
     return;
index fd68353..f0948eb 100644 (file)
@@ -10,7 +10,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf,
                                "Logging specific to the SURF CPU module");
 
-surf_cpu_resource_t surf_cpu_resource = NULL;
+surf_cpu_model_t surf_cpu_model = NULL;
 lmm_system_t cpu_maxmin_system = NULL;
 
 xbt_dict_t cpu_set = NULL;
@@ -29,7 +29,7 @@ static cpu_Cas01_t cpu_new(char *name, double power_scale,
 {
   cpu_Cas01_t cpu = xbt_new0(s_cpu_Cas01_t, 1);
 
-  cpu->resource = (surf_resource_t) surf_cpu_resource;
+  cpu->model = (surf_model_t) surf_cpu_model;
   cpu->name = name;
   cpu->power_scale = power_scale;
   xbt_assert0(cpu->power_scale > 0, "Power has to be >0");
@@ -93,15 +93,15 @@ static void *name_service(const char *name)
   return xbt_dict_get_or_null(cpu_set, name);
 }
 
-static const char *get_resource_name(void *resource_id)
+static const char *get_model_name(void *model_id)
 {
-  return ((cpu_Cas01_t) resource_id)->name;
+  return ((cpu_Cas01_t) model_id)->name;
 }
 
-static int resource_used(void *resource_id)
+static int model_used(void *model_id)
 {
   return lmm_constraint_used(cpu_maxmin_system,
-                            ((cpu_Cas01_t) resource_id)->constraint);
+                            ((cpu_Cas01_t) model_id)->constraint);
 }
 
 static int action_free(surf_action_t action)
@@ -147,10 +147,10 @@ static void action_change_state(surf_action_t action,
   return;
 }
 
-static double share_resources(double now)
+static double share_models(double now)
 {
   s_surf_action_cpu_Cas01_t action;
-  return generic_maxmin_share_resources2(surf_cpu_resource->common_public->
+  return generic_maxmin_share_models2(surf_cpu_model->common_public->
                                         states.running_action_set,
                                         xbt_swag_offset(action, variable),
                                         cpu_maxmin_system, lmm_solve);
@@ -161,10 +161,10 @@ static void update_actions_state(double now, double delta)
   surf_action_cpu_Cas01_t action = NULL;
   surf_action_cpu_Cas01_t next_action = NULL;
   xbt_swag_t running_actions =
-      surf_cpu_resource->common_public->states.running_action_set;
+      surf_cpu_model->common_public->states.running_action_set;
   /* FIXME: UNUSED
      xbt_swag_t failed_actions =
-     surf_cpu_resource->common_public->states.failed_action_set;
+     surf_cpu_model->common_public->states.failed_action_set;
    */
 
   xbt_swag_foreach_safe(action, next_action, running_actions) {
@@ -180,7 +180,7 @@ static void update_actions_state(double now, double delta)
               (action->generic_action.max_duration <= 0)) {
       action->generic_action.finish = surf_get_clock();
       action_change_state((surf_action_t) action, SURF_ACTION_DONE);
-    } else {                   /* Need to check that none of the resource has failed */
+    } else {                   /* Need to check that none of the model has failed */
       lmm_constraint_t cnst = NULL;
       int i = 0;
       cpu_Cas01_t cpu = NULL;
@@ -201,7 +201,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
-static void update_resource_state(void *id,
+static void update_model_state(void *id,
                                  tmgr_trace_event_t event_type,
                                  double value)
 {
@@ -239,17 +239,17 @@ static surf_action_t execute(void *cpu, double size)
   action->generic_action.max_duration = NO_MAX_DURATION;
   action->generic_action.start = surf_get_clock();
   action->generic_action.finish = -1.0;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_cpu_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_cpu_model;
   action->suspended = 0;       /* Should be useless because of the 
                                   calloc but it seems to help valgrind... */
 
   if (CPU->state_current == SURF_CPU_ON)
     action->generic_action.state_set =
-       surf_cpu_resource->common_public->states.running_action_set;
+       surf_cpu_model->common_public->states.running_action_set;
   else
     action->generic_action.state_set =
-       surf_cpu_resource->common_public->states.failed_action_set;
+       surf_cpu_model->common_public->states.failed_action_set;
   xbt_swag_insert(action, action->generic_action.state_set);
 
   action->variable = lmm_variable_new(cpu_maxmin_system, action,
@@ -335,79 +335,79 @@ static double get_available_speed(void *cpu)
 static void finalize(void)
 {
   xbt_dict_free(&cpu_set);
-  xbt_swag_free(surf_cpu_resource->common_public->states.ready_action_set);
-  xbt_swag_free(surf_cpu_resource->common_public->states.
+  xbt_swag_free(surf_cpu_model->common_public->states.ready_action_set);
+  xbt_swag_free(surf_cpu_model->common_public->states.
                running_action_set);
-  xbt_swag_free(surf_cpu_resource->common_public->states.
+  xbt_swag_free(surf_cpu_model->common_public->states.
                failed_action_set);
-  xbt_swag_free(surf_cpu_resource->common_public->states.done_action_set);
-  free(surf_cpu_resource->common_public);
-  free(surf_cpu_resource->common_private);
-  free(surf_cpu_resource->extension_public);
+  xbt_swag_free(surf_cpu_model->common_public->states.done_action_set);
+  free(surf_cpu_model->common_public);
+  free(surf_cpu_model->common_private);
+  free(surf_cpu_model->extension_public);
 
-  free(surf_cpu_resource);
-  surf_cpu_resource = NULL;
+  free(surf_cpu_model);
+  surf_cpu_model = NULL;
 }
 
-static void surf_cpu_resource_init_internal(void)
+static void surf_cpu_model_init_internal(void)
 {
   s_surf_action_t action;
 
-  surf_cpu_resource = xbt_new0(s_surf_cpu_resource_t, 1);
+  surf_cpu_model = xbt_new0(s_surf_cpu_model_t, 1);
 
-  surf_cpu_resource->common_private =
-      xbt_new0(s_surf_resource_private_t, 1);
-  surf_cpu_resource->common_public = xbt_new0(s_surf_resource_public_t, 1);
+  surf_cpu_model->common_private =
+      xbt_new0(s_surf_model_private_t, 1);
+  surf_cpu_model->common_public = xbt_new0(s_surf_model_public_t, 1);
 
-  surf_cpu_resource->extension_public =
-      xbt_new0(s_surf_cpu_resource_extension_public_t, 1);
+  surf_cpu_model->extension_public =
+      xbt_new0(s_surf_cpu_model_extension_public_t, 1);
 
-  surf_cpu_resource->common_public->states.ready_action_set =
+  surf_cpu_model->common_public->states.ready_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_cpu_resource->common_public->states.running_action_set =
+  surf_cpu_model->common_public->states.running_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_cpu_resource->common_public->states.failed_action_set =
+  surf_cpu_model->common_public->states.failed_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_cpu_resource->common_public->states.done_action_set =
+  surf_cpu_model->common_public->states.done_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  surf_cpu_resource->common_public->name_service = name_service;
-  surf_cpu_resource->common_public->get_resource_name = get_resource_name;
-  surf_cpu_resource->common_public->action_get_state =
+  surf_cpu_model->common_public->name_service = name_service;
+  surf_cpu_model->common_public->get_model_name = get_model_name;
+  surf_cpu_model->common_public->action_get_state =
       surf_action_get_state;
-  surf_cpu_resource->common_public->action_get_start_time =
+  surf_cpu_model->common_public->action_get_start_time =
       surf_action_get_start_time;
-  surf_cpu_resource->common_public->action_get_finish_time =
+  surf_cpu_model->common_public->action_get_finish_time =
       surf_action_get_finish_time;
-  surf_cpu_resource->common_public->action_free = action_free;
-  surf_cpu_resource->common_public->action_use = action_use;
-  surf_cpu_resource->common_public->action_cancel = action_cancel;
-  surf_cpu_resource->common_public->action_recycle = action_recycle;
-  surf_cpu_resource->common_public->action_change_state =
+  surf_cpu_model->common_public->action_free = action_free;
+  surf_cpu_model->common_public->action_use = action_use;
+  surf_cpu_model->common_public->action_cancel = action_cancel;
+  surf_cpu_model->common_public->action_recycle = action_recycle;
+  surf_cpu_model->common_public->action_change_state =
       action_change_state;
-  surf_cpu_resource->common_public->action_set_data = surf_action_set_data;
-  surf_cpu_resource->common_public->name = "CPU";
+  surf_cpu_model->common_public->action_set_data = surf_action_set_data;
+  surf_cpu_model->common_public->name = "CPU";
 
-  surf_cpu_resource->common_private->resource_used = resource_used;
-  surf_cpu_resource->common_private->share_resources = share_resources;
-  surf_cpu_resource->common_private->update_actions_state =
+  surf_cpu_model->common_private->model_used = model_used;
+  surf_cpu_model->common_private->share_models = share_models;
+  surf_cpu_model->common_private->update_actions_state =
       update_actions_state;
-  surf_cpu_resource->common_private->update_resource_state =
-      update_resource_state;
-  surf_cpu_resource->common_private->finalize = finalize;
-
-  surf_cpu_resource->common_public->suspend = action_suspend;
-  surf_cpu_resource->common_public->resume = action_resume;
-  surf_cpu_resource->common_public->is_suspended = action_is_suspended;
-  surf_cpu_resource->common_public->set_max_duration =
+  surf_cpu_model->common_private->update_model_state =
+      update_model_state;
+  surf_cpu_model->common_private->finalize = finalize;
+
+  surf_cpu_model->common_public->suspend = action_suspend;
+  surf_cpu_model->common_public->resume = action_resume;
+  surf_cpu_model->common_public->is_suspended = action_is_suspended;
+  surf_cpu_model->common_public->set_max_duration =
       action_set_max_duration;
-  surf_cpu_resource->common_public->set_priority = action_set_priority;
-  surf_cpu_resource->extension_public->execute = execute;
-  surf_cpu_resource->extension_public->sleep = action_sleep;
+  surf_cpu_model->common_public->set_priority = action_set_priority;
+  surf_cpu_model->extension_public->execute = execute;
+  surf_cpu_model->extension_public->sleep = action_sleep;
 
-  surf_cpu_resource->extension_public->get_state = get_state;
-  surf_cpu_resource->extension_public->get_speed = get_speed;
-  surf_cpu_resource->extension_public->get_available_speed =
+  surf_cpu_model->extension_public->get_state = get_state;
+  surf_cpu_model->extension_public->get_speed = get_speed;
+  surf_cpu_model->extension_public->get_available_speed =
       get_available_speed;
 
   cpu_set = xbt_dict_new();
@@ -431,11 +431,11 @@ static void surf_cpu_resource_init_internal(void)
 /*   note =         "Available at */
 /*                  \url{http://grail.sdsc.edu/papers/simgrid_ccgrid01.ps.gz}." */
 /* } */
-void surf_cpu_resource_init_Cas01(const char *filename)
+void surf_cpu_model_init_Cas01(const char *filename)
 {
-  if (surf_cpu_resource)
+  if (surf_cpu_model)
     return;
-  surf_cpu_resource_init_internal();
+  surf_cpu_model_init_internal();
   parse_file(filename);
-  xbt_dynar_push(resource_list, &surf_cpu_resource);
+  xbt_dynar_push(model_list, &surf_cpu_model);
 }
index 7f93e30..d203c15 100644 (file)
@@ -18,7 +18,7 @@ typedef struct surf_action_cpu_Cas01 {
 } s_surf_action_cpu_Cas01_t, *surf_action_cpu_Cas01_t;
 
 typedef struct cpu_Cas01 {
-  surf_resource_t resource;    /* Any such object, added in a trace
+  surf_model_t model;  /* Any such object, added in a trace
                                   should start by this field!!! */
   char *name;
   double power_scale;
index b2bba76..b09769e 100644 (file)
@@ -11,7 +11,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
                                "Logging specific to the SURF network module");
 
-surf_network_resource_t surf_network_resource = NULL;
+surf_network_model_t surf_network_model = NULL;
 static lmm_system_t network_maxmin_system = NULL;
 static void (*network_solve) (lmm_system_t) = NULL;
 
@@ -50,7 +50,7 @@ static network_link_CM02_t network_link_new(char *name,
   network_link_CM02_t nw_link = xbt_new0(s_network_link_CM02_t, 1);
 
 
-  nw_link->resource = (surf_resource_t) surf_network_resource;
+  nw_link->model = (surf_model_t) surf_network_model;
   nw_link->name = name;
   nw_link->bw_current = bw_initial;
   if (bw_trace)
@@ -229,15 +229,15 @@ static void *name_service(const char *name)
   return card;
 }
 
-static const char *get_resource_name(void *resource_id)
+static const char *get_model_name(void *model_id)
 {
-  return ((network_card_CM02_t) resource_id)->name;
+  return ((network_card_CM02_t) model_id)->name;
 }
 
-static int resource_used(void *resource_id)
+static int model_used(void *model_id)
 {
   return lmm_constraint_used(network_maxmin_system,
-                            ((network_link_CM02_t) resource_id)->
+                            ((network_link_CM02_t) model_id)->
                             constraint);
 }
 
@@ -283,15 +283,15 @@ static void action_change_state(surf_action_t action,
   return;
 }
 
-static double share_resources(double now)
+static double share_models(double now)
 {
   s_surf_action_network_CM02_t s_action;
   surf_action_network_CM02_t action = NULL;
   xbt_swag_t running_actions =
-      surf_network_resource->common_public->states.running_action_set;
+      surf_network_model->common_public->states.running_action_set;
   double min;
 
-  min = generic_maxmin_share_resources2(running_actions,
+  min = generic_maxmin_share_models2(running_actions,
                                        xbt_swag_offset(s_action,
                                                        variable),
                                        network_maxmin_system,
@@ -315,10 +315,10 @@ static void update_actions_state(double now, double delta)
   surf_action_network_CM02_t action = NULL;
   surf_action_network_CM02_t next_action = NULL;
   xbt_swag_t running_actions =
-      surf_network_resource->common_public->states.running_action_set;
+      surf_network_model->common_public->states.running_action_set;
   /*
      xbt_swag_t failed_actions =
-     surf_network_resource->common_public->states.failed_action_set;
+     surf_network_model->common_public->states.failed_action_set;
    */
 
   xbt_swag_foreach_safe(action, next_action, running_actions) {
@@ -350,7 +350,7 @@ static void update_actions_state(double now, double delta)
               (action->generic_action.max_duration <= 0)) {
       action->generic_action.finish = surf_get_clock();
       action_change_state((surf_action_t) action, SURF_ACTION_DONE);
-    } else {                   /* Need to check that none of the resource has failed */
+    } else {                   /* Need to check that none of the model has failed */
       lmm_constraint_t cnst = NULL;
       int i = 0;
       network_link_CM02_t nw_link = NULL;
@@ -371,7 +371,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
-static void update_resource_state(void *id,
+static void update_model_state(void *id,
                                  tmgr_trace_event_t event_type,
                                  double value)
 {
@@ -447,12 +447,12 @@ static surf_action_t communicate(void *src, void *dst, double size,
   action->generic_action.max_duration = NO_MAX_DURATION;
   action->generic_action.start = surf_get_clock();
   action->generic_action.finish = -1.0;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_network_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_network_model;
   action->suspended = 0;       /* Should be useless because of the 
                                   calloc but it seems to help valgrind... */
   action->generic_action.state_set =
-      surf_network_resource->common_public->states.running_action_set;
+      surf_network_model->common_public->states.running_action_set;
 
   xbt_swag_insert(action, action->generic_action.state_set);
   action->rate = rate;
@@ -567,20 +567,20 @@ static void finalize(void)
 
   xbt_dict_free(&network_card_set);
   xbt_dict_free(&network_link_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                ready_action_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                running_action_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                failed_action_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                done_action_set);
-  free(surf_network_resource->common_public);
-  free(surf_network_resource->common_private);
-  free(surf_network_resource->extension_public);
+  free(surf_network_model->common_public);
+  free(surf_network_model->common_private);
+  free(surf_network_model->extension_public);
 
-  free(surf_network_resource);
-  surf_network_resource = NULL;
+  free(surf_network_model);
+  surf_network_model = NULL;
 
   loopback = NULL;
   for (i = 0; i < card_number; i++)
@@ -593,68 +593,68 @@ static void finalize(void)
   card_number = 0;
 }
 
-static void surf_network_resource_init_internal(void)
+static void surf_network_model_init_internal(void)
 {
   s_surf_action_t action;
 
-  surf_network_resource = xbt_new0(s_surf_network_resource_t, 1);
+  surf_network_model = xbt_new0(s_surf_network_model_t, 1);
 
-  surf_network_resource->common_private =
-      xbt_new0(s_surf_resource_private_t, 1);
-  surf_network_resource->common_public =
-      xbt_new0(s_surf_resource_public_t, 1);
-  surf_network_resource->extension_public =
-      xbt_new0(s_surf_network_resource_extension_public_t, 1);
+  surf_network_model->common_private =
+      xbt_new0(s_surf_model_private_t, 1);
+  surf_network_model->common_public =
+      xbt_new0(s_surf_model_public_t, 1);
+  surf_network_model->extension_public =
+      xbt_new0(s_surf_network_model_extension_public_t, 1);
 
-  surf_network_resource->common_public->states.ready_action_set =
+  surf_network_model->common_public->states.ready_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_network_resource->common_public->states.running_action_set =
+  surf_network_model->common_public->states.running_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_network_resource->common_public->states.failed_action_set =
+  surf_network_model->common_public->states.failed_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_network_resource->common_public->states.done_action_set =
+  surf_network_model->common_public->states.done_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  surf_network_resource->common_public->name_service = name_service;
-  surf_network_resource->common_public->get_resource_name =
-      get_resource_name;
-  surf_network_resource->common_public->action_get_state =
+  surf_network_model->common_public->name_service = name_service;
+  surf_network_model->common_public->get_model_name =
+      get_model_name;
+  surf_network_model->common_public->action_get_state =
       surf_action_get_state;
-  surf_network_resource->common_public->action_get_start_time =
+  surf_network_model->common_public->action_get_start_time =
       surf_action_get_start_time;
-  surf_network_resource->common_public->action_get_finish_time =
+  surf_network_model->common_public->action_get_finish_time =
       surf_action_get_finish_time;
-  surf_network_resource->common_public->action_free = action_free;
-  surf_network_resource->common_public->action_use = action_use;
-  surf_network_resource->common_public->action_cancel = action_cancel;
-  surf_network_resource->common_public->action_recycle = action_recycle;
-  surf_network_resource->common_public->action_change_state =
+  surf_network_model->common_public->action_free = action_free;
+  surf_network_model->common_public->action_use = action_use;
+  surf_network_model->common_public->action_cancel = action_cancel;
+  surf_network_model->common_public->action_recycle = action_recycle;
+  surf_network_model->common_public->action_change_state =
       action_change_state;
-  surf_network_resource->common_public->action_set_data =
+  surf_network_model->common_public->action_set_data =
       surf_action_set_data;
-  surf_network_resource->common_public->name = "network";
+  surf_network_model->common_public->name = "network";
 
-  surf_network_resource->common_private->resource_used = resource_used;
-  surf_network_resource->common_private->share_resources = share_resources;
-  surf_network_resource->common_private->update_actions_state =
+  surf_network_model->common_private->model_used = model_used;
+  surf_network_model->common_private->share_models = share_models;
+  surf_network_model->common_private->update_actions_state =
       update_actions_state;
-  surf_network_resource->common_private->update_resource_state =
-      update_resource_state;
-  surf_network_resource->common_private->finalize = finalize;
-
-  surf_network_resource->common_public->suspend = action_suspend;
-  surf_network_resource->common_public->resume = action_resume;
-  surf_network_resource->common_public->is_suspended = action_is_suspended;
-  surf_cpu_resource->common_public->set_max_duration =
+  surf_network_model->common_private->update_model_state =
+      update_model_state;
+  surf_network_model->common_private->finalize = finalize;
+
+  surf_network_model->common_public->suspend = action_suspend;
+  surf_network_model->common_public->resume = action_resume;
+  surf_network_model->common_public->is_suspended = action_is_suspended;
+  surf_cpu_model->common_public->set_max_duration =
       action_set_max_duration;
 
-  surf_network_resource->extension_public->communicate = communicate;
-  surf_network_resource->extension_public->get_route = get_route;
-  surf_network_resource->extension_public->get_route_size = get_route_size;
-  surf_network_resource->extension_public->get_link_name = get_link_name;
-  surf_network_resource->extension_public->get_link_bandwidth =
+  surf_network_model->extension_public->communicate = communicate;
+  surf_network_model->extension_public->get_route = get_route;
+  surf_network_model->extension_public->get_route_size = get_route_size;
+  surf_network_model->extension_public->get_link_name = get_link_name;
+  surf_network_model->extension_public->get_link_bandwidth =
       get_link_bandwidth;
-  surf_network_resource->extension_public->get_link_latency =
+  surf_network_model->extension_public->get_link_latency =
       get_link_latency;
 
   network_link_set = xbt_dict_new();
@@ -675,72 +675,72 @@ static void surf_network_resource_init_internal(void)
 /*   month         = {oct}, */
 /*   year          = {2002} */
 /* } */
-void surf_network_resource_init_CM02(const char *filename)
+void surf_network_model_init_CM02(const char *filename)
 {
 
-  if (surf_network_resource)
+  if (surf_network_model)
     return;
-  surf_network_resource_init_internal();
+  surf_network_model_init_internal();
   parse_file(filename);
-  xbt_dynar_push(resource_list, &surf_network_resource);
+  xbt_dynar_push(model_list, &surf_network_model);
   network_solve = lmm_solve;
 
-  update_resource_description(surf_network_resource_description,
-                             surf_network_resource_description_size,
+  update_model_description(surf_network_model_description,
+                             surf_network_model_description_size,
                              "CM02",
-                             (surf_resource_t) surf_network_resource);
+                             (surf_model_t) surf_network_model);
 }
 
-void surf_network_resource_init_Reno(const char *filename)
+void surf_network_model_init_Reno(const char *filename)
 {
-  if (surf_network_resource)
+  if (surf_network_model)
     return;
-  surf_network_resource_init_internal();
+  surf_network_model_init_internal();
   parse_file(filename);
 
-  xbt_dynar_push(resource_list, &surf_network_resource);
+  xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
                                    func_reno_fpi);
   network_solve = lagrange_solve;
 
-  update_resource_description(surf_network_resource_description,
-                             surf_network_resource_description_size,
+  update_model_description(surf_network_model_description,
+                             surf_network_model_description_size,
                              "Reno",
-                             (surf_resource_t) surf_network_resource);
+                             (surf_model_t) surf_network_model);
 }
 
-void surf_network_resource_init_Vegas(const char *filename)
+void surf_network_model_init_Vegas(const char *filename)
 {
-  if (surf_network_resource)
+  if (surf_network_model)
     return;
-  surf_network_resource_init_internal();
+  surf_network_model_init_internal();
   parse_file(filename);
 
-  xbt_dynar_push(resource_list, &surf_network_resource);
+  xbt_dynar_push(model_list, &surf_network_model);
   lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
                                    func_vegas_fpi);
   network_solve = lagrange_solve;
 
-  update_resource_description(surf_network_resource_description,
-                             surf_network_resource_description_size,
+  update_model_description(surf_network_model_description,
+                             surf_network_model_description_size,
                              "Vegas",
-                             (surf_resource_t) surf_network_resource);
+                             (surf_model_t) surf_network_model);
 }
 
 #ifdef HAVE_SDP
-void surf_network_resource_init_SDP(const char *filename)
+void surf_network_model_init_SDP(const char *filename)
 {
-  if (surf_network_resource)
+  if (surf_network_model)
     return;
-  surf_network_resource_init_internal();
+  surf_network_model_init_internal();
   parse_file(filename);
 
-  xbt_dynar_push(resource_list, &surf_network_resource);
+  xbt_dynar_push(model_list, &surf_network_model);
   network_solve = sdp_solve;
 
-  update_resource_description(surf_network_resource_description,
-                             surf_network_resource_description_size,
+  update_model_description(surf_network_model_description,
+                             surf_network_model_description_size,
                              "SDP",
-                             (surf_resource_t) surf_network_resource);
+                             (surf_model_t) surf_network_model);
 }
 #endif
index 3b36227..c0c0eb0 100644 (file)
@@ -11,7 +11,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets, surf,
                                "Logging specific to the SURF network module");
 
-/* surf_network_resource_t surf_network_resource = NULL; */
+/* surf_network_model_t surf_network_model = NULL; */
 /*static xbt_dict_t network_link_set = NULL;*/
 
 /* xbt_dict_t network_card_set = NULL; */
@@ -26,11 +26,11 @@ static int *routing_table_size = NULL;
 #endif
 
 /** QUESTIONS for GTNetS integration
- **   1. Check that we did the right thing with name_service and get_resource_name
+ **   1. Check that we did the right thing with name_service and get_model_name
  **   2. Right now there is no "kill flow" in our GTNetS implementation. Do we
  **      need to do something about this?
  **   3. We ignore the fact there is some max_duration on flows (see #2 above)
- **   4. share_resources() returns a duration, not a date, right?
+ **   4. share_models() returns a duration, not a date, right?
  **   5. We don't suppoer "rates"
  **   6. We don't update "remaining" for ongoing flows. Is it bad?
  **/
@@ -60,7 +60,7 @@ static void network_link_new(char *name, double bw, double lat)
   link_count++;
 
 /*
-  nw_link->resource = (surf_resource_t) surf_network_resource;
+  nw_link->model = (surf_model_t) surf_network_model;
   nw_link->name = name;
   nw_link->bw_current = bw_initial;
   if (bw_trace)
@@ -317,13 +317,13 @@ static void *name_service(const char *name)
   return xbt_dict_get_or_null(network_card_set, name);
 }
 
-static const char *get_resource_name(void *resource_id)
+static const char *get_model_name(void *model_id)
 {
-  return ((network_card_GTNETS_t) resource_id)->name;
+  return ((network_card_GTNETS_t) model_id)->name;
 }
 
 /* We do not care about this: only used for traces */
-static int resource_used(void *resource_id)
+static int model_used(void *model_id)
 {
   return 0;                    /* We don't care */
 }
@@ -371,14 +371,14 @@ static void action_change_state(surf_action_t action,
 }
 
 
-/* share_resources() */
-static double share_resources(double now)
+/* share_models() */
+static double share_models(double now)
 {
 #if 0
   s_surf_action_network_GTNETS_t s_action;
   surf_action_network_GTNETS_t action = NULL;
   xbt_swag_t running_actions =
-      surf_network_resource->common_public->states.running_action_set;
+      surf_network_model->common_public->states.running_action_set;
 #endif
 
   return gtnets_get_time_to_next_flow_completion();
@@ -397,7 +397,7 @@ static void update_actions_state(double now, double delta)
   surf_action_network_GTNETS_t action = NULL;
   surf_action_network_GTNETS_t next_action = NULL;
   xbt_swag_t running_actions =
-      surf_network_resource->common_public->states.running_action_set;
+      surf_network_model->common_public->states.running_action_set;
 #endif
 
   double time_to_next_flow_completion =
@@ -443,11 +443,11 @@ static void update_actions_state(double now, double delta)
 }
 
 /* UNUSED HERE: no traces */
-static void update_resource_state(void *id,
+static void update_model_state(void *id,
                                  tmgr_trace_event_t event_type,
                                  double value)
 {
-  xbt_assert0(0, "Cannot update resource state for GTNetS simulation");
+  xbt_assert0(0, "Cannot update model state for GTNetS simulation");
   return;
 }
 
@@ -476,11 +476,11 @@ static surf_action_t communicate(void *src, void *dst, double size,
   action->generic_action.max_duration = NO_MAX_DURATION;
   action->generic_action.start = surf_get_clock();
   action->generic_action.finish = -1.0;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_network_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_network_model;
 
   action->generic_action.state_set =
-      surf_network_resource->common_public->states.running_action_set;
+      surf_network_model->common_public->states.running_action_set;
 
   xbt_swag_insert(action, action->generic_action.state_set);
 
@@ -521,20 +521,20 @@ static void finalize(void)
 #endif
   xbt_dict_free(&network_card_set);
   xbt_dict_free(&network_link_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                ready_action_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                running_action_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                failed_action_set);
-  xbt_swag_free(surf_network_resource->common_public->states.
+  xbt_swag_free(surf_network_model->common_public->states.
                done_action_set);
-  free(surf_network_resource->common_public);
-  free(surf_network_resource->common_private);
-  free(surf_network_resource->extension_public);
+  free(surf_network_model->common_public);
+  free(surf_network_model->common_private);
+  free(surf_network_model->extension_public);
 
-  free(surf_network_resource);
-  surf_network_resource = NULL;
+  free(surf_network_model);
+  surf_network_model = NULL;
 
 #if 0
   for (i = 0; i < card_number; i++)
@@ -552,56 +552,56 @@ static void finalize(void)
   /* END ADDITION */
 }
 
-static void surf_network_resource_init_internal(void)
+static void surf_network_model_init_internal(void)
 {
   s_surf_action_t action;
 
-  surf_network_resource = xbt_new0(s_surf_network_resource_t, 1);
+  surf_network_model = xbt_new0(s_surf_network_model_t, 1);
 
-  surf_network_resource->common_private =
-      xbt_new0(s_surf_resource_private_t, 1);
-  surf_network_resource->common_public =
-      xbt_new0(s_surf_resource_public_t, 1);
-  surf_network_resource->extension_public =
-      xbt_new0(s_surf_network_resource_extension_public_t, 1);
+  surf_network_model->common_private =
+      xbt_new0(s_surf_model_private_t, 1);
+  surf_network_model->common_public =
+      xbt_new0(s_surf_model_public_t, 1);
+  surf_network_model->extension_public =
+      xbt_new0(s_surf_network_model_extension_public_t, 1);
 
-  surf_network_resource->common_public->states.ready_action_set =
+  surf_network_model->common_public->states.ready_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_network_resource->common_public->states.running_action_set =
+  surf_network_model->common_public->states.running_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_network_resource->common_public->states.failed_action_set =
+  surf_network_model->common_public->states.failed_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_network_resource->common_public->states.done_action_set =
+  surf_network_model->common_public->states.done_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  surf_network_resource->common_public->name_service = name_service;
-  surf_network_resource->common_public->get_resource_name =
-      get_resource_name;
-  surf_network_resource->common_public->action_get_state =
+  surf_network_model->common_public->name_service = name_service;
+  surf_network_model->common_public->get_model_name =
+      get_model_name;
+  surf_network_model->common_public->action_get_state =
       surf_action_get_state;
-  surf_network_resource->common_public->action_use = action_use;
-  surf_network_resource->common_public->action_free = action_free;
-  surf_network_resource->common_public->action_cancel = action_cancel;
-  surf_network_resource->common_public->action_recycle = action_recycle;
-  surf_network_resource->common_public->action_change_state =
+  surf_network_model->common_public->action_use = action_use;
+  surf_network_model->common_public->action_free = action_free;
+  surf_network_model->common_public->action_cancel = action_cancel;
+  surf_network_model->common_public->action_recycle = action_recycle;
+  surf_network_model->common_public->action_change_state =
       action_change_state;
-  surf_network_resource->common_public->action_set_data =
+  surf_network_model->common_public->action_set_data =
       surf_action_set_data;
-  surf_network_resource->common_public->name = "network";
+  surf_network_model->common_public->name = "network";
 
-  surf_network_resource->common_private->resource_used = resource_used;
-  surf_network_resource->common_private->share_resources = share_resources;
-  surf_network_resource->common_private->update_actions_state =
+  surf_network_model->common_private->model_used = model_used;
+  surf_network_model->common_private->share_models = share_models;
+  surf_network_model->common_private->update_actions_state =
       update_actions_state;
-  surf_network_resource->common_private->update_resource_state =
-      update_resource_state;
-  surf_network_resource->common_private->finalize = finalize;
+  surf_network_model->common_private->update_model_state =
+      update_model_state;
+  surf_network_model->common_private->finalize = finalize;
 
-  surf_network_resource->common_public->suspend = action_suspend;
-  surf_network_resource->common_public->resume = action_resume;
-  surf_network_resource->common_public->is_suspended = action_is_suspended;
+  surf_network_model->common_public->suspend = action_suspend;
+  surf_network_model->common_public->resume = action_resume;
+  surf_network_model->common_public->is_suspended = action_is_suspended;
 
-  surf_network_resource->extension_public->communicate = communicate;
+  surf_network_model->extension_public->communicate = communicate;
 
   network_link_set = xbt_dict_new();
   network_card_set = xbt_dict_new();
@@ -615,16 +615,16 @@ static void surf_network_resource_init_internal(void)
   }
 }
 
-void surf_network_resource_init_GTNETS(const char *filename)
+void surf_network_model_init_GTNETS(const char *filename)
 {
-  if (surf_network_resource)
+  if (surf_network_model)
     return;
-  surf_network_resource_init_internal();
+  surf_network_model_init_internal();
   parse_file(filename);
-  xbt_dynar_push(resource_list, &surf_network_resource);
+  xbt_dynar_push(model_list, &surf_network_model);
 
-  update_resource_description(surf_network_resource_description,
-                             surf_network_resource_description_size,
+  update_model_description(surf_network_model_description,
+                             surf_network_model_description_size,
                              "GTNets",
-                             (surf_resource_t) surf_network_resource);
+                             (surf_model_t) surf_network_model);
 }
index fa6bdce..e065992 100644 (file)
 #include "xbt/dict.h"
 
 typedef struct network_link_GTNETS {
-  surf_resource_t resource;    /* Any such object, added in a trace
+  surf_model_t model;  /* Any such object, added in a trace
                                   should start by this field!!! */
   /* Using this object with the public part of
-     resource does not make sense */
+     model does not make sense */
   char *name;
   double bw_current;
   double lat_current;
index 8b4ee26..0bc3f3d 100644 (file)
 #include "xbt/dict.h"
 
 typedef struct network_link_CM02 {
-  surf_resource_t resource;    /* Any such object, added in a trace
+  surf_model_t model;  /* Any such object, added in a trace
                                   should start by this field!!! */
   /* Using this object with the public part of
-     resource does not make sense */
+     model does not make sense */
   char *name;
   double bw_current;
   tmgr_trace_event_t bw_event;
index 4d65ff3..f80dadd 100644 (file)
@@ -106,13 +106,13 @@ int __surf_is_absolute_file_path(const char *file_path)
 #endif
 }
 
-typedef struct surf_resource_object {
-  surf_resource_t resource;
-} s_surf_resource_object_t, *surf_resource_object_t;
+typedef struct surf_model_object {
+  surf_model_t model;
+} s_surf_model_object_t, *surf_model_object_t;
 
 static double NOW = 0;
 
-xbt_dynar_t resource_list = NULL;
+xbt_dynar_t model_list = NULL;
 tmgr_history_t history = NULL;
 lmm_system_t maxmin_system = NULL;
 xbt_dynar_t surf_path = NULL;
@@ -125,7 +125,7 @@ const char *surf_action_state_names[6] = {
   "SURF_ACTION_NOT_IN_THE_SYSTEM"
 };
 
-int surf_network_resource_description_size = 3
+int surf_network_model_description_size = 3
 #ifdef HAVE_GTNETS
     + 1
 #endif
@@ -133,41 +133,41 @@ int surf_network_resource_description_size = 3
     + 1
 #endif
     ;
-s_surf_resource_description_t surf_network_resource_description[] = {
-  {"CM02", NULL, surf_network_resource_init_CM02},
+s_surf_model_description_t surf_network_model_description[] = {
+  {"CM02", NULL, surf_network_model_init_CM02},
 #ifdef HAVE_GTNETS
-  {"GTNets", NULL, surf_network_resource_init_GTNETS},
+  {"GTNets", NULL, surf_network_model_init_GTNETS},
 #endif
 #ifdef HAVE_SDP
-  {"SDP", NULL, surf_network_resource_init_SDP},
+  {"SDP", NULL, surf_network_model_init_SDP},
 #endif
-  {"Reno", NULL, surf_network_resource_init_Reno},
-  {"Vegas", NULL, surf_network_resource_init_Vegas}
+  {"Reno", NULL, surf_network_model_init_Reno},
+  {"Vegas", NULL, surf_network_model_init_Vegas}
 };
 
-int surf_cpu_resource_description_size = 1;
-s_surf_resource_description_t surf_cpu_resource_description[] = {
-  {"Cas01", NULL, surf_cpu_resource_init_Cas01},
+int surf_cpu_model_description_size = 1;
+s_surf_model_description_t surf_cpu_model_description[] = {
+  {"Cas01", NULL, surf_cpu_model_init_Cas01},
 };
 
-int surf_workstation_resource_description_size = 4;
-s_surf_resource_description_t surf_workstation_resource_description[] = {
-  {"CLM03", NULL, surf_workstation_resource_init_CLM03},
-  {"KCCFLN05", NULL, surf_workstation_resource_init_KCCFLN05},
-  {"compound", NULL, surf_workstation_resource_init_compound},
-  {"ptask_L07", NULL, surf_workstation_resource_init_ptask_L07}
+int surf_workstation_model_description_size = 4;
+s_surf_model_description_t surf_workstation_model_description[] = {
+  {"CLM03", NULL, surf_workstation_model_init_CLM03},
+  {"KCCFLN05", NULL, surf_workstation_model_init_KCCFLN05},
+  {"compound", NULL, surf_workstation_model_init_compound},
+  {"ptask_L07", NULL, surf_workstation_model_init_ptask_L07}
 };
 
-void update_resource_description(s_surf_resource_description_t * table,
+void update_model_description(s_surf_model_description_t * table,
                                 int table_size,
                                 const char *name,
-                                surf_resource_t resource)
+                                surf_model_t model)
 {
-  int i = find_resource_description(table, table_size, name);
-  table[i].resource = resource;
+  int i = find_model_description(table, table_size, name);
+  table[i].model = model;
 }
 
-int find_resource_description(s_surf_resource_description_t * table,
+int find_model_description(s_surf_model_description_t * table,
                              int table_size, const char *name)
 {
   int i;
@@ -189,14 +189,14 @@ int find_resource_description(s_surf_resource_description_t * table,
              name_list);
 }
 
-double generic_maxmin_share_resources(xbt_swag_t running_actions,
+double generic_maxmin_share_models(xbt_swag_t running_actions,
                                      size_t offset)
 {
-  return generic_maxmin_share_resources2(running_actions, offset,
+  return generic_maxmin_share_models2(running_actions, offset,
                                         maxmin_system, lmm_solve);
 }
 
-double generic_maxmin_share_resources2(xbt_swag_t running_actions,
+double generic_maxmin_share_models2(xbt_swag_t running_actions,
                                       size_t offset,
                                       lmm_system_t sys,
                                       void (*solve) (lmm_system_t))
@@ -259,7 +259,7 @@ double generic_maxmin_share_resources2(xbt_swag_t running_actions,
 e_surf_action_state_t surf_action_get_state(surf_action_t action)
 {
   surf_action_state_t action_state =
-      &(action->resource_type->common_public->states);
+      &(action->model_type->common_public->states);
 
   if (action->state_set == action_state->ready_action_set)
     return SURF_ACTION_READY;
@@ -284,7 +284,7 @@ double surf_action_get_finish_time(surf_action_t action)
 
 void surf_action_free(surf_action_t * action)
 {
-  (*action)->resource_type->common_public->action_cancel(*action);
+  (*action)->model_type->common_public->action_cancel(*action);
   free(*action);
   *action = NULL;
 }
@@ -293,7 +293,7 @@ void surf_action_change_state(surf_action_t action,
                              e_surf_action_state_t state)
 {
   surf_action_state_t action_state =
-      &(action->resource_type->common_public->states);
+      &(action->model_type->common_public->states);
   XBT_IN2("(%p,%s)", action, surf_action_state_names[state]);
   xbt_swag_remove(action, action->state_set);
 
@@ -352,8 +352,8 @@ void surf_init(int *argc, char **argv)
       }
     }
   }
-  if (!resource_list)
-    resource_list = xbt_dynar_new(sizeof(surf_resource_private_t), NULL);
+  if (!model_list)
+    model_list = xbt_dynar_new(sizeof(surf_model_private_t), NULL);
   if (!history)
     history = tmgr_history_new();
   if (!maxmin_system)
@@ -400,10 +400,10 @@ FILE *surf_fopen(const char *name, const char *mode)
 void surf_exit(void)
 {
   int i;
-  surf_resource_t resource = NULL;
+  surf_model_t model = NULL;
 
-  xbt_dynar_foreach(resource_list, i, resource) {
-    resource->common_private->finalize();
+  xbt_dynar_foreach(model_list, i, model) {
+    model->common_private->finalize();
   }
 
   if (maxmin_system) {
@@ -414,8 +414,8 @@ void surf_exit(void)
     tmgr_history_free(history);
     history = NULL;
   }
-  if (resource_list)
-    xbt_dynar_free(&resource_list);
+  if (model_list)
+    xbt_dynar_free(&model_list);
 
   if (surf_path)
     xbt_dynar_free(&surf_path);
@@ -435,29 +435,29 @@ double surf_solve(void)
 
   double min = -1.0;
   double next_event_date = -1.0;
-  double resource_next_action_end = -1.0;
+  double model_next_action_end = -1.0;
   double value = -1.0;
-  surf_resource_object_t resource_obj = NULL;
-  surf_resource_t resource = NULL;
+  surf_model_object_t model_obj = NULL;
+  surf_model_t model = NULL;
   tmgr_trace_event_t event = NULL;
   int i;
 
   if (first_run) {
     DEBUG0
-       ("First Run! Let's \"purge\" events and put resources in the right state");
+       ("First Run! Let's \"purge\" events and put models in the right state");
     while ((next_event_date = tmgr_history_next_date(history)) != -1.0) {
       if (next_event_date > NOW)
        break;
       while ((event =
              tmgr_history_get_next_event_leq(history, next_event_date,
                                              &value,
-                                             (void **) &resource_obj))) {
-       resource_obj->resource->common_private->
-           update_resource_state(resource_obj, event, value);
+                                             (void **) &model_obj))) {
+       model_obj->model->common_private->
+           update_model_state(model_obj, event, value);
       }
     }
-    xbt_dynar_foreach(resource_list, i, resource) {
-      resource->common_private->update_actions_state(NOW, 0.0);
+    xbt_dynar_foreach(model_list, i, model) {
+      model->common_private->update_actions_state(NOW, 0.0);
     }
     first_run = 0;
     return 0.0;
@@ -466,15 +466,15 @@ double surf_solve(void)
   min = -1.0;
 
   DEBUG0("Looking for next action end");
-  xbt_dynar_foreach(resource_list, i, resource) {
-    DEBUG1("Running for Resource [%s]", resource->common_public->name);
-    resource_next_action_end =
-       resource->common_private->share_resources(NOW);
+  xbt_dynar_foreach(model_list, i, model) {
+    DEBUG1("Running for Resource [%s]", model->common_public->name);
+    model_next_action_end =
+       model->common_private->share_models(NOW);
     DEBUG2("Resource [%s] : next action end = %f",
-          resource->common_public->name, resource_next_action_end);
-    if (((min < 0.0) || (resource_next_action_end < min))
-       && (resource_next_action_end >= 0.0))
-      min = resource_next_action_end;
+          model->common_public->name, model_next_action_end);
+    if (((min < 0.0) || (model_next_action_end < min))
+       && (model_next_action_end >= 0.0))
+      min = model_next_action_end;
   }
   DEBUG1("Next action end : %f", min);
 
@@ -486,22 +486,22 @@ double surf_solve(void)
     DEBUG1("Next event : %f", next_event_date);
     if (next_event_date > NOW + min)
       break;
-    DEBUG0("Updating resources");
+    DEBUG0("Updating models");
     while ((event =
            tmgr_history_get_next_event_leq(history, next_event_date,
                                            &value,
-                                           (void **) &resource_obj))) {
-      if (resource_obj->resource->common_private->
-         resource_used(resource_obj)) {
+                                           (void **) &model_obj))) {
+      if (model_obj->model->common_private->
+         model_used(model_obj)) {
        min = next_event_date - NOW;
        DEBUG1
-           ("This event will modify resource state. Next event set to %f",
+           ("This event will modify model state. Next event set to %f",
             min);
       }
-      /* update state of resource_obj according to new value. Does not touch lmm.
+      /* update state of model_obj according to new value. Does not touch lmm.
          It will be modified if needed when updating actions */
-      resource_obj->resource->common_private->
-         update_resource_state(resource_obj, event, value);
+      model_obj->model->common_private->
+         update_model_state(model_obj, event, value);
     }
   }
 
@@ -509,8 +509,8 @@ double surf_solve(void)
 
   NOW = NOW + min;
 
-  xbt_dynar_foreach(resource_list, i, resource) {
-    resource->common_private->update_actions_state(NOW, min);
+  xbt_dynar_foreach(model_list, i, model) {
+    model->common_private->update_actions_state(NOW, min);
   }
 
   return min;
index 88dc20a..f75a7f6 100644 (file)
@@ -29,27 +29,27 @@ typedef enum {
   SURF_NETWORK_LINK_FATPIPE = 0
 } e_surf_network_link_sharing_policy_t;
 
-typedef struct surf_resource_private {
-  int (*resource_used) (void *resource_id);
-  /* Share the resources to the actions and return in hom much time
+typedef struct surf_model_private {
+  int (*model_used) (void *model_id);
+  /* Share the models to the actions and return in hom much time
      the next action may terminate */
-  double (*share_resources) (double now);
+  double (*share_models) (double now);
   /* Update the actions' state */
   void (*update_actions_state) (double now, double delta);
-  void (*update_resource_state) (void *id, tmgr_trace_event_t event_type,
+  void (*update_model_state) (void *id, tmgr_trace_event_t event_type,
                                 double value);
   void (*finalize) (void);
-} s_surf_resource_private_t;
+} s_surf_model_private_t;
 
-/* #define pub2priv(r) ((surf_resource_private_t) ((char *)(r) -(sizeof(struct surf_resource_private_part)))) */
-/* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_resource_private_part)))) */
+/* #define pub2priv(r) ((surf_model_private_t) ((char *)(r) -(sizeof(struct surf_model_private_part)))) */
+/* #define priv2pub(r) ((void *) ((char *)(r) +(sizeof(struct surf_model_private_part)))) */
 
 extern int use_sdp_solver;
 extern int use_lagrange_solver;
 
-double generic_maxmin_share_resources(xbt_swag_t running_actions,
+double generic_maxmin_share_models(xbt_swag_t running_actions,
                                      size_t offset);
-double generic_maxmin_share_resources2(xbt_swag_t running_actions,
+double generic_maxmin_share_models2(xbt_swag_t running_actions,
                                       size_t offset,
                                       lmm_system_t sys,
                                       void (*solve)(lmm_system_t));
index 243162e..297bff6 100644 (file)
@@ -11,7 +11,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_timer, surf,
                                "Logging specific to SURF (timer)");
 
-surf_timer_resource_t surf_timer_resource = NULL;
+surf_timer_model_t surf_timer_model = NULL;
 static tmgr_trace_t empty_trace = NULL;
 static xbt_swag_t command_pending = NULL;
 static xbt_swag_t command_to_run = NULL;
@@ -26,7 +26,7 @@ static command_t command_new(void *fun, void *args)
 {
   command_t command = xbt_new0(s_command_t, 1);
 
-  command->resource = (surf_resource_t) surf_timer_resource;
+  command->model = (surf_model_t) surf_timer_model;
   command->function = fun;
   command->args = args;
   xbt_swag_insert(command, command_pending);
@@ -59,13 +59,13 @@ static void *name_service(const char *name)
   return NULL;
 }
 
-static const char *get_resource_name(void *resource_id)
+static const char *get_model_name(void *model_id)
 {
   DIE_IMPOSSIBLE;
   return "";
 }
 
-static int resource_used(void *resource_id)
+static int model_used(void *model_id)
 {
   return 1;
 }
@@ -95,7 +95,7 @@ static void action_change_state(surf_action_t action,
   return;
 }
 
-static double share_resources(double now)
+static double share_models(double now)
 {
   if (xbt_heap_size(timer_heap))
     return (xbt_heap_maxkey(timer_heap));
@@ -113,7 +113,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
-static void update_resource_state(void *id,
+static void update_model_state(void *id,
                                  tmgr_trace_event_t event_type,
                                  double value)
 {
@@ -178,73 +178,73 @@ static void finalize(void)
   xbt_swag_free(command_pending);
   xbt_swag_free(command_to_run);
 
-  xbt_swag_free(surf_timer_resource->common_public->states.
+  xbt_swag_free(surf_timer_model->common_public->states.
                ready_action_set);
-  xbt_swag_free(surf_timer_resource->common_public->states.
+  xbt_swag_free(surf_timer_model->common_public->states.
                running_action_set);
-  xbt_swag_free(surf_timer_resource->common_public->states.
+  xbt_swag_free(surf_timer_model->common_public->states.
                failed_action_set);
-  xbt_swag_free(surf_timer_resource->common_public->states.
+  xbt_swag_free(surf_timer_model->common_public->states.
                done_action_set);
-  free(surf_timer_resource->common_public);
-  free(surf_timer_resource->common_private);
-  free(surf_timer_resource->extension_public);
+  free(surf_timer_model->common_public);
+  free(surf_timer_model->common_private);
+  free(surf_timer_model->extension_public);
 
-  free(surf_timer_resource);
-  surf_timer_resource = NULL;
+  free(surf_timer_model);
+  surf_timer_model = NULL;
 }
 
-static void surf_timer_resource_init_internal(void)
+static void surf_timer_model_init_internal(void)
 {
   s_surf_action_t action;
 
-  surf_timer_resource = xbt_new0(s_surf_timer_resource_t, 1);
+  surf_timer_model = xbt_new0(s_surf_timer_model_t, 1);
 
-  surf_timer_resource->common_private =
-      xbt_new0(s_surf_resource_private_t, 1);
-  surf_timer_resource->common_public =
-      xbt_new0(s_surf_resource_public_t, 1);
+  surf_timer_model->common_private =
+      xbt_new0(s_surf_model_private_t, 1);
+  surf_timer_model->common_public =
+      xbt_new0(s_surf_model_public_t, 1);
 
-  surf_timer_resource->extension_public =
-      xbt_new0(s_surf_timer_resource_extension_public_t, 1);
+  surf_timer_model->extension_public =
+      xbt_new0(s_surf_timer_model_extension_public_t, 1);
 
-  surf_timer_resource->common_public->states.ready_action_set =
+  surf_timer_model->common_public->states.ready_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_timer_resource->common_public->states.running_action_set =
+  surf_timer_model->common_public->states.running_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_timer_resource->common_public->states.failed_action_set =
+  surf_timer_model->common_public->states.failed_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_timer_resource->common_public->states.done_action_set =
+  surf_timer_model->common_public->states.done_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  surf_timer_resource->common_public->name_service = name_service;
-  surf_timer_resource->common_public->get_resource_name =
-      get_resource_name;
-  surf_timer_resource->common_public->action_get_state =
+  surf_timer_model->common_public->name_service = name_service;
+  surf_timer_model->common_public->get_model_name =
+      get_model_name;
+  surf_timer_model->common_public->action_get_state =
       surf_action_get_state;
-  surf_timer_resource->common_public->action_free = action_free;
-  surf_timer_resource->common_public->action_cancel = action_cancel;
-  surf_timer_resource->common_public->action_recycle = action_recycle;
-  surf_timer_resource->common_public->action_change_state =
+  surf_timer_model->common_public->action_free = action_free;
+  surf_timer_model->common_public->action_cancel = action_cancel;
+  surf_timer_model->common_public->action_recycle = action_recycle;
+  surf_timer_model->common_public->action_change_state =
       action_change_state;
-  surf_timer_resource->common_public->action_set_data =
+  surf_timer_model->common_public->action_set_data =
       surf_action_set_data;
-  surf_timer_resource->common_public->name = "TIMER";
+  surf_timer_model->common_public->name = "TIMER";
 
-  surf_timer_resource->common_private->resource_used = resource_used;
-  surf_timer_resource->common_private->share_resources = share_resources;
-  surf_timer_resource->common_private->update_actions_state =
+  surf_timer_model->common_private->model_used = model_used;
+  surf_timer_model->common_private->share_models = share_models;
+  surf_timer_model->common_private->update_actions_state =
       update_actions_state;
-  surf_timer_resource->common_private->update_resource_state =
-      update_resource_state;
-  surf_timer_resource->common_private->finalize = finalize;
+  surf_timer_model->common_private->update_model_state =
+      update_model_state;
+  surf_timer_model->common_private->finalize = finalize;
 
-  surf_timer_resource->common_public->suspend = action_suspend;
-  surf_timer_resource->common_public->resume = action_resume;
-  surf_timer_resource->common_public->is_suspended = action_is_suspended;
+  surf_timer_model->common_public->suspend = action_suspend;
+  surf_timer_model->common_public->resume = action_resume;
+  surf_timer_model->common_public->is_suspended = action_is_suspended;
 
-  surf_timer_resource->extension_public->set = set;
-  surf_timer_resource->extension_public->get = get;
+  surf_timer_model->extension_public->set = set;
+  surf_timer_model->extension_public->get = get;
 
   {
     s_command_t var;
@@ -260,10 +260,10 @@ static void surf_timer_resource_init_internal(void)
   xbt_assert0(maxmin_system, "surf_init has to be called first!");
 }
 
-void surf_timer_resource_init(const char *filename)
+void surf_timer_model_init(const char *filename)
 {
-  if (surf_timer_resource)
+  if (surf_timer_model)
     return;
-  surf_timer_resource_init_internal();
-  xbt_dynar_push(resource_list, &surf_timer_resource);
+  surf_timer_model_init_internal();
+  xbt_dynar_push(model_list, &surf_timer_model);
 }
index 5a81f6c..584f73c 100644 (file)
@@ -17,7 +17,7 @@
 /* } s_surf_action_timer_t, *surf_action_timer_t; */
 
 typedef struct command {
-  surf_resource_t resource;    /* Any such object, added in a trace
+  surf_model_t model;  /* Any such object, added in a trace
                                   should start by this field!!! */
   void *function;
   void *args;
index aad40d7..3cda9b4 100644 (file)
@@ -133,14 +133,14 @@ void tmgr_trace_free(tmgr_trace_t trace)
 tmgr_trace_event_t tmgr_history_add_trace(tmgr_history_t h,
                                          tmgr_trace_t trace,
                                          double start_time, int offset,
-                                         void *resource)
+                                         void *model)
 {
   tmgr_trace_event_t trace_event = NULL;
 
   trace_event = xbt_new0(s_tmgr_trace_event_t, 1);
   trace_event->trace = trace;
   trace_event->idx = offset;
-  trace_event->resource = resource;
+  trace_event->model = model;
 
   xbt_assert0((trace_event->idx < xbt_dynar_length(trace->event_list)),
              "You're refering to an event that does not exist!");
@@ -161,7 +161,7 @@ double tmgr_history_next_date(tmgr_history_t h)
 tmgr_trace_event_t tmgr_history_get_next_event_leq(tmgr_history_t h,
                                                   double date,
                                                   double *value,
-                                                  void **resource)
+                                                  void **model)
 {
   double event_date = tmgr_history_next_date(h);
   tmgr_trace_event_t trace_event = NULL;
@@ -178,7 +178,7 @@ tmgr_trace_event_t tmgr_history_get_next_event_leq(tmgr_history_t h,
   event = xbt_dynar_get_ptr(trace->event_list, trace_event->idx);
 
   *value = event->value;
-  *resource = trace_event->resource;
+  *model = trace_event->model;
 
   if (trace_event->idx < xbt_dynar_length(trace->event_list) - 1) {
     xbt_heap_push(h->heap, trace_event, event_date + event->delta);
index f63d1a2..a8e01c9 100644 (file)
@@ -24,7 +24,7 @@ typedef struct tmgr_trace {
 typedef struct tmgr_trace_event {
   tmgr_trace_t trace;
   int idx;
-  void *resource;
+  void *model;
 } s_tmgr_trace_event_t;
 
 typedef struct tmgr_history {
index 2d84e1d..f2d2ff0 100644 (file)
@@ -12,7 +12,7 @@
 #include "cpu_private.h"
 #include "network_private.h"
 
-surf_workstation_resource_t surf_workstation_resource = NULL;
+surf_workstation_model_t surf_workstation_model = NULL;
 xbt_dict_t workstation_set = NULL;
 static xbt_dict_t parallel_task_network_link_set = NULL;
 
@@ -21,7 +21,7 @@ static workstation_CLM03_t workstation_new(const char *name,
 {
   workstation_CLM03_t workstation = xbt_new0(s_workstation_CLM03_t, 1);
 
-  workstation->resource = (surf_resource_t) surf_workstation_resource;
+  workstation->model = (surf_model_t) surf_workstation_model;
   workstation->name = xbt_strdup(name);
   workstation->cpu = cpu;
   workstation->network_card = card;
@@ -56,15 +56,15 @@ static void *name_service(const char *name)
   return xbt_dict_get_or_null(workstation_set, name);
 }
 
-static const char *get_resource_name(void *resource_id)
+static const char *get_model_name(void *model_id)
 {
-  return ((workstation_CLM03_t) resource_id)->name;
+  return ((workstation_CLM03_t) model_id)->name;
 }
 
-static int resource_used(void *resource_id)
+static int model_used(void *model_id)
 {
   xbt_assert0(0,
-             "Workstation is a virtual resource. I should not be there!");
+             "Workstation is a virtual model. I should not be there!");
   return 0;
 }
 
@@ -90,12 +90,12 @@ static void parallel_action_use(surf_action_t action)
 
 static int action_free(surf_action_t action)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    return surf_network_resource->common_public->action_free(action);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    return surf_cpu_resource->common_public->action_free(action);
-  else if (action->resource_type ==
-          (surf_resource_t) surf_workstation_resource)
+  if (action->model_type == (surf_model_t) surf_network_model)
+    return surf_network_model->common_public->action_free(action);
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    return surf_cpu_model->common_public->action_free(action);
+  else if (action->model_type ==
+          (surf_model_t) surf_workstation_model)
     return parallel_action_free(action);
   else
     DIE_IMPOSSIBLE;
@@ -104,12 +104,12 @@ static int action_free(surf_action_t action)
 
 static void action_use(surf_action_t action)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    surf_network_resource->common_public->action_use(action);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    surf_cpu_resource->common_public->action_use(action);
-  else if (action->resource_type ==
-          (surf_resource_t) surf_workstation_resource)
+  if (action->model_type == (surf_model_t) surf_network_model)
+    surf_network_model->common_public->action_use(action);
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    surf_cpu_model->common_public->action_use(action);
+  else if (action->model_type ==
+          (surf_model_t) surf_workstation_model)
     parallel_action_use(action);
   else
     DIE_IMPOSSIBLE;
@@ -118,12 +118,12 @@ static void action_use(surf_action_t action)
 
 static void action_cancel(surf_action_t action)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    surf_network_resource->common_public->action_cancel(action);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    surf_cpu_resource->common_public->action_cancel(action);
-  else if (action->resource_type ==
-          (surf_resource_t) surf_workstation_resource)
+  if (action->model_type == (surf_model_t) surf_network_model)
+    surf_network_model->common_public->action_cancel(action);
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    surf_cpu_model->common_public->action_cancel(action);
+  else if (action->model_type ==
+          (surf_model_t) surf_workstation_model)
     parallel_action_use(action);
   else
     DIE_IMPOSSIBLE;
@@ -139,23 +139,23 @@ static void action_recycle(surf_action_t action)
 static void action_change_state(surf_action_t action,
                                e_surf_action_state_t state)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    surf_network_resource->common_public->action_change_state(action,
+  if (action->model_type == (surf_model_t) surf_network_model)
+    surf_network_model->common_public->action_change_state(action,
                                                              state);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    surf_cpu_resource->common_public->action_change_state(action, state);
-  else if (action->resource_type ==
-          (surf_resource_t) surf_workstation_resource)
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    surf_cpu_model->common_public->action_change_state(action, state);
+  else if (action->model_type ==
+          (surf_model_t) surf_workstation_model)
     surf_action_change_state(action, state);
   else
     DIE_IMPOSSIBLE;
   return;
 }
 
-static double share_resources(double now)
+static double share_models(double now)
 {
   s_surf_action_parallel_task_CSL05_t action;
-  return generic_maxmin_share_resources(surf_workstation_resource->
+  return generic_maxmin_share_models(surf_workstation_model->
                                        common_public->states.
                                        running_action_set,
                                        xbt_swag_offset(action, variable));
@@ -166,10 +166,10 @@ static void update_actions_state(double now, double delta)
   surf_action_parallel_task_CSL05_t action = NULL;
   surf_action_parallel_task_CSL05_t next_action = NULL;
   xbt_swag_t running_actions =
-      surf_workstation_resource->common_public->states.running_action_set;
+      surf_workstation_model->common_public->states.running_action_set;
   /* FIXME: unused
      xbt_swag_t failed_actions =
-     surf_workstation_resource->common_public->states.failed_action_set;
+     surf_workstation_model->common_public->states.failed_action_set;
    */
 
   xbt_swag_foreach_safe(action, next_action, running_actions) {
@@ -185,16 +185,16 @@ static void update_actions_state(double now, double delta)
               (action->generic_action.max_duration <= 0)) {
       action->generic_action.finish = surf_get_clock();
       action_change_state((surf_action_t) action, SURF_ACTION_DONE);
-    } else {                   /* Need to check that none of the resource has failed */
+    } else {                   /* Need to check that none of the model has failed */
       lmm_constraint_t cnst = NULL;
       int i = 0;
-      surf_resource_t resource = NULL;
+      surf_model_t model = NULL;
 
       while ((cnst =
              lmm_get_cnst_from_var(maxmin_system, action->variable,
                                    i++))) {
-       resource = (surf_resource_t) lmm_constraint_id(cnst);
-       if (resource == (surf_resource_t) surf_cpu_resource) {
+       model = (surf_model_t) lmm_constraint_id(cnst);
+       if (model == (surf_model_t) surf_cpu_model) {
          cpu_Cas01_t cpu = lmm_constraint_id(cnst);
          if (cpu->state_current == SURF_CPU_OFF) {
            action->generic_action.finish = surf_get_clock();
@@ -202,7 +202,7 @@ static void update_actions_state(double now, double delta)
                                SURF_ACTION_FAILED);
            break;
          }
-       } else if (resource == (surf_resource_t) surf_network_resource) {
+       } else if (model == (surf_model_t) surf_network_model) {
          network_link_CM02_t nw_link = lmm_constraint_id(cnst);
 
          if (nw_link->state_current == SURF_NETWORK_LINK_OFF) {
@@ -219,7 +219,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
-static void update_resource_state(void *id,
+static void update_model_state(void *id,
                                  tmgr_trace_event_t event_type,
                                  double value)
 {
@@ -228,62 +228,62 @@ static void update_resource_state(void *id,
 
 static surf_action_t execute(void *workstation, double size)
 {
-  return surf_cpu_resource->extension_public->
+  return surf_cpu_model->extension_public->
       execute(((workstation_CLM03_t) workstation)->cpu, size);
 }
 
 static surf_action_t action_sleep(void *workstation, double duration)
 {
-  return surf_cpu_resource->extension_public->
+  return surf_cpu_model->extension_public->
       sleep(((workstation_CLM03_t) workstation)->cpu, duration);
 }
 
 static void action_suspend(surf_action_t action)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    surf_network_resource->common_public->suspend(action);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    surf_cpu_resource->common_public->suspend(action);
+  if (action->model_type == (surf_model_t) surf_network_model)
+    surf_network_model->common_public->suspend(action);
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    surf_cpu_model->common_public->suspend(action);
   else
     DIE_IMPOSSIBLE;
 }
 
 static void action_resume(surf_action_t action)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    surf_network_resource->common_public->resume(action);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    surf_cpu_resource->common_public->resume(action);
+  if (action->model_type == (surf_model_t) surf_network_model)
+    surf_network_model->common_public->resume(action);
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    surf_cpu_model->common_public->resume(action);
   else
     DIE_IMPOSSIBLE;
 }
 
 static int action_is_suspended(surf_action_t action)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    return surf_network_resource->common_public->is_suspended(action);
-  if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    return surf_cpu_resource->common_public->is_suspended(action);
+  if (action->model_type == (surf_model_t) surf_network_model)
+    return surf_network_model->common_public->is_suspended(action);
+  if (action->model_type == (surf_model_t) surf_cpu_model)
+    return surf_cpu_model->common_public->is_suspended(action);
   DIE_IMPOSSIBLE;
 }
 
 static void action_set_max_duration(surf_action_t action, double duration)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    surf_network_resource->common_public->set_max_duration(action,
+  if (action->model_type == (surf_model_t) surf_network_model)
+    surf_network_model->common_public->set_max_duration(action,
                                                           duration);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    surf_cpu_resource->common_public->set_max_duration(action, duration);
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    surf_cpu_model->common_public->set_max_duration(action, duration);
   else
     DIE_IMPOSSIBLE;
 }
 
 static void action_set_priority(surf_action_t action, double priority)
 {
-  if (action->resource_type == (surf_resource_t) surf_network_resource)
-    surf_network_resource->common_public->set_priority(action, priority);
-  else if (action->resource_type == (surf_resource_t) surf_cpu_resource)
-    surf_cpu_resource->common_public->set_priority(action, priority);
+  if (action->model_type == (surf_model_t) surf_network_model)
+    surf_network_model->common_public->set_priority(action, priority);
+  else if (action->model_type == (surf_model_t) surf_cpu_model)
+    surf_cpu_model->common_public->set_priority(action, priority);
   else
     DIE_IMPOSSIBLE;
 }
@@ -292,7 +292,7 @@ static surf_action_t communicate(void *workstation_src,
                                 void *workstation_dst, double size,
                                 double rate)
 {
-  return surf_network_resource->extension_public->
+  return surf_network_model->extension_public->
       communicate(((workstation_CLM03_t) workstation_src)->network_card,
                  ((workstation_CLM03_t) workstation_dst)->network_card,
                  size, rate);
@@ -300,19 +300,19 @@ static surf_action_t communicate(void *workstation_src,
 
 static e_surf_cpu_state_t get_state(void *workstation)
 {
-  return surf_cpu_resource->extension_public->
+  return surf_cpu_model->extension_public->
       get_state(((workstation_CLM03_t) workstation)->cpu);
 }
 
 static double get_speed(void *workstation, double load)
 {
-  return surf_cpu_resource->extension_public->
+  return surf_cpu_model->extension_public->
       get_speed(((workstation_CLM03_t) workstation)->cpu, load);
 }
 
 static double get_available_speed(void *workstation)
 {
-  return surf_cpu_resource->extension_public->
+  return surf_cpu_model->extension_public->
       get_available_speed(((workstation_CLM03_t) workstation)->cpu);
 }
 
@@ -344,7 +344,7 @@ static surf_action_t execute_parallel_task(int workstation_nb,
        xbt_dict_new_ext(workstation_nb * workstation_nb * 10);
   }
 
-  /* Compute the number of affected resources... */
+  /* Compute the number of affected models... */
   for (i = 0; i < workstation_nb; i++) {
     for (j = 0; j < workstation_nb; j++) {
       network_card_CM02_t card_src =
@@ -379,12 +379,12 @@ static surf_action_t execute_parallel_task(int workstation_nb,
   action->generic_action.max_duration = NO_MAX_DURATION;
   action->generic_action.start = surf_get_clock();
   action->generic_action.finish = -1.0;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_workstation_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_workstation_model;
   action->suspended = 0;       /* Should be useless because of the
                                   calloc but it seems to help valgrind... */
   action->generic_action.state_set =
-      surf_workstation_resource->common_public->states.running_action_set;
+      surf_workstation_model->common_public->states.running_action_set;
 
   xbt_swag_insert(action, action->generic_action.state_set);
   action->rate = rate;
@@ -431,7 +431,7 @@ static const void **get_route(void *src, void *dst)
 {
   workstation_CLM03_t workstation_src = (workstation_CLM03_t) src;
   workstation_CLM03_t workstation_dst = (workstation_CLM03_t) dst;
-  return surf_network_resource->extension_public->
+  return surf_network_model->extension_public->
       get_route(workstation_src->network_card,
                workstation_dst->network_card);
 }
@@ -440,124 +440,124 @@ static int get_route_size(void *src, void *dst)
 {
   workstation_CLM03_t workstation_src = (workstation_CLM03_t) src;
   workstation_CLM03_t workstation_dst = (workstation_CLM03_t) dst;
-  return surf_network_resource->extension_public->
+  return surf_network_model->extension_public->
       get_route_size(workstation_src->network_card,
                     workstation_dst->network_card);
 }
 
 static const char *get_link_name(const void *link)
 {
-  return surf_network_resource->extension_public->get_link_name(link);
+  return surf_network_model->extension_public->get_link_name(link);
 }
 
 static double get_link_bandwidth(const void *link)
 {
-  return surf_network_resource->extension_public->get_link_bandwidth(link);
+  return surf_network_model->extension_public->get_link_bandwidth(link);
 }
 
 static double get_link_latency(const void *link)
 {
-  return surf_network_resource->extension_public->get_link_latency(link);
+  return surf_network_model->extension_public->get_link_latency(link);
 }
 
 static void finalize(void)
 {
   xbt_dict_free(&workstation_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                ready_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                running_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                failed_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                done_action_set);
 
-  free(surf_workstation_resource->common_public);
-  free(surf_workstation_resource->common_private);
-  free(surf_workstation_resource->extension_public);
+  free(surf_workstation_model->common_public);
+  free(surf_workstation_model->common_private);
+  free(surf_workstation_model->extension_public);
 
-  free(surf_workstation_resource);
-  surf_workstation_resource = NULL;
+  free(surf_workstation_model);
+  surf_workstation_model = NULL;
 }
 
-static void surf_workstation_resource_init_internal(void)
+static void surf_workstation_model_init_internal(void)
 {
   s_surf_action_t action;
 
-  surf_workstation_resource = xbt_new0(s_surf_workstation_resource_t, 1);
+  surf_workstation_model = xbt_new0(s_surf_workstation_model_t, 1);
 
-  surf_workstation_resource->common_private =
-      xbt_new0(s_surf_resource_private_t, 1);
-  surf_workstation_resource->common_public =
-      xbt_new0(s_surf_resource_public_t, 1);
-/*   surf_workstation_resource->extension_private = xbt_new0(s_surf_workstation_resource_extension_private_t,1); */
-  surf_workstation_resource->extension_public =
-      xbt_new0(s_surf_workstation_resource_extension_public_t, 1);
+  surf_workstation_model->common_private =
+      xbt_new0(s_surf_model_private_t, 1);
+  surf_workstation_model->common_public =
+      xbt_new0(s_surf_model_public_t, 1);
+/*   surf_workstation_model->extension_private = xbt_new0(s_surf_workstation_model_extension_private_t,1); */
+  surf_workstation_model->extension_public =
+      xbt_new0(s_surf_workstation_model_extension_public_t, 1);
 
-  surf_workstation_resource->common_public->states.ready_action_set =
+  surf_workstation_model->common_public->states.ready_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.running_action_set =
+  surf_workstation_model->common_public->states.running_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.failed_action_set =
+  surf_workstation_model->common_public->states.failed_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.done_action_set =
+  surf_workstation_model->common_public->states.done_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  surf_workstation_resource->common_public->name_service = name_service;
-  surf_workstation_resource->common_public->get_resource_name =
-      get_resource_name;
-  surf_workstation_resource->common_public->action_get_state =
+  surf_workstation_model->common_public->name_service = name_service;
+  surf_workstation_model->common_public->get_model_name =
+      get_model_name;
+  surf_workstation_model->common_public->action_get_state =
       surf_action_get_state;
-  surf_workstation_resource->common_public->action_get_start_time =
+  surf_workstation_model->common_public->action_get_start_time =
       surf_action_get_start_time;
-  surf_workstation_resource->common_public->action_get_finish_time =
+  surf_workstation_model->common_public->action_get_finish_time =
       surf_action_get_finish_time;
-  surf_workstation_resource->common_public->action_free = action_free;
-  surf_workstation_resource->common_public->action_use = action_use;
-  surf_workstation_resource->common_public->action_cancel = action_cancel;
-  surf_workstation_resource->common_public->action_recycle =
+  surf_workstation_model->common_public->action_free = action_free;
+  surf_workstation_model->common_public->action_use = action_use;
+  surf_workstation_model->common_public->action_cancel = action_cancel;
+  surf_workstation_model->common_public->action_recycle =
       action_recycle;
-  surf_workstation_resource->common_public->action_change_state =
+  surf_workstation_model->common_public->action_change_state =
       action_change_state;
-  surf_workstation_resource->common_public->action_set_data =
+  surf_workstation_model->common_public->action_set_data =
       surf_action_set_data;
-  surf_workstation_resource->common_public->name = "Workstation";
+  surf_workstation_model->common_public->name = "Workstation";
 
-  surf_workstation_resource->common_private->resource_used = resource_used;
-  surf_workstation_resource->common_private->share_resources =
-      share_resources;
-  surf_workstation_resource->common_private->update_actions_state =
+  surf_workstation_model->common_private->model_used = model_used;
+  surf_workstation_model->common_private->share_models =
+      share_models;
+  surf_workstation_model->common_private->update_actions_state =
       update_actions_state;
-  surf_workstation_resource->common_private->update_resource_state =
-      update_resource_state;
-  surf_workstation_resource->common_private->finalize = finalize;
+  surf_workstation_model->common_private->update_model_state =
+      update_model_state;
+  surf_workstation_model->common_private->finalize = finalize;
 
-  surf_workstation_resource->common_public->suspend = action_suspend;
-  surf_workstation_resource->common_public->resume = action_resume;
-  surf_workstation_resource->common_public->is_suspended =
+  surf_workstation_model->common_public->suspend = action_suspend;
+  surf_workstation_model->common_public->resume = action_resume;
+  surf_workstation_model->common_public->is_suspended =
       action_is_suspended;
-  surf_workstation_resource->common_public->set_max_duration =
+  surf_workstation_model->common_public->set_max_duration =
       action_set_max_duration;
-  surf_workstation_resource->common_public->set_priority =
+  surf_workstation_model->common_public->set_priority =
       action_set_priority;
 
-  surf_workstation_resource->extension_public->execute = execute;
-  surf_workstation_resource->extension_public->sleep = action_sleep;
-  surf_workstation_resource->extension_public->get_state = get_state;
-  surf_workstation_resource->extension_public->get_speed = get_speed;
-  surf_workstation_resource->extension_public->get_available_speed =
+  surf_workstation_model->extension_public->execute = execute;
+  surf_workstation_model->extension_public->sleep = action_sleep;
+  surf_workstation_model->extension_public->get_state = get_state;
+  surf_workstation_model->extension_public->get_speed = get_speed;
+  surf_workstation_model->extension_public->get_available_speed =
       get_available_speed;
-  surf_workstation_resource->extension_public->communicate = communicate;
-  surf_workstation_resource->extension_public->execute_parallel_task =
+  surf_workstation_model->extension_public->communicate = communicate;
+  surf_workstation_model->extension_public->execute_parallel_task =
       execute_parallel_task_bogus;
-  surf_workstation_resource->extension_public->get_route = get_route;
-  surf_workstation_resource->extension_public->get_route_size =
+  surf_workstation_model->extension_public->get_route = get_route;
+  surf_workstation_model->extension_public->get_route_size =
       get_route_size;
-  surf_workstation_resource->extension_public->get_link_name =
+  surf_workstation_model->extension_public->get_link_name =
       get_link_name;
-  surf_workstation_resource->extension_public->get_link_bandwidth =
+  surf_workstation_model->extension_public->get_link_bandwidth =
       get_link_bandwidth;
-  surf_workstation_resource->extension_public->get_link_latency =
+  surf_workstation_model->extension_public->get_link_latency =
       get_link_latency;
   workstation_set = xbt_dict_new();
 
@@ -575,31 +575,31 @@ static void surf_workstation_resource_init_internal(void)
 /*   month = {may}, */
 /*   year = {2003} */
 /* } */
-void surf_workstation_resource_init_CLM03(const char *filename)
+void surf_workstation_model_init_CLM03(const char *filename)
 {
-  surf_workstation_resource_init_internal();
-  surf_cpu_resource_init_Cas01(filename);
-  surf_network_resource_init_CM02(filename);
+  surf_workstation_model_init_internal();
+  surf_cpu_model_init_Cas01(filename);
+  surf_network_model_init_CM02(filename);
   create_workstations();
-  update_resource_description(surf_workstation_resource_description,
-                             surf_workstation_resource_description_size,
+  update_model_description(surf_workstation_model_description,
+                             surf_workstation_model_description_size,
                              "CLM03",
-                             (surf_resource_t) surf_workstation_resource);
-  xbt_dynar_push(resource_list, &surf_workstation_resource);
+                             (surf_model_t) surf_workstation_model);
+  xbt_dynar_push(model_list, &surf_workstation_model);
 }
 
-void surf_workstation_resource_init_compound(const char *filename)
+void surf_workstation_model_init_compound(const char *filename)
 {
 
-  xbt_assert0(surf_cpu_resource, "No CPU resource defined yet!");
-  xbt_assert0(surf_network_resource, "No network resource defined yet!");
-  surf_workstation_resource_init_internal();
+  xbt_assert0(surf_cpu_model, "No CPU model defined yet!");
+  xbt_assert0(surf_network_model, "No network model defined yet!");
+  surf_workstation_model_init_internal();
   create_workstations();
 
-  update_resource_description(surf_workstation_resource_description,
-                             surf_workstation_resource_description_size,
+  update_model_description(surf_workstation_model_description,
+                             surf_workstation_model_description_size,
                              "compound",
-                             (surf_resource_t) surf_workstation_resource);
+                             (surf_model_t) surf_workstation_model);
 
-  xbt_dynar_push(resource_list, &surf_workstation_resource);
+  xbt_dynar_push(model_list, &surf_workstation_model);
 }
index 9108c31..382a7e5 100644 (file)
@@ -101,12 +101,12 @@ static void *name_service(const char *name)
   return res;
 }
 
-static const char *get_resource_name(void *resource_id)
+static const char *get_model_name(void *model_id)
 {
   /* We can freely cast as a cpu_KCCFLN05_t because it has the same
      prefix as network_link_KCCFLN05_t. However, only cpu_KCCFLN05_t
      will theoretically be given as an argument here. */
-  return ((cpu_KCCFLN05_t) resource_id)->name;
+  return ((cpu_KCCFLN05_t) model_id)->name;
 }
 
 /* action_get_state is inherited from the surf module */
@@ -227,33 +227,33 @@ static void action_set_priority(surf_action_t action, double priority)
 /******* Resource Private    **********/
 /**************************************/
 
-static int resource_used(void *resource_id)
+static int model_used(void *model_id)
 {
   /* We can freely cast as a network_link_KCCFLN05_t because it has
      the same prefix as cpu_KCCFLN05_t */
-  if (((cpu_KCCFLN05_t) resource_id)->type ==
+  if (((cpu_KCCFLN05_t) model_id)->type ==
       SURF_WORKSTATION_RESOURCE_CPU)
     return (lmm_constraint_used
-           (maxmin_system, ((cpu_KCCFLN05_t) resource_id)->constraint)
-           || ((((cpu_KCCFLN05_t) resource_id)->bus) ?
+           (maxmin_system, ((cpu_KCCFLN05_t) model_id)->constraint)
+           || ((((cpu_KCCFLN05_t) model_id)->bus) ?
                lmm_constraint_used(maxmin_system,
-                                   ((cpu_KCCFLN05_t) resource_id)->
+                                   ((cpu_KCCFLN05_t) model_id)->
                                    bus) : 0));
   else
     return lmm_constraint_used(maxmin_system,
-                              ((network_link_KCCFLN05_t) resource_id)->
+                              ((network_link_KCCFLN05_t) model_id)->
                               constraint);
 
 }
 
-static double share_resources(double now)
+static double share_models(double now)
 {
   s_surf_action_workstation_KCCFLN05_t s_action;
   surf_action_workstation_KCCFLN05_t action = NULL;
 
   xbt_swag_t running_actions =
-      surf_workstation_resource->common_public->states.running_action_set;
-  double min = generic_maxmin_share_resources(running_actions,
+      surf_workstation_model->common_public->states.running_action_set;
+  double min = generic_maxmin_share_models(running_actions,
                                              xbt_swag_offset(s_action,
                                                              variable));
 
@@ -282,7 +282,7 @@ static void update_actions_state(double now, double delta)
   surf_action_workstation_KCCFLN05_t action = NULL;
   surf_action_workstation_KCCFLN05_t next_action = NULL;
   xbt_swag_t running_actions =
-      surf_workstation_resource->common_public->states.running_action_set;
+      surf_workstation_model->common_public->states.running_action_set;
 
   xbt_swag_foreach_safe(action, next_action, running_actions) {
     deltap = delta;
@@ -320,7 +320,7 @@ static void update_actions_state(double now, double delta)
       action->generic_action.finish = surf_get_clock();
       surf_action_change_state((surf_action_t) action, SURF_ACTION_DONE);
     } else {
-      /* Need to check that none of the resource has failed */
+      /* Need to check that none of the model has failed */
       lmm_constraint_t cnst = NULL;
       int i = 0;
       void *constraint_id = NULL;
@@ -364,7 +364,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
-static void update_resource_state(void *id,
+static void update_model_state(void *id,
                                  tmgr_trace_event_t event_type,
                                  double value)
 {
@@ -447,21 +447,21 @@ static void finalize(void)
   if (parallel_task_network_link_set != NULL) {
     xbt_dict_free(&parallel_task_network_link_set);
   }
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                ready_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                running_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                failed_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                done_action_set);
 
-  free(surf_workstation_resource->common_public);
-  free(surf_workstation_resource->common_private);
-  free(surf_workstation_resource->extension_public);
+  free(surf_workstation_model->common_public);
+  free(surf_workstation_model->common_private);
+  free(surf_workstation_model->extension_public);
 
-  free(surf_workstation_resource);
-  surf_workstation_resource = NULL;
+  free(surf_workstation_model);
+  surf_workstation_model = NULL;
 
   for (i = 0; i < nb_workstation; i++)
     for (j = 0; j < nb_workstation; j++)
@@ -495,17 +495,17 @@ static surf_action_t execute(void *cpu, double size)
   action->generic_action.max_duration = NO_MAX_DURATION;
   action->generic_action.start = surf_get_clock();
   action->generic_action.finish = -1.0;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_workstation_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_workstation_model;
   action->suspended = 0;
 
   if (CPU->state_current == SURF_CPU_ON)
     action->generic_action.state_set =
-       surf_workstation_resource->common_public->states.
+       surf_workstation_model->common_public->states.
        running_action_set;
   else
     action->generic_action.state_set =
-       surf_workstation_resource->common_public->states.failed_action_set;
+       surf_workstation_model->common_public->states.failed_action_set;
   xbt_swag_insert(action, action->generic_action.state_set);
 
   action->variable = lmm_variable_new(maxmin_system, action,
@@ -531,7 +531,7 @@ static surf_action_t action_sleep(void *cpu, double duration)
   return (surf_action_t) action;
 }
 
-static e_surf_cpu_state_t resource_get_state(void *cpu)
+static e_surf_cpu_state_t model_get_state(void *cpu)
 {
   return ((cpu_KCCFLN05_t) cpu)->state_current;
 }
@@ -572,12 +572,12 @@ static surf_action_t communicate(void *src, void *dst, double size,
   action->generic_action.finish = -1.0;
   action->src = src;
   action->dst = dst;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_workstation_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_workstation_model;
   action->suspended = 0;       /* Should be useless because of the 
                                   calloc but it seems to help valgrind... */
   action->generic_action.state_set =
-      surf_workstation_resource->common_public->states.running_action_set;
+      surf_workstation_model->common_public->states.running_action_set;
 
   xbt_dynar_push(card_src->outgoing_communications, &action);
   xbt_dynar_push(card_dst->incomming_communications, &action);
@@ -651,7 +651,7 @@ static surf_action_t execute_parallel_task(int workstation_nb,
        xbt_dict_new_ext(workstation_nb * workstation_nb * 10);
   }
 
-  /* Compute the number of affected resources... */
+  /* Compute the number of affected models... */
   for (i = 0; i < workstation_nb; i++) {
     for (j = 0; j < workstation_nb; j++) {
       cpu_KCCFLN05_t card_src = workstation_list[i];
@@ -684,12 +684,12 @@ static surf_action_t execute_parallel_task(int workstation_nb,
   action->generic_action.max_duration = NO_MAX_DURATION;
   action->generic_action.start = -1.0;
   action->generic_action.finish = -1.0;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_workstation_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_workstation_model;
   action->suspended = 0;       /* Should be useless because of the
                                   calloc but it seems to help valgrind... */
   action->generic_action.state_set =
-      surf_workstation_resource->common_public->states.running_action_set;
+      surf_workstation_model->common_public->states.running_action_set;
 
   xbt_swag_insert(action, action->generic_action.state_set);
   action->rate = rate;
@@ -817,7 +817,7 @@ static cpu_KCCFLN05_t cpu_new(const char *name, double power_scale,
 {
   cpu_KCCFLN05_t cpu = xbt_new0(s_cpu_KCCFLN05_t, 1);
 
-  cpu->resource = (surf_resource_t) surf_workstation_resource;
+  cpu->model = (surf_model_t) surf_workstation_model;
   cpu->type = SURF_WORKSTATION_RESOURCE_CPU;
   cpu->name = xbt_strdup(name);
   cpu->id = nb_workstation++;
@@ -920,7 +920,7 @@ static network_link_KCCFLN05_t network_link_new(char *name,
   network_link_KCCFLN05_t nw_link = xbt_new0(s_network_link_KCCFLN05_t, 1);
 
 
-  nw_link->resource = (surf_resource_t) surf_workstation_resource;
+  nw_link->model = (surf_model_t) surf_workstation_model;
   nw_link->type = SURF_WORKSTATION_RESOURCE_LINK;
   nw_link->name = name;
   nw_link->bw_current = bw_initial;
@@ -1138,83 +1138,83 @@ static void parse_file(const char *file)
 /********* Module  creation ***********/
 /**************************************/
 
-static void resource_init_internal(void)
+static void model_init_internal(void)
 {
   s_surf_action_t action;
 
-  surf_workstation_resource = xbt_new0(s_surf_workstation_resource_t, 1);
+  surf_workstation_model = xbt_new0(s_surf_workstation_model_t, 1);
 
-  surf_workstation_resource->common_private =
-      xbt_new0(s_surf_resource_private_t, 1);
-  surf_workstation_resource->common_public =
-      xbt_new0(s_surf_resource_public_t, 1);
-  surf_workstation_resource->extension_public =
-      xbt_new0(s_surf_workstation_resource_extension_public_t, 1);
+  surf_workstation_model->common_private =
+      xbt_new0(s_surf_model_private_t, 1);
+  surf_workstation_model->common_public =
+      xbt_new0(s_surf_model_public_t, 1);
+  surf_workstation_model->extension_public =
+      xbt_new0(s_surf_workstation_model_extension_public_t, 1);
 
-  surf_workstation_resource->common_public->states.ready_action_set =
+  surf_workstation_model->common_public->states.ready_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.running_action_set =
+  surf_workstation_model->common_public->states.running_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.failed_action_set =
+  surf_workstation_model->common_public->states.failed_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.done_action_set =
+  surf_workstation_model->common_public->states.done_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  surf_workstation_resource->common_public->name_service = name_service;
-  surf_workstation_resource->common_public->get_resource_name =
-      get_resource_name;
-  surf_workstation_resource->common_public->action_get_state =
+  surf_workstation_model->common_public->name_service = name_service;
+  surf_workstation_model->common_public->get_model_name =
+      get_model_name;
+  surf_workstation_model->common_public->action_get_state =
       surf_action_get_state;
-  surf_workstation_resource->common_public->action_get_start_time =
+  surf_workstation_model->common_public->action_get_start_time =
       surf_action_get_start_time;
-  surf_workstation_resource->common_public->action_get_finish_time =
+  surf_workstation_model->common_public->action_get_finish_time =
       surf_action_get_finish_time;
-  surf_workstation_resource->common_public->action_use = action_use;
-  surf_workstation_resource->common_public->action_free = action_free;
-  surf_workstation_resource->common_public->action_cancel = action_cancel;
-  surf_workstation_resource->common_public->action_recycle =
+  surf_workstation_model->common_public->action_use = action_use;
+  surf_workstation_model->common_public->action_free = action_free;
+  surf_workstation_model->common_public->action_cancel = action_cancel;
+  surf_workstation_model->common_public->action_recycle =
       action_recycle;
-  surf_workstation_resource->common_public->action_change_state =
+  surf_workstation_model->common_public->action_change_state =
       surf_action_change_state;
-  surf_workstation_resource->common_public->action_set_data =
+  surf_workstation_model->common_public->action_set_data =
       surf_action_set_data;
-  surf_workstation_resource->common_public->suspend = action_suspend;
-  surf_workstation_resource->common_public->resume = action_resume;
-  surf_workstation_resource->common_public->is_suspended =
+  surf_workstation_model->common_public->suspend = action_suspend;
+  surf_workstation_model->common_public->resume = action_resume;
+  surf_workstation_model->common_public->is_suspended =
       action_is_suspended;
-  surf_workstation_resource->common_public->set_max_duration =
+  surf_workstation_model->common_public->set_max_duration =
       action_set_max_duration;
-  surf_workstation_resource->common_public->set_priority =
+  surf_workstation_model->common_public->set_priority =
       action_set_priority;
-  surf_workstation_resource->common_public->name = "Workstation KCCFLN05";
+  surf_workstation_model->common_public->name = "Workstation KCCFLN05";
 
-  surf_workstation_resource->common_private->resource_used = resource_used;
-  surf_workstation_resource->common_private->share_resources =
-      share_resources;
-  surf_workstation_resource->common_private->update_actions_state =
+  surf_workstation_model->common_private->model_used = model_used;
+  surf_workstation_model->common_private->share_models =
+      share_models;
+  surf_workstation_model->common_private->update_actions_state =
       update_actions_state;
-  surf_workstation_resource->common_private->update_resource_state =
-      update_resource_state;
-  surf_workstation_resource->common_private->finalize = finalize;
-
-  surf_workstation_resource->extension_public->execute = execute;
-  surf_workstation_resource->extension_public->sleep = action_sleep;
-  surf_workstation_resource->extension_public->get_state =
-      resource_get_state;
-  surf_workstation_resource->extension_public->get_speed = get_speed;
-  surf_workstation_resource->extension_public->get_available_speed =
+  surf_workstation_model->common_private->update_model_state =
+      update_model_state;
+  surf_workstation_model->common_private->finalize = finalize;
+
+  surf_workstation_model->extension_public->execute = execute;
+  surf_workstation_model->extension_public->sleep = action_sleep;
+  surf_workstation_model->extension_public->get_state =
+      model_get_state;
+  surf_workstation_model->extension_public->get_speed = get_speed;
+  surf_workstation_model->extension_public->get_available_speed =
       get_available_speed;
-  surf_workstation_resource->extension_public->communicate = communicate;
-  surf_workstation_resource->extension_public->execute_parallel_task =
+  surf_workstation_model->extension_public->communicate = communicate;
+  surf_workstation_model->extension_public->execute_parallel_task =
       execute_parallel_task;
-  surf_workstation_resource->extension_public->get_route = get_route;
-  surf_workstation_resource->extension_public->get_route_size =
+  surf_workstation_model->extension_public->get_route = get_route;
+  surf_workstation_model->extension_public->get_route_size =
       get_route_size;
-  surf_workstation_resource->extension_public->get_link_name =
+  surf_workstation_model->extension_public->get_link_name =
       get_link_name;
-  surf_workstation_resource->extension_public->get_link_bandwidth =
+  surf_workstation_model->extension_public->get_link_bandwidth =
       get_link_bandwidth;
-  surf_workstation_resource->extension_public->get_link_latency =
+  surf_workstation_model->extension_public->get_link_latency =
       get_link_latency;
 
   workstation_set = xbt_dict_new();
@@ -1227,13 +1227,13 @@ static void resource_init_internal(void)
 /**************************************/
 /*************** Generic **************/
 /**************************************/
-void surf_workstation_resource_init_KCCFLN05(const char *filename)
+void surf_workstation_model_init_KCCFLN05(const char *filename)
 {
-  xbt_assert0(!surf_cpu_resource, "CPU resource type already defined");
-  xbt_assert0(!surf_network_resource,
-             "network resource type already defined");
-  resource_init_internal();
+  xbt_assert0(!surf_cpu_model, "CPU model type already defined");
+  xbt_assert0(!surf_network_model,
+             "network model type already defined");
+  model_init_internal();
   parse_file(filename);
 
-  xbt_dynar_push(resource_list, &surf_workstation_resource);
+  xbt_dynar_push(model_list, &surf_workstation_model);
 }
index f4562aa..df0d10f 100644 (file)
@@ -13,7 +13,7 @@
 typedef enum {
   SURF_WORKSTATION_RESOURCE_CPU,
   SURF_WORKSTATION_RESOURCE_LINK,
-} e_surf_workstation_resource_type_t;
+} e_surf_workstation_model_type_t;
 
 
 /**************************************/
@@ -29,8 +29,8 @@ typedef struct router_KCCFLN05 {
 /********* cpu object *****************/
 /**************************************/
 typedef struct cpu_KCCFLN05 {
-  surf_resource_t resource;
-  e_surf_workstation_resource_type_t type;     /* Do not move this field */
+  surf_model_t model;
+  e_surf_workstation_model_type_t type;        /* Do not move this field */
   char *name;                                  /* Do not move this field */
   lmm_constraint_t constraint;
   lmm_constraint_t bus;
@@ -52,8 +52,8 @@ typedef struct cpu_KCCFLN05 {
 /**************************************/
 
 typedef struct network_link_KCCFLN05 {
-  surf_resource_t resource;
-  e_surf_workstation_resource_type_t type;     /* Do not move this field */
+  surf_model_t model;
+  e_surf_workstation_model_type_t type;        /* Do not move this field */
   char *name;                                  /* Do not move this field */
   lmm_constraint_t constraint;
   double lat_current;
index 0b05709..89f16a4 100644 (file)
@@ -11,7 +11,7 @@
 #include "surf_private.h"
 
 typedef struct workstation_CLM03 {
-  surf_resource_t resource;    /* Any such object, added in a trace
+  surf_model_t model;  /* Any such object, added in a trace
                                   should start by this field!!! */
   char *name;
   void *cpu;
index efd2ef5..28468d0 100644 (file)
 typedef enum {
   SURF_WORKSTATION_RESOURCE_CPU,
   SURF_WORKSTATION_RESOURCE_LINK,
-} e_surf_workstation_resource_type_t;
+} e_surf_workstation_model_type_t;
 
 /**************************************/
 /********* cpu object *****************/
 /**************************************/
 typedef struct cpu_L07 {
-  surf_resource_t resource;    /* Do not move this field */
-  e_surf_workstation_resource_type_t type;     /* Do not move this field */
+  surf_model_t model;  /* Do not move this field */
+  e_surf_workstation_model_type_t type;        /* Do not move this field */
   char *name;                  /* Do not move this field */
   lmm_constraint_t constraint; /* Do not move this field */
   double power_scale;
@@ -35,8 +35,8 @@ typedef struct cpu_L07 {
 /**************************************/
 
 typedef struct network_link_L07 {
-  surf_resource_t resource;    /* Do not move this field */
-  e_surf_workstation_resource_type_t type;     /* Do not move this field */
+  surf_model_t model;  /* Do not move this field */
+  e_surf_workstation_model_type_t type;        /* Do not move this field */
   char *name;                  /* Do not move this field */
   lmm_constraint_t constraint; /* Do not move this field */
   double bw_current;
@@ -80,12 +80,12 @@ static void *name_service(const char *name)
   return xbt_dict_get_or_null(workstation_set, name);
 }
 
-static const char *get_resource_name(void *resource_id)
+static const char *get_model_name(void *model_id)
 {
   /* We can freely cast as a cpu_L07_t because it has the same
      prefix as network_link_L07_t. However, only cpu_L07_t
      will theoretically be given as an argument here. */
-  return ((cpu_L07_t) resource_id)->name;
+  return ((cpu_L07_t) model_id)->name;
 }
 
 /* action_get_state is inherited from the surf module */
@@ -175,23 +175,23 @@ static void action_set_priority(surf_action_t action, double priority)
 /******* Resource Private    **********/
 /**************************************/
 
-static int resource_used(void *resource_id)
+static int model_used(void *model_id)
 {
   /* We can freely cast as a network_link_L07_t because it has
      the same prefix as cpu_L07_t */
   return lmm_constraint_used(ptask_maxmin_system,
-                            ((network_link_L07_t) resource_id)->
+                            ((network_link_L07_t) model_id)->
                             constraint);
 
 }
 
-static double share_resources(double now)
+static double share_models(double now)
 {
   s_surf_action_workstation_L07_t s_action;
 
   xbt_swag_t running_actions =
-      surf_workstation_resource->common_public->states.running_action_set;
-  double min = generic_maxmin_share_resources2(running_actions,
+      surf_workstation_model->common_public->states.running_action_set;
+  double min = generic_maxmin_share_models2(running_actions,
                                               xbt_swag_offset(s_action,
                                                               variable),
                                               ptask_maxmin_system,
@@ -207,7 +207,7 @@ static void update_actions_state(double now, double delta)
   surf_action_workstation_L07_t action = NULL;
   surf_action_workstation_L07_t next_action = NULL;
   xbt_swag_t running_actions =
-      surf_workstation_resource->common_public->states.running_action_set;
+      surf_workstation_model->common_public->states.running_action_set;
 
   xbt_swag_foreach_safe(action, next_action, running_actions) {
     DEBUG3("Action (%p) : remains (%g) updated by %g.",
@@ -230,7 +230,7 @@ static void update_actions_state(double now, double delta)
       action->generic_action.finish = surf_get_clock();
       surf_action_change_state((surf_action_t) action, SURF_ACTION_DONE);
     } else {
-      /* Need to check that none of the resource has failed */
+      /* Need to check that none of the model has failed */
       lmm_constraint_t cnst = NULL;
       int i = 0;
       void *constraint_id = NULL;
@@ -274,7 +274,7 @@ static void update_actions_state(double now, double delta)
   return;
 }
 
-static void update_resource_state(void *id,
+static void update_model_state(void *id,
                                  tmgr_trace_event_t event_type,
                                  double value)
 {
@@ -328,21 +328,21 @@ static void finalize(void)
   if (parallel_task_network_link_set != NULL) {
     xbt_dict_free(&parallel_task_network_link_set);
   }
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                ready_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                running_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                failed_action_set);
-  xbt_swag_free(surf_workstation_resource->common_public->states.
+  xbt_swag_free(surf_workstation_model->common_public->states.
                done_action_set);
 
-  free(surf_workstation_resource->common_public);
-  free(surf_workstation_resource->common_private);
-  free(surf_workstation_resource->extension_public);
+  free(surf_workstation_model->common_public);
+  free(surf_workstation_model->common_private);
+  free(surf_workstation_model->extension_public);
 
-  free(surf_workstation_resource);
-  surf_workstation_resource = NULL;
+  free(surf_workstation_model);
+  surf_workstation_model = NULL;
 
   for (i = 0; i < nb_workstation; i++)
     for (j = 0; j < nb_workstation; j++)
@@ -361,7 +361,7 @@ static void finalize(void)
 /******* Resource Private    **********/
 /**************************************/
 
-static e_surf_cpu_state_t resource_get_state(void *cpu)
+static e_surf_cpu_state_t model_get_state(void *cpu)
 {
   return ((cpu_L07_t) cpu)->state_current;
 }
@@ -392,7 +392,7 @@ static surf_action_t execute_parallel_task(int workstation_nb,
        xbt_dict_new_ext(workstation_nb * workstation_nb * 10);
   }
 
-  /* Compute the number of affected resources... */
+  /* Compute the number of affected models... */
   for (i = 0; i < workstation_nb; i++) {
     for (j = 0; j < workstation_nb; j++) {
       cpu_L07_t card_src = workstation_list[i];
@@ -423,12 +423,12 @@ static surf_action_t execute_parallel_task(int workstation_nb,
   action->generic_action.max_duration = NO_MAX_DURATION;
   action->generic_action.start = -1.0;
   action->generic_action.finish = -1.0;
-  action->generic_action.resource_type =
-      (surf_resource_t) surf_workstation_resource;
+  action->generic_action.model_type =
+      (surf_model_t) surf_workstation_model;
   action->suspended = 0;       /* Should be useless because of the
                                   calloc but it seems to help valgrind... */
   action->generic_action.state_set =
-      surf_workstation_resource->common_public->states.running_action_set;
+      surf_workstation_model->common_public->states.running_action_set;
 
   xbt_swag_insert(action, action->generic_action.state_set);
   action->rate = rate;
@@ -574,7 +574,7 @@ static cpu_L07_t cpu_new(const char *name, double power_scale,
 {
   cpu_L07_t cpu = xbt_new0(s_cpu_L07_t, 1);
 
-  cpu->resource = (surf_resource_t) surf_workstation_resource;
+  cpu->model = (surf_model_t) surf_workstation_model;
   cpu->type = SURF_WORKSTATION_RESOURCE_CPU;
   cpu->name = xbt_strdup(name);
   cpu->id = nb_workstation++;
@@ -649,7 +649,7 @@ static network_link_L07_t network_link_new(char *name,
   network_link_L07_t nw_link = xbt_new0(s_network_link_L07_t, 1);
 
 
-  nw_link->resource = (surf_resource_t) surf_workstation_resource;
+  nw_link->model = (surf_model_t) surf_workstation_model;
   nw_link->type = SURF_WORKSTATION_RESOURCE_LINK;
   nw_link->name = name;
   nw_link->bw_current = bw_initial;
@@ -818,83 +818,83 @@ static void parse_file(const char *file)
 /********* Module  creation ***********/
 /**************************************/
 
-static void resource_init_internal(void)
+static void model_init_internal(void)
 {
   s_surf_action_t action;
 
-  surf_workstation_resource = xbt_new0(s_surf_workstation_resource_t, 1);
+  surf_workstation_model = xbt_new0(s_surf_workstation_model_t, 1);
 
-  surf_workstation_resource->common_private =
-      xbt_new0(s_surf_resource_private_t, 1);
-  surf_workstation_resource->common_public =
-      xbt_new0(s_surf_resource_public_t, 1);
-  surf_workstation_resource->extension_public =
-      xbt_new0(s_surf_workstation_resource_extension_public_t, 1);
+  surf_workstation_model->common_private =
+      xbt_new0(s_surf_model_private_t, 1);
+  surf_workstation_model->common_public =
+      xbt_new0(s_surf_model_public_t, 1);
+  surf_workstation_model->extension_public =
+      xbt_new0(s_surf_workstation_model_extension_public_t, 1);
 
-  surf_workstation_resource->common_public->states.ready_action_set =
+  surf_workstation_model->common_public->states.ready_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.running_action_set =
+  surf_workstation_model->common_public->states.running_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.failed_action_set =
+  surf_workstation_model->common_public->states.failed_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
-  surf_workstation_resource->common_public->states.done_action_set =
+  surf_workstation_model->common_public->states.done_action_set =
       xbt_swag_new(xbt_swag_offset(action, state_hookup));
 
-  surf_workstation_resource->common_public->name_service = name_service;
-  surf_workstation_resource->common_public->get_resource_name =
-      get_resource_name;
-  surf_workstation_resource->common_public->action_get_state =
+  surf_workstation_model->common_public->name_service = name_service;
+  surf_workstation_model->common_public->get_model_name =
+      get_model_name;
+  surf_workstation_model->common_public->action_get_state =
       surf_action_get_state;
-  surf_workstation_resource->common_public->action_get_start_time =
+  surf_workstation_model->common_public->action_get_start_time =
       surf_action_get_start_time;
-  surf_workstation_resource->common_public->action_get_finish_time =
+  surf_workstation_model->common_public->action_get_finish_time =
       surf_action_get_finish_time;
-  surf_workstation_resource->common_public->action_use = action_use;
-  surf_workstation_resource->common_public->action_free = action_free;
-  surf_workstation_resource->common_public->action_cancel = action_cancel;
-  surf_workstation_resource->common_public->action_recycle =
+  surf_workstation_model->common_public->action_use = action_use;
+  surf_workstation_model->common_public->action_free = action_free;
+  surf_workstation_model->common_public->action_cancel = action_cancel;
+  surf_workstation_model->common_public->action_recycle =
       action_recycle;
-  surf_workstation_resource->common_public->action_change_state =
+  surf_workstation_model->common_public->action_change_state =
       surf_action_change_state;
-  surf_workstation_resource->common_public->action_set_data =
+  surf_workstation_model->common_public->action_set_data =
       surf_action_set_data;
-  surf_workstation_resource->common_public->suspend = action_suspend;
-  surf_workstation_resource->common_public->resume = action_resume;
-  surf_workstation_resource->common_public->is_suspended =
+  surf_workstation_model->common_public->suspend = action_suspend;
+  surf_workstation_model->common_public->resume = action_resume;
+  surf_workstation_model->common_public->is_suspended =
       action_is_suspended;
-  surf_workstation_resource->common_public->set_max_duration =
+  surf_workstation_model->common_public->set_max_duration =
       action_set_max_duration;
-  surf_workstation_resource->common_public->set_priority =
+  surf_workstation_model->common_public->set_priority =
       action_set_priority;
-  surf_workstation_resource->common_public->name = "Workstation ptask_L07";
+  surf_workstation_model->common_public->name = "Workstation ptask_L07";
 
-  surf_workstation_resource->common_private->resource_used = resource_used;
-  surf_workstation_resource->common_private->share_resources =
-      share_resources;
-  surf_workstation_resource->common_private->update_actions_state =
+  surf_workstation_model->common_private->model_used = model_used;
+  surf_workstation_model->common_private->share_models =
+      share_models;
+  surf_workstation_model->common_private->update_actions_state =
       update_actions_state;
-  surf_workstation_resource->common_private->update_resource_state =
-      update_resource_state;
-  surf_workstation_resource->common_private->finalize = finalize;
-
-  surf_workstation_resource->extension_public->execute = execute;
-  surf_workstation_resource->extension_public->sleep = action_sleep;
-  surf_workstation_resource->extension_public->get_state =
-      resource_get_state;
-  surf_workstation_resource->extension_public->get_speed = get_speed;
-  surf_workstation_resource->extension_public->get_available_speed =
+  surf_workstation_model->common_private->update_model_state =
+      update_model_state;
+  surf_workstation_model->common_private->finalize = finalize;
+
+  surf_workstation_model->extension_public->execute = execute;
+  surf_workstation_model->extension_public->sleep = action_sleep;
+  surf_workstation_model->extension_public->get_state =
+      model_get_state;
+  surf_workstation_model->extension_public->get_speed = get_speed;
+  surf_workstation_model->extension_public->get_available_speed =
       get_available_speed;
-  surf_workstation_resource->extension_public->communicate = communicate;
-  surf_workstation_resource->extension_public->execute_parallel_task =
+  surf_workstation_model->extension_public->communicate = communicate;
+  surf_workstation_model->extension_public->execute_parallel_task =
       execute_parallel_task;
-  surf_workstation_resource->extension_public->get_route = get_route;
-  surf_workstation_resource->extension_public->get_route_size =
+  surf_workstation_model->extension_public->get_route = get_route;
+  surf_workstation_model->extension_public->get_route_size =
       get_route_size;
-  surf_workstation_resource->extension_public->get_link_name =
+  surf_workstation_model->extension_public->get_link_name =
       get_link_name;
-  surf_workstation_resource->extension_public->get_link_bandwidth =
+  surf_workstation_model->extension_public->get_link_bandwidth =
       get_link_bandwidth;
-  surf_workstation_resource->extension_public->get_link_latency =
+  surf_workstation_model->extension_public->get_link_latency =
       get_link_latency;
 
   workstation_set = xbt_dict_new();
@@ -907,18 +907,18 @@ static void resource_init_internal(void)
 /**************************************/
 /*************** Generic **************/
 /**************************************/
-void surf_workstation_resource_init_ptask_L07(const char *filename)
+void surf_workstation_model_init_ptask_L07(const char *filename)
 {
-  xbt_assert0(!surf_cpu_resource, "CPU resource type already defined");
-  xbt_assert0(!surf_network_resource,
-             "network resource type already defined");
-  resource_init_internal();
+  xbt_assert0(!surf_cpu_model, "CPU model type already defined");
+  xbt_assert0(!surf_network_model,
+             "network model type already defined");
+  model_init_internal();
   parse_file(filename);
   WARN0("This model does not take latency into account.");
 
-  update_resource_description(surf_workstation_resource_description,
-                             surf_workstation_resource_description_size,
+  update_model_description(surf_workstation_model_description,
+                             surf_workstation_model_description_size,
                              "ptask_L07",
-                             (surf_resource_t) surf_workstation_resource);
-  xbt_dynar_push(resource_list, &surf_workstation_resource);
+                             (surf_model_t) surf_workstation_model);
+  xbt_dynar_push(model_list, &surf_workstation_model);
 }
index 36ebd7a..c13cd91 100644 (file)
@@ -52,29 +52,29 @@ void test(char *platform)
   e_surf_action_state_t stateActionC;
   double now = -1.0;
 
-  surf_cpu_resource_init_Cas01(platform);      /* Now it is possible to use CPUs */
-  surf_network_resource_init_CM02(platform);   /* Now it is possible to use eth0 */
+  surf_cpu_model_init_Cas01(platform); /* Now it is possible to use CPUs */
+  surf_network_model_init_CM02(platform);      /* Now it is possible to use eth0 */
 
   /*********************** CPU ***********************************/
-  DEBUG1("%p \n", surf_cpu_resource);
-  cpuA = surf_cpu_resource->common_public->name_service("Cpu A");
-  cpuB = surf_cpu_resource->common_public->name_service("Cpu B");
+  DEBUG1("%p \n", surf_cpu_model);
+  cpuA = surf_cpu_model->common_public->name_service("Cpu A");
+  cpuB = surf_cpu_model->common_public->name_service("Cpu B");
 
   /* Let's check that those two processors exist */
   DEBUG2("%s : %p\n",
-        surf_cpu_resource->common_public->get_resource_name(cpuA), cpuA);
+        surf_cpu_model->common_public->get_model_name(cpuA), cpuA);
   DEBUG2("%s : %p\n",
-        surf_cpu_resource->common_public->get_resource_name(cpuB), cpuB);
+        surf_cpu_model->common_public->get_model_name(cpuB), cpuB);
 
   /* Let's do something on it */
-  actionA = surf_cpu_resource->extension_public->execute(cpuA, 1000.0);
-  actionB = surf_cpu_resource->extension_public->execute(cpuB, 1000.0);
-  actionC = surf_cpu_resource->extension_public->sleep(cpuB, 7.32);
+  actionA = surf_cpu_model->extension_public->execute(cpuA, 1000.0);
+  actionB = surf_cpu_model->extension_public->execute(cpuB, 1000.0);
+  actionC = surf_cpu_model->extension_public->sleep(cpuB, 7.32);
 
   /* Use whatever calling style you want... */
-  stateActionA = surf_cpu_resource->common_public->action_get_state(actionA);  /* When you know actionA resource type */
-  stateActionB = actionB->resource_type->common_public->action_get_state(actionB);     /* If you're unsure about it's resource type */
-  stateActionC = surf_cpu_resource->common_public->action_get_state(actionC);  /* When you know actionA resource type */
+  stateActionA = surf_cpu_model->common_public->action_get_state(actionA);     /* When you know actionA model type */
+  stateActionB = actionB->model_type->common_public->action_get_state(actionB);        /* If you're unsure about it's model type */
+  stateActionC = surf_cpu_model->common_public->action_get_state(actionC);     /* When you know actionA model type */
 
   /* And just look at the state of these tasks */
   DEBUG2("actionA : %p (%s)\n", actionA, string_action(stateActionA));
@@ -82,21 +82,21 @@ void test(char *platform)
   DEBUG2("actionC : %p (%s)\n", actionB, string_action(stateActionC));
 
   /*********************** Network *******************************/
-  DEBUG1("%p \n", surf_network_resource);
-  cardA = surf_network_resource->common_public->name_service("Cpu A");
-  cardB = surf_network_resource->common_public->name_service("Cpu B");
+  DEBUG1("%p \n", surf_network_model);
+  cardA = surf_network_model->common_public->name_service("Cpu A");
+  cardB = surf_network_model->common_public->name_service("Cpu B");
 
   /* Let's check that those two processors exist */
   DEBUG2("%s : %p\n",
-        surf_network_resource->common_public->get_resource_name(cardA),
+        surf_network_model->common_public->get_model_name(cardA),
         cardA);
   DEBUG2("%s : %p\n",
-        surf_network_resource->common_public->get_resource_name(cardB),
+        surf_network_model->common_public->get_model_name(cardB),
         cardB);
 
   /* Let's do something on it */
   commAB =
-      surf_network_resource->extension_public->communicate(cardA, cardB,
+      surf_network_model->extension_public->communicate(cardA, cardB,
                                                           150.0,-1.0);
 
   surf_solve();                        /* Takes traces into account. Returns 0.0 */
@@ -106,29 +106,29 @@ void test(char *platform)
     DEBUG1("Next Event : " "%g" "\n", now);
     DEBUG0("\t CPU actions\n");
     while ((action =
-           xbt_swag_extract(surf_cpu_resource->common_public->states.
+           xbt_swag_extract(surf_cpu_model->common_public->states.
                             failed_action_set))) {
       DEBUG1("\t * Failed : %p\n", action);
-      action->resource_type->common_public->action_free(action);
+      action->model_type->common_public->action_free(action);
     }
     while ((action =
-           xbt_swag_extract(surf_cpu_resource->common_public->states.
+           xbt_swag_extract(surf_cpu_model->common_public->states.
                             done_action_set))) {
       DEBUG1("\t * Done : %p\n", action);
-      action->resource_type->common_public->action_free(action);
+      action->model_type->common_public->action_free(action);
     }
     DEBUG0("\t Network actions\n");
     while ((action =
-           xbt_swag_extract(surf_network_resource->common_public->states.
+           xbt_swag_extract(surf_network_model->common_public->states.
                             failed_action_set))) {
       DEBUG1("\t * Failed : %p\n", action);
-      action->resource_type->common_public->action_free(action);
+      action->model_type->common_public->action_free(action);
     }
     while ((action =
-           xbt_swag_extract(surf_network_resource->common_public->states.
+           xbt_swag_extract(surf_network_model->common_public->states.
                             done_action_set))) {
       DEBUG1("\t * Done : %p\n", action);
-      action->resource_type->common_public->action_free(action);
+      action->model_type->common_public->action_free(action);
     }
 
   } while (surf_solve()>=0.0);
index e3af4cf..443e5e1 100644 (file)
@@ -47,59 +47,59 @@ void test(char *platform)
   surf_action_t commAB = NULL;
   double now = -1.0;
 
-  surf_workstation_resource_init_CLM03(platform);
+  surf_workstation_model_init_CLM03(platform);
 
   /*********************** WORKSTATION ***********************************/
   workstationA =
-      surf_workstation_resource->common_public->name_service("Cpu A");
+      surf_workstation_model->common_public->name_service("Cpu A");
   workstationB =
-      surf_workstation_resource->common_public->name_service("Cpu B");
+      surf_workstation_model->common_public->name_service("Cpu B");
 
   /* Let's check that those two processors exist */
   DEBUG2("%s : %p\n",
-        surf_workstation_resource->common_public->
-        get_resource_name(workstationA), workstationA);
+        surf_workstation_model->common_public->
+        get_model_name(workstationA), workstationA);
   DEBUG2("%s : %p\n",
-        surf_workstation_resource->common_public->
-        get_resource_name(workstationB), workstationB);
+        surf_workstation_model->common_public->
+        get_model_name(workstationB), workstationB);
 
   /* Let's do something on it */
   actionA =
-      surf_workstation_resource->extension_public->execute(workstationA,
+      surf_workstation_model->extension_public->execute(workstationA,
                                                           1000.0);
   actionB =
-      surf_workstation_resource->extension_public->execute(workstationB,
+      surf_workstation_model->extension_public->execute(workstationB,
                                                           1000.0);
   actionC =
-      surf_workstation_resource->extension_public->sleep(workstationB,
+      surf_workstation_model->extension_public->sleep(workstationB,
                                                         7.32);
 
   commAB =
-      surf_workstation_resource->extension_public->
+      surf_workstation_model->extension_public->
       communicate(workstationA, workstationB, 150.0, -1.0);
 
   surf_solve();                        /* Takes traces into account. Returns 0.0 */
   do {
     surf_action_t action = NULL;
     int i;
-    surf_resource_t resource = NULL;
+    surf_model_t model = NULL;
 
     now = surf_get_clock();
     DEBUG1("Next Event : " "%g" "\n", now);
 
-    xbt_dynar_foreach(resource_list, i, resource) {
-      DEBUG1("\t %s actions\n", resource->common_public->name);
+    xbt_dynar_foreach(model_list, i, model) {
+      DEBUG1("\t %s actions\n", model->common_public->name);
       while ((action =
-            xbt_swag_extract(resource->common_public->states.
+            xbt_swag_extract(model->common_public->states.
                              failed_action_set))) {
        DEBUG1("\t * Failed : %p\n", action);
-       resource->common_public->action_free(action);
+       model->common_public->action_free(action);
       }
       while ((action =
-            xbt_swag_extract(resource->common_public->states.
+            xbt_swag_extract(model->common_public->states.
                              done_action_set))) {
        DEBUG1("\t * Done : %p\n", action);
-       resource->common_public->action_free(action);
+       model->common_public->action_free(action);
       }
     }
   } while (surf_solve()>=0.0);