From ea2730242c0c2b01ee200a9f1aecd2c4686eb7f2 Mon Sep 17 00:00:00 2001 From: alegrand Date: Tue, 20 May 2008 09:58:11 +0000 Subject: [PATCH] Change the prototype for update_resource_state. 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 | 4 ++-- src/surf/network.c | 2 +- src/surf/network_constant.c | 2 +- src/surf/surf.c | 4 ++-- src/surf/surf_private.h | 2 +- src/surf/surf_timer.c | 2 +- src/surf/workstation.c | 2 +- src/surf/workstation_ptask_L07.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/surf/cpu.c b/src/surf/cpu.c index ebb3c1ea94..ab19f4a11f 100644 --- a/src/surf/cpu.c +++ b/src/surf/cpu.c @@ -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, - double value) + double value, double date) { 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) { - action->finish = surf_get_clock(); // BUG! Wrong value here + action->finish = date; action_change_state( action, SURF_ACTION_FAILED); } } diff --git a/src/surf/network.c b/src/surf/network.c index 840ad3eaa6..14c6c2ca1d 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -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, - double value) + double value, double date) { link_CM02_t nw_link = id; /* printf("[" "%lg" "] Asking to update network card \"%s\" with value " */ diff --git a/src/surf/network_constant.c b/src/surf/network_constant.c index b14662a14b..36664cc3a9 100644 --- a/src/surf/network_constant.c +++ b/src/surf/network_constant.c @@ -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, - double value) + double value, double time) { DIE_IMPOSSIBLE; } diff --git a/src/surf/surf.c b/src/surf/surf.c index ac8040c73a..d85df52fa6 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -472,7 +472,7 @@ void surf_presolve(void) { &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) { @@ -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_resource_state(model_obj, event, value); + update_resource_state(model_obj, event, value,NOW+min); } } diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 9a25508778..21de0d3ac5 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -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, - double value); + double value, double time); void (*finalize) (void); } s_surf_model_private_t; diff --git a/src/surf/surf_timer.c b/src/surf/surf_timer.c index 3a7463b235..d61560c285 100644 --- a/src/surf/surf_timer.c +++ b/src/surf/surf_timer.c @@ -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, - double value) + double value, double date) { command_t command = id; diff --git a/src/surf/workstation.c b/src/surf/workstation.c index 733aac7b8e..56650d5e06 100644 --- a/src/surf/workstation.c +++ b/src/surf/workstation.c @@ -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, - double value) + double value, double date) { THROW_IMPOSSIBLE; /* This model does not implement parallel tasks */ } diff --git a/src/surf/workstation_ptask_L07.c b/src/surf/workstation_ptask_L07.c index 6c68352b67..cb8022d910 100644 --- a/src/surf/workstation_ptask_L07.c +++ b/src/surf/workstation_ptask_L07.c @@ -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, - double value) + double value, double date) { cpu_L07_t cpu = id; link_L07_t nw_link = id; -- 2.20.1