From: Lucas Schnorr Date: Thu, 8 Sep 2011 10:22:07 +0000 (+0200) Subject: [NS3] using maxmin precision to avoid infinite loop X-Git-Tag: v3_6_2~111 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d92bf83bf0c294c76e6c36c4b50d5008d8386a20 [NS3] using maxmin precision to avoid infinite loop --- diff --git a/src/surf/network_ns3.c b/src/surf/network_ns3.c index 61e9d07514..1185fda602 100644 --- a/src/surf/network_ns3.c +++ b/src/surf/network_ns3.c @@ -5,6 +5,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "surf_private.h" +#include "surf/maxmin.h" #include "surf/ns3/ns3_interface.h" #include "xbt/lib.h" #include "surf/network_ns3_private.h" @@ -423,7 +424,7 @@ static double ns3_share_resources(double min) do { ns3_simulator(min); time_to_next_flow_completion = ns3_time() - surf_get_clock(); - } while(time_to_next_flow_completion==0.0); + } while(double_equals(time_to_next_flow_completion,0)); XBT_DEBUG("min : %f",min); XBT_DEBUG("ns3 time : %f",ns3_time()); @@ -445,7 +446,7 @@ static void ns3_update_actions_state(double now, double delta) /* If there are no running flows, just return */ if (!xbt_swag_size(running_actions)) { - while(ns3_time()