X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/51dcb8e712855f3cb16800ddea745ef6fc8d79e9..f150764ab6d151957355c437ad66146210cbf8f9:/src/surf/network.c diff --git a/src/surf/network.c b/src/surf/network.c index b83aeee980..d521acfb60 100644 --- a/src/surf/network.c +++ b/src/surf/network.c @@ -6,7 +6,7 @@ * highly dependent on the maxmin lmm module. */ -/* Copyright (c) 2009, 2010, 2011. The SimGrid Team. +/* Copyright (c) 2004-2013. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -126,12 +126,12 @@ static double smpi_bandwidth_factor(double size) double current=1.0; xbt_dynar_foreach(smpi_bw_factor, iter, fact) { if (size <= fact.factor) { - XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current); return current; }else current=fact.value; } - XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f > %ld return %f", size, fact.factor, current); return current; } @@ -147,12 +147,12 @@ static double smpi_latency_factor(double size) double current=1.0; xbt_dynar_foreach(smpi_lat_factor, iter, fact) { if (size <= fact.factor) { - XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f <= %ld return %f", size, fact.factor, current); return current; }else current=fact.value; } - XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current); + XBT_DEBUG("%f > %ld return %f", size, fact.factor, current); return current; } @@ -379,8 +379,8 @@ static void net_update_resource_state(void *id, double value, double date) { link_CM02_t nw_link = id; - /* printf("[" "%lg" "] Asking to update network card \"%s\" with value " */ - /* "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */ + /* printf("[" "%g" "] Asking to update network card \"%s\" with value " */ + /* "%g" " for event %p\n", surf_get_clock(), nw_link->name, */ /* value, event_type); */ if (event_type == nw_link->lmm_resource.power.event) { @@ -665,10 +665,9 @@ static void net_finalize(void) surf_model_exit(surf_network_model); surf_network_model = NULL; - if (smpi_bw_factor) - xbt_dynar_free(&smpi_bw_factor); - if (smpi_lat_factor) - xbt_dynar_free(&smpi_lat_factor); + xbt_dict_free(&gap_lookup); + xbt_dynar_free(&smpi_bw_factor); + xbt_dynar_free(&smpi_lat_factor); } static void smpi_gap_append(double size, const link_CM02_t link, @@ -681,7 +680,7 @@ static void smpi_gap_append(double size, const link_CM02_t link, if (sg_sender_gap > 0.0) { if (!gap_lookup) { - gap_lookup = xbt_dict_new(); + gap_lookup = xbt_dict_new_homogeneous(NULL); } fifo = (xbt_fifo_t) xbt_dict_get_or_null(gap_lookup, src); action->sender.gap = 0.0; @@ -737,7 +736,7 @@ static void set_update_mechanism(void) { char *optim = xbt_cfg_get_string(_sg_cfg_set, "network/optim"); int select = - xbt_cfg_get_int(_sg_cfg_set, "network/maxmin_selective_update"); + xbt_cfg_get_boolean(_sg_cfg_set, "network/maxmin_selective_update"); if (!strcmp(optim, "Full")) { surf_network_model->model_private->update_mechanism = UM_FULL;