-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) {
-/* VOIRD(action->src->id); */
-/* VOIRD(action->dst->id); */
-/* VOIRP(&ROUTE(action->src->id,action->dst->id)); */
-/* VOIRG(ROUTE(action->src->id,action->dst->id).impact_on_src); */
- scale -= ROUTE(action->src->id,action->dst->id).impact_on_src *
- lmm_variable_getvalue(action->variable);
- }
- if(scale<0.0) scale=0.0;
- 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);
- }
- if(scale<0.0) scale=0.0;
- 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);
- }
- if(scale<0.0) scale=0.1;
- xbt_assert0(scale>=0.0,"Negative interference !");
- }
- lmm_update_constraint_bound(maxmin_system_cpu_KCCFLN05,workstation->constraint,
- W*scale);
- }
+ xbt_dynar_push(card_src->outgoing_communications, &action);
+ xbt_dynar_push(card_dst->incomming_communications, &action);
+
+ xbt_swag_insert(action, action->generic_action.state_set);
+ action->rate = rate;
+
+ action->latency = 0.0;
+ for (i = 0; i < route_size; i++)
+ action->latency += route->links[i]->lat_current;
+ action->lat_current = action->latency;
+
+ if(action->latency>0)
+ action->variable = lmm_variable_new(maxmin_system, action, 0.0, -1.0,
+ route_size+4); /* +1 for the src bus
+ +1 for the dst bus
+ +1 for the src cpu
+ +1 for the dst cpu */
+ else
+ action->variable = lmm_variable_new(maxmin_system, action, 1.0, -1.0,
+ route_size+4);