static void parse_workstation(void)
{
- char *name = NULL;
double power_scale = 0.0;
double power_initial = 0.0;
tmgr_trace_t power_trace = NULL;
double interference_recv = 0.0;
double interference_send_recv = 0.0;
- name = xbt_strdup(A_cpu_name);
surf_parse_get_double(&power_scale,A_cpu_power);
surf_parse_get_double(&power_initial,A_cpu_availability);
surf_parse_get_trace(&power_trace,A_cpu_availability_file);
surf_parse_get_double(&interference_recv,A_cpu_interference_recv);
surf_parse_get_double(&interference_send_recv,A_cpu_interference_send_recv);
- workstation_new(name, power_scale, power_initial, power_trace, state_initial,
+ workstation_new(A_cpu_name, power_scale, power_initial, power_trace, state_initial,
state_trace, interference_send, interference_recv,
interference_send_recv);
}
static int cpu_used(void *resource_id)
{
- return lmm_constraint_used(maxmin_system,
+ return lmm_constraint_used(maxmin_system_cpu_KCCFLN05,
((workstation_KCCFLN05_t) resource_id)->constraint);
}
{
src_id = ((workstation_KCCFLN05_t) name_service(A_route_src))->id;
dst_id = ((workstation_KCCFLN05_t) name_service(A_route_dst))->id;
+ surf_parse_get_double(&impact_on_src,A_route_impact_on_src);
+ surf_parse_get_double(&impact_on_dst,A_route_impact_on_dst);
+ surf_parse_get_double(&impact_on_src_with_other_recv,A_route_impact_on_src_with_other_recv);
+ surf_parse_get_double(&impact_on_dst_with_other_send,A_route_impact_on_dst_with_other_send);
+
nb_link = 0;
link_name = NULL;
}
xbt_dynar_foreach (src->outgoing_communications,cpt,act) {
if(act==action) {
- xbt_dynar_remove_at(src->outgoing_communications, cpt, act);
+ xbt_dynar_remove_at(src->outgoing_communications, cpt, &act);
break;
}
}
xbt_dynar_foreach (dst->incomming_communications,cpt,act) {
if(act==action) {
- xbt_dynar_remove_at(dst->incomming_communications, cpt, act);
+ xbt_dynar_remove_at(dst->incomming_communications, cpt, &act);
break;
}
}
lmm_expand(maxmin_system_network_KCCFLN05, route->links[i]->constraint,
action->variable, 1.0);
- xbt_dynar_push(card_src->outgoing_communications,action);
- xbt_dynar_push(card_dst->incomming_communications,action);
+ action->src=src;
+ action->dst=dst;
+
+ xbt_dynar_push(card_src->outgoing_communications,&action);
+ xbt_dynar_push(card_dst->incomming_communications,&action);
return (surf_action_t) action;
}
xbt_free(action);
}
+/* #define WARNING(format, ...) (fprintf(stderr, "[%s , %s : %d] ", __FILE__, __FUNCTION__, __LINE__),\ */
+/* fprintf(stderr, format, ## __VA_ARGS__), \ */
+/* fprintf(stderr, "\n")) */
+/* #define VOIRP(expr) WARNING(" {" #expr " = %p }", expr) */
+/* #define VOIRD(expr) WARNING(" {" #expr " = %d }", expr) */
+/* #define VOIRG(expr) WARNING(" {" #expr " = %lg }", expr) */
+
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 value = share_network_KCCFLN05_resources(now);
double W=0.0;
double scale=0.0;
int cpt;
(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);
}
surf_cpu_resource->common_public->states.failed_action_set;
xbt_swag_insert(action, action->generic_action.state_set);
- action->variable = lmm_variable_new(maxmin_system, action, 1.0, -1.0, 1);
- lmm_expand(maxmin_system, CPU->constraint, action->variable,
+ action->variable = lmm_variable_new(maxmin_system_cpu_KCCFLN05, action, 1.0, -1.0, 1);
+ lmm_expand(maxmin_system_cpu_KCCFLN05, CPU->constraint, action->variable,
1.0);
return (surf_action_t) action;
static void cpu_KCCFLN05_action_suspend(surf_action_t action)
{
- lmm_update_variable_weight(maxmin_system,
- ((surf_action_cpu_KCCFLN05_t) action)->variable, 0.0);
+ if(action->resource_type==(surf_resource_t)surf_network_resource)
+ lmm_update_variable_weight(maxmin_system_network_KCCFLN05,
+ ((surf_action_network_KCCFLN05_t) action)->variable, 0.0);
+ else if(action->resource_type==(surf_resource_t)surf_cpu_resource)
+ lmm_update_variable_weight(maxmin_system_cpu_KCCFLN05,
+ ((surf_action_cpu_KCCFLN05_t) action)->variable, 0.0);
+ else DIE_IMPOSSIBLE;
}
static void cpu_KCCFLN05_action_resume(surf_action_t action)
{
- lmm_update_variable_weight(maxmin_system,
- ((surf_action_cpu_KCCFLN05_t) action)->variable, 1.0);
+ if(action->resource_type==(surf_resource_t)surf_network_resource)
+ lmm_update_variable_weight(maxmin_system_network_KCCFLN05,
+ ((surf_action_network_KCCFLN05_t) action)->variable, 1.0);
+ else if(action->resource_type==(surf_resource_t)surf_cpu_resource)
+ lmm_update_variable_weight(maxmin_system_cpu_KCCFLN05,
+ ((surf_action_cpu_KCCFLN05_t) action)->variable, 1.0);
+ else DIE_IMPOSSIBLE;
}
static int cpu_KCCFLN05_action_is_suspended(surf_action_t action)
{
- return (lmm_get_variable_weight(((surf_action_cpu_KCCFLN05_t) action)->variable) == 0.0);
+ if(action->resource_type==(surf_resource_t)surf_network_resource)
+ return (lmm_get_variable_weight(((surf_action_cpu_KCCFLN05_t) action)->variable) == 0.0);
+ if(action->resource_type==(surf_resource_t)surf_cpu_resource)
+ return (lmm_get_variable_weight(((surf_action_network_KCCFLN05_t) action)->variable) == 0.0);
+ DIE_IMPOSSIBLE;
}
/************* workstation ************/
xbt_dynar_push(resource_list, &surf_network_resource);
xbt_dynar_push(resource_list, &surf_cpu_resource);
xbt_dynar_push(resource_list, &surf_workstation_resource);
+
+ if (maxmin_system) { /* To avoid using this useless system */
+ lmm_system_free(maxmin_system);
+ maxmin_system = NULL;
+ }
}