Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move action_ref one layer up: not a model method anymore, but function surf_action_re...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 1 Jul 2009 20:31:13 +0000 (20:31 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 1 Jul 2009 20:31:13 +0000 (20:31 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6427 48e7efb5-ca39-0410-a469-dd3cf9ba447f

ChangeLog
src/include/surf/surf.h
src/surf/cpu.c
src/surf/network.c
src/surf/network_constant.c
src/surf/network_gtnets.c
src/surf/surf_action.c
src/surf/workstation.c
src/surf/workstation_ptask_L07.c

index d6bb2fe..0f14722 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,9 +22,10 @@ SimGrid (3.3.2-svn) unstable; urgency=low
     TODO: integrate the properties into that ancestor
   * Rename model methods:
     action_free -> action_unref
-    action_use  -> action_ref
     action_change_state -> action_state_set
     action_get_state    -> action_state_get
+  * Change model methods into classical functions:
+    action_use  -> surf_action_ref
     
  XBT:
   * Add xbt_set_get_by_name_or_null() [Silas De Munck]
index 12bcb41..90f7069 100644 (file)
@@ -28,7 +28,10 @@ SG_BEGIN_DECL()
  *
  * \see e_surf_action_state_t
  */
-     typedef struct surf_action *surf_action_t;
+typedef struct surf_action *surf_action_t;
+/** @Brief Specify that we use that action */
+XBT_PUBLIC(void) surf_action_ref(surf_action_t action);
+
 
 /** \brief Model datatype
  *  \ingroup SURF_models
@@ -217,7 +220,6 @@ XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table,
 
        double (*action_get_start_time) (surf_action_t action);/**< Return the start time of an action */
        double (*action_get_finish_time) (surf_action_t action);/**< Return the finish time of an action */
-       void (*action_ref) (surf_action_t action);/**< Specify that we use that action */
        int (*action_unref) (surf_action_t action);/**< Specify that we don't use that action anymore */
        void (*action_cancel) (surf_action_t action);/**< Cancel a running action */
        void (*action_recycle) (surf_action_t action);/**< Recycle an action */
index ea6af9f..7f26a7c 100644 (file)
@@ -148,11 +148,6 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
-static void action_ref(surf_action_t action)
-{
-  action->refcount++;
-}
-
 static void action_cancel(surf_action_t action)
 {
   surf_action_state_set(action, SURF_ACTION_FAILED);
@@ -402,7 +397,6 @@ static void surf_cpu_model_init_internal(void)
   surf_cpu_model->name = "CPU";
 
   surf_cpu_model->action_unref = action_unref;
-  surf_cpu_model->action_ref = action_ref;
   surf_cpu_model->action_cancel = action_cancel;
   surf_cpu_model->action_state_set = cpu_action_state_set;
 
index f0c5e32..e308f36 100644 (file)
@@ -314,11 +314,6 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
-static void action_ref(surf_action_t action)
-{
-  action->refcount++;
-}
-
 static void action_cancel(surf_action_t action)
 {
   return;
@@ -668,7 +663,6 @@ static void surf_network_model_init_internal(void)
 
   surf_network_model->name = "network";
   surf_network_model->action_unref = action_unref;
-  surf_network_model->action_ref = action_ref;
   surf_network_model->action_cancel = action_cancel;
   surf_network_model->action_recycle = action_recycle;
 
index 2c91cc3..2ee4451 100644 (file)
@@ -96,11 +96,6 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
-static void action_ref(surf_action_t action)
-{
-  action->refcount++;
-}
-
 static void action_cancel(surf_action_t action)
 {
   return;
@@ -274,7 +269,6 @@ static void surf_network_model_init_internal(void)
 
   surf_network_model->name = "network constant";
   surf_network_model->action_unref = action_unref;
-  surf_network_model->action_ref = action_ref;
   surf_network_model->action_cancel = action_cancel;
   surf_network_model->action_recycle = action_recycle;
 
index 6ed902d..c00a72e 100644 (file)
@@ -325,20 +325,15 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
-static void action_ref(surf_action_t action)
-{
-  action->refcount++;
-}
-
 static void action_cancel(surf_action_t action)
 {
-  xbt_assert0(0, "Cannot cancel GTNetS flow");
+  xbt_die("Cannot cancel GTNetS flow");
   return;
 }
 
 static void action_recycle(surf_action_t action)
 {
-  xbt_assert0(0, "Cannot recycle GTNetS flow");
+  xbt_die("Cannot recycle GTNetS flow");
   return;
 }
 
@@ -530,7 +525,6 @@ static void surf_network_model_init_internal(void)
   surf_network_model = surf_model_init();
 
   surf_network_model->name = "network GTNetS";
-  surf_network_model->action_ref = action_ref;
   surf_network_model->action_unref = action_unref;
   surf_network_model->action_cancel = action_cancel;
   surf_network_model->action_recycle = action_recycle;
index 173f5c5..431baa6 100644 (file)
@@ -75,3 +75,8 @@ void surf_action_data_set(surf_action_t action, void *data)
 {
   action->data = data;
 }
+
+void surf_action_ref(surf_action_t action)
+{
+  action->refcount++;
+}
index 54f40fa..1ce1f71 100644 (file)
@@ -63,11 +63,6 @@ static int parallel_action_free(surf_action_t action)
   THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
 }
 
-static void parallel_action_use(surf_action_t action)
-{
-  THROW_UNIMPLEMENTED;          /* This model does not implement parallel tasks */
-}
-
 static int action_unref(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
@@ -81,19 +76,6 @@ static int action_unref(surf_action_t action)
   return 0;
 }
 
-static void action_ref(surf_action_t action)
-{
-  if (action->model_type == surf_network_model)
-    surf_network_model->action_ref(action);
-  else if (action->model_type == surf_cpu_model)
-    surf_cpu_model->action_ref(action);
-  else if (action->model_type == surf_workstation_model)
-    parallel_action_use(action);
-  else
-    DIE_IMPOSSIBLE;
-  return;
-}
-
 static void action_cancel(surf_action_t action)
 {
   if (action->model_type == surf_network_model)
@@ -291,7 +273,6 @@ static void surf_workstation_model_init_internal(void)
 
   surf_workstation_model->name = "Workstation";
   surf_workstation_model->action_unref = action_unref;
-  surf_workstation_model->action_ref = action_ref;
   surf_workstation_model->action_cancel = action_cancel;
   surf_workstation_model->action_state_set = ws_action_state_set;
 
index 0b81b79..666d7d7 100644 (file)
@@ -127,14 +127,6 @@ static xbt_dict_t get_properties(void *r)
   return ((cpu_L07_t) r)->properties;
 }
 
-/* action_get_state is inherited from the surf module */
-
-static void action_ref(surf_action_t action)
-{
-  action->refcount++;
-  return;
-}
-
 static int action_unref(surf_action_t action)
 {
   action->refcount--;
@@ -985,7 +977,6 @@ static void model_init_internal(void)
 {
   surf_workstation_model = surf_model_init();
 
-  surf_workstation_model->action_ref = action_ref;
   surf_workstation_model->action_unref = action_unref;
   surf_workstation_model->action_cancel = action_cancel;
   surf_workstation_model->action_state_set = surf_action_state_set;