Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change the prototype for update_resource_state.
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 20 May 2008 09:58:11 +0000 (09:58 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 20 May 2008 09:58:11 +0000 (09:58 +0000)
Now that update_resource_state also takes care of failed actions, it
is mendatory to get correct informations about action's finish time.

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5445 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/cpu.c
src/surf/network.c
src/surf/network_constant.c
src/surf/surf.c
src/surf/surf_private.h
src/surf/surf_timer.c
src/surf/workstation.c
src/surf/workstation_ptask_L07.c

index ebb3c1e..ab19f4a 100644 (file)
@@ -229,7 +229,7 @@ static void update_actions_state(double now, double delta)
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
-                                 double value)
+                                 double value, double date)
 {
   cpu_Cas01_t cpu = id;
 
 {
   cpu_Cas01_t cpu = id;
 
@@ -252,7 +252,7 @@ static void update_resource_state(void *id,
 
        if(surf_action_get_state(action)==SURF_ACTION_RUNNING ||
           surf_action_get_state(action)==SURF_ACTION_READY) {
 
        if(surf_action_get_state(action)==SURF_ACTION_RUNNING ||
           surf_action_get_state(action)==SURF_ACTION_READY) {
-         action->finish = surf_get_clock(); // BUG! Wrong value here
+         action->finish = date;
          action_change_state( action, SURF_ACTION_FAILED);
        }
       }
          action_change_state( action, SURF_ACTION_FAILED);
        }
       }
index 840ad3e..14c6c2c 100644 (file)
@@ -458,7 +458,7 @@ static void update_actions_state(double now, double delta)
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
-                                 double value)
+                                 double value, double date)
 {
   link_CM02_t nw_link = id;
   /*   printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
 {
   link_CM02_t nw_link = id;
   /*   printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
index b14662a..36664cc 100644 (file)
@@ -199,7 +199,7 @@ static void update_actions_state(double now, double delta)
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
-                                 double value)
+                                 double value, double time)
 {
   DIE_IMPOSSIBLE;
 }
 {
   DIE_IMPOSSIBLE;
 }
index ac8040c..d85df52 100644 (file)
@@ -472,7 +472,7 @@ void surf_presolve(void) {
                                              &value,
                                              (void **) &model_obj))) {
        model_obj->model->common_private->
                                              &value,
                                              (void **) &model_obj))) {
        model_obj->model->common_private->
-           update_resource_state(model_obj, event, value);
+         update_resource_state(model_obj, event, value,NOW);
       }
     }
     xbt_dynar_foreach(model_list, iter, model) {
       }
     }
     xbt_dynar_foreach(model_list, iter, model) {
@@ -529,7 +529,7 @@ double surf_solve(void)
       /* update state of model_obj according to new value. Does not touch lmm.
          It will be modified if needed when updating actions */
       model_obj->model->common_private->
       /* update state of model_obj according to new value. Does not touch lmm.
          It will be modified if needed when updating actions */
       model_obj->model->common_private->
-         update_resource_state(model_obj, event, value);
+       update_resource_state(model_obj, event, value,NOW+min);
     }
   }
 
     }
   }
 
index 9a25508..21de0d3 100644 (file)
@@ -38,7 +38,7 @@ typedef struct surf_model_private {
   /* Update the actions' state */
   void (*update_actions_state) (double now, double delta);
   void (*update_resource_state) (void *id, tmgr_trace_event_t event_type,
   /* Update the actions' state */
   void (*update_actions_state) (double now, double delta);
   void (*update_resource_state) (void *id, tmgr_trace_event_t event_type,
-                                double value);
+                                double value, double time);
   void (*finalize) (void);
 } s_surf_model_private_t;
 
   void (*finalize) (void);
 } s_surf_model_private_t;
 
index 3a7463b..d61560c 100644 (file)
@@ -115,7 +115,7 @@ static void update_actions_state(double now, double delta)
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
-                                 double value)
+                                 double value, double date)
 {
   command_t command = id;
 
 {
   command_t command = id;
 
index 733aac7..56650d5 100644 (file)
@@ -159,7 +159,7 @@ static void update_actions_state(double now, double delta)
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
-                                 double value)
+                                 double value, double date)
 {
   THROW_IMPOSSIBLE; /* This model does not implement parallel tasks */
 }
 {
   THROW_IMPOSSIBLE; /* This model does not implement parallel tasks */
 }
index 6c68352..cb8022d 100644 (file)
@@ -361,7 +361,7 @@ static void update_actions_state(double now, double delta)
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
 
 static void update_resource_state(void *id,
                                  tmgr_trace_event_t event_type,
-                                 double value)
+                                 double value, double date)
 {
   cpu_L07_t cpu = id;
   link_L07_t nw_link = id;
 {
   cpu_L07_t cpu = id;
   link_L07_t nw_link = id;