+ DEBUG3("Action (%p) : remains (%g) updated by %g.",
+ action, action->generic_action.remains,
+ lmm_variable_getvalue(action->variable) * deltap);
+ double_update(&(action->generic_action.remains),
+ lmm_variable_getvalue(action->variable) * deltap);
+
+ if (action->generic_action.max_duration != NO_MAX_DURATION)
+ double_update(&(action->generic_action.max_duration), delta);
+
+ if ((action->generic_action.remains <= 0) &&
+ (lmm_get_variable_weight(action->variable) > 0)) {
+ action->generic_action.finish = surf_get_clock();
+ surf_action_change_state((surf_action_t) action, SURF_ACTION_DONE);
+ } else if ((action->generic_action.max_duration != NO_MAX_DURATION) &&
+ (action->generic_action.max_duration <= 0)) {
+ 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 */
+ lmm_constraint_t cnst = NULL;
+ int i = 0;
+ void *constraint_id = NULL;
+
+ while ((cnst =
+ lmm_get_cnst_from_var(maxmin_system, action->variable,
+ i++))) {
+ constraint_id = lmm_constraint_id(cnst);
+
+/* if(((link_KCCFLN05_t)constraint_id)->type== */
+/* SURF_WORKSTATION_RESOURCE_LINK) { */
+/* DEBUG2("Checking for link %s (%p)", */
+/* ((link_KCCFLN05_t)constraint_id)->name, */
+/* ((link_KCCFLN05_t)constraint_id)); */
+/* } */
+/* if(((cpu_KCCFLN05_t)constraint_id)->type== */
+/* SURF_WORKSTATION_RESOURCE_CPU) { */
+/* DEBUG3("Checking for cpu %s (%p) : %s", */
+/* ((cpu_KCCFLN05_t)constraint_id)->name, */
+/* ((cpu_KCCFLN05_t)constraint_id), */
+/* ((cpu_KCCFLN05_t)constraint_id)->state_current==SURF_CPU_OFF?"Off":"On"); */
+/* } */
+
+ if (((((link_KCCFLN05_t) constraint_id)->type ==
+ SURF_WORKSTATION_RESOURCE_LINK) &&
+ (((link_KCCFLN05_t) constraint_id)->state_current ==
+ SURF_LINK_OFF)) ||
+ ((((cpu_KCCFLN05_t) constraint_id)->type ==
+ SURF_WORKSTATION_RESOURCE_CPU) &&
+ (((cpu_KCCFLN05_t) constraint_id)->state_current ==
+ SURF_CPU_OFF))) {
+ DEBUG1("Action (%p) Failed!!", action);
+ action->generic_action.finish = surf_get_clock();
+ surf_action_change_state((surf_action_t) action,
+ SURF_ACTION_FAILED);
+ break;
+ }