A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Today Martin Quinson wrote :
[simgrid.git]
/
src
/
surf
/
cpu.c
diff --git
a/src/surf/cpu.c
b/src/surf/cpu.c
index
5a5dc18
..
8e087a9
100644
(file)
--- a/
src/surf/cpu.c
+++ b/
src/surf/cpu.c
@@
-31,6
+31,7
@@
static cpu_t cpu_new(char *name, double power_scale,
cpu->resource = (surf_resource_t) surf_cpu_resource;
cpu->name = name;
cpu->power_scale = power_scale;
cpu->resource = (surf_resource_t) surf_cpu_resource;
cpu->name = name;
cpu->power_scale = power_scale;
+ xbt_assert0(cpu->power_scale>0,"Power has to be >0");
cpu->power_current = power_initial;
if (power_trace)
cpu->power_event =
cpu->power_current = power_initial;
if (power_trace)
cpu->power_event =
@@
-105,10
+106,9
@@
static int resource_used(void *resource_id)
static void action_free(surf_action_t action)
{
static void action_free(surf_action_t action)
{
- surf_action_cpu_t Action = (surf_action_cpu_t) action;
-
xbt_swag_remove(action, action->state_set);
xbt_swag_remove(action, action->state_set);
- lmm_variable_free(maxmin_system, Action->variable);
+ if(((surf_action_cpu_t)action)->variable)
+ lmm_variable_free(maxmin_system, ((surf_action_cpu_t)action)->variable);
xbt_free(action);
return;
xbt_free(action);
return;
@@
-127,6
+127,12
@@
static void action_recycle(surf_action_t action)
static void action_change_state(surf_action_t action,
e_surf_action_state_t state)
{
static void action_change_state(surf_action_t action,
e_surf_action_state_t state)
{
+ if((state==SURF_ACTION_DONE) || (state==SURF_ACTION_FAILED))
+ if(((surf_action_cpu_t)action)->variable) {
+ lmm_variable_disable(maxmin_system, ((surf_action_cpu_t)action)->variable);
+ ((surf_action_cpu_t)action)->variable = NULL;
+ }
+
surf_action_change_state(action, state);
return;
}
surf_action_change_state(action, state);
return;
}
@@
-179,9
+185,9
@@
static void update_actions_state(double now, double delta)
}
}
}
}
- xbt_swag_foreach_safe(action, next_action, failed_actions) {
- lmm_variable_disable(maxmin_system, action->variable);
- }
+/* xbt_swag_foreach_safe(action, next_action, failed_actions) { */
+/* lmm_variable_disable(maxmin_system, action->variable); */
+/* } */
return;
}
return;
}