-/***************** CPU ****************/
-static void action_cpu_KCCFLN05_free(surf_action_t action)
-{
- xbt_swag_remove(action, action->state_set);
- lmm_variable_free(maxmin_system_cpu_KCCFLN05, ((surf_action_cpu_KCCFLN05_t)action)->variable);
- xbt_free(action);
-}
-
-static double share_cpu_KCCFLN05_resources(double now)
-{
- s_surf_action_cpu_KCCFLN05_t s_cpu_action;
- lmm_constraint_t cnst = NULL;
- workstation_KCCFLN05_t workstation = NULL;
- double W=0.0;
- double scale=0.0;
- int cpt;
- surf_action_network_KCCFLN05_t action;
-
- for(cnst = lmm_get_first_active_constraint(maxmin_system_cpu_KCCFLN05);
- cnst;
- cnst= lmm_get_next_active_constraint(maxmin_system_cpu_KCCFLN05, cnst))
- {
- workstation = lmm_constraint_id(cnst);
- W=workstation->power_current * workstation->power_scale;
-
- if((!xbt_dynar_length(workstation->incomming_communications)) &&
- (!xbt_dynar_length(workstation->outgoing_communications))) {
- scale = 1.0;
- } else if((!xbt_dynar_length(workstation->incomming_communications)) &&
- (xbt_dynar_length(workstation->outgoing_communications))) {
- scale = workstation->interference_send;
- xbt_dynar_foreach (workstation->outgoing_communications,cpt,action) {
- scale -= ROUTE(action->src->id,action->dst->id).impact_on_src *
- lmm_variable_getvalue(action->variable);
- }
- xbt_assert0(scale>0.0,"Negative interference !");
- } else if((xbt_dynar_length(workstation->incomming_communications)) &&
- (!xbt_dynar_length(workstation->outgoing_communications))) {
- scale = workstation->interference_recv;
- xbt_dynar_foreach (workstation->incomming_communications,cpt,action) {
- scale -= ROUTE(action->src->id,action->dst->id).impact_on_dst *
- lmm_variable_getvalue(action->variable);
- }
- xbt_assert0(scale>0.0,"Negative interference !");
- } else {
- scale = workstation->interference_send_recv;
- xbt_dynar_foreach (workstation->outgoing_communications,cpt,action) {
- scale -= ROUTE(action->src->id,action->dst->id).impact_on_src_with_other_recv *
- lmm_variable_getvalue(action->variable);
- }
- xbt_dynar_foreach (workstation->incomming_communications,cpt,action) {
- scale -= ROUTE(action->src->id,action->dst->id).impact_on_dst_with_other_send *
- lmm_variable_getvalue(action->variable);
- }
- xbt_assert0(scale>0.0,"Negative interference !");
- }
- lmm_update_constraint_bound(maxmin_system_cpu_KCCFLN05,workstation->constraint,
- W*scale);
- }