- action->latency *= (*latency_factor_callback)(size);
- action->rate = (*bandwidth_constraint_callback)(action->rate, bandwidth_bound, size);
-
- /* LARGE PLATFORMS HACK:
- lmm_variable_new(..., total_route_size) */
- if (action->latency > 0)
- action->variable =
- lmm_variable_new(network_maxmin_system, action, 0.0, -1.0,
- xbt_dynar_length(route));
- else
- action->variable =
- lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,
- xbt_dynar_length(route));
+ action->latency *= latency_factor_callback(size);
+ action->rate =
+ bandwidth_constraint_callback(action->rate, bandwidth_bound, size);
+ if (gap_append) {
+ xbt_assert(!xbt_dynar_is_empty(route),
+ "Using a model with a gap (e.g., SMPI) with a platform without links (e.g. vivaldi)!!!");
+
+ link = *(link_CM02_t *) xbt_dynar_get_ptr(route, 0);
+ gap_append(size, link, action);
+ XBT_DEBUG("Comm %p: %s -> %s gap=%f (lat=%f)",
+ action, src->name, dst->name, action->sender.gap,
+ action->latency);
+ }
+
+ constraints_per_variable = xbt_dynar_length(route);
+ if (back_route != NULL)
+ constraints_per_variable += xbt_dynar_length(back_route);
+
+ if (action->latency > 0) {
+ GENERIC_LMM_ACTION(action).variable =
+ lmm_variable_new(surf_network_model->model_private->maxmin_system, action, 0.0, -1.0,
+ constraints_per_variable);
+ if (surf_network_model->model_private->update_mechanism == UM_LAZY) {
+ // add to the heap the event when the latency is payed
+ XBT_DEBUG("Added action (%p) one latency event at date %f", action,
+ action->latency + GENERIC_LMM_ACTION(action).last_update);
+ surf_action_lmm_heap_insert(surf_network_model->model_private->action_heap,(surf_action_lmm_t)action, action->latency + GENERIC_LMM_ACTION(action).last_update,
+ xbt_dynar_is_empty(route) ? NORMAL : LATENCY);
+ }
+ } else
+ GENERIC_LMM_ACTION(action).variable =
+ lmm_variable_new(surf_network_model->model_private->maxmin_system, action, 1.0, -1.0,
+ constraints_per_variable);