X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/70932eb2dbde8adfe4cd1d7579501c6605bf6a53..841d5e83050a1c7a247ab9edfc5e3185663d996d:/src/surf/workstation_KCCFLN05.c diff --git a/src/surf/workstation_KCCFLN05.c b/src/surf/workstation_KCCFLN05.c index e88efa8746..f3c9115c39 100644 --- a/src/surf/workstation_KCCFLN05.c +++ b/src/surf/workstation_KCCFLN05.c @@ -268,6 +268,11 @@ static void parse_route_set_endpoints(void) { 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; } @@ -465,6 +470,13 @@ static void action_cpu_KCCFLN05_free(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; @@ -489,6 +501,10 @@ static double share_cpu_KCCFLN05_resources(double now) (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); } @@ -602,19 +618,33 @@ static surf_action_t execute_KCCFLN05(void *cpu, double size) static void cpu_KCCFLN05_action_suspend(surf_action_t action) { - lmm_update_variable_weight(maxmin_system_cpu_KCCFLN05, - ((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_cpu_KCCFLN05, - ((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 ************/