From: Paul Bédaride Date: Mon, 30 Jun 2014 12:06:38 +0000 (+0200) Subject: Fix ns3 X-Git-Tag: v3_12~943 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5cafe2f3ba05448e2c932bccbe4acd809d7295ec Fix ns3 --- diff --git a/examples/msg/ns3/ns3.tesh b/examples/msg/ns3/ns3.tesh index 036f8067a0..b2f9d85264 100644 --- a/examples/msg/ns3/ns3.tesh +++ b/examples/msg/ns3/ns3.tesh @@ -36,4 +36,4 @@ p Two clusters $ ns3/ns3 ${srcdir:=.}/examples/platforms/clusters_routing_full.xml ${srcdir:=.}/examples/msg/ns3/Two_clusters-d.xml --cfg=network/model:NS3 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3' > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s) -> [node-16.acme.org:slave:(2) 0.012729] [msg_test/INFO] FLOW[1] : Receive 100 bytes from node-3.acme.org to c-16.me +> [c-16.me:slave:(2) 0.012729] [msg_test/INFO] FLOW[1] : Receive 100 bytes from c-3.me to c-16.me diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 403e1a5814..78394c5432 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -349,7 +349,7 @@ double NetworkNS3Model::shareResources(double now) do { ns3_simulator(now); time_to_next_flow_completion = ns3_time() - surf_get_clock();//FIXME: use now instead ? - } while(double_equals(time_to_next_flow_completion, 0)); + } while(double_equals(time_to_next_flow_completion, 0, sg_surf_precision)); XBT_DEBUG("min : %f", now); XBT_DEBUG("ns3 time : %f", ns3_time()); @@ -370,7 +370,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta) /* If there are no running flows, just return */ if (!getRunningActionSet()->size()) { - while(double_positive(now-ns3_time())) { + while(double_positive(now-ns3_time(), sg_surf_precision)) { ns3_simulator(now-ns3_time()); } return; diff --git a/src/surf/ns3/red-queue.cc b/src/surf/ns3/red-queue.cc index 02d68d7e4c..3be1e16d5b 100644 --- a/src/surf/ns3/red-queue.cc +++ b/src/surf/ns3/red-queue.cc @@ -331,7 +331,7 @@ RedQueue::Rmask (uint32_t pLog) { ///> ~OUL creates a 32 bit mask ///> 2^Plog - 1 - return pLog < 32 ? ((1 << pLog) - 1) : ~0UL; + return pLog < 32 ? ((1 << pLog) - 1) : (uint32_t) ~0UL; } @@ -423,7 +423,7 @@ RedQueue::AvgFromIdleTime () if (idleTime > m_scellMax) { - idleTime = m_scellMax; + idleTime = m_scellMax; } NS_LOG_DEBUG ("\t idleTime=" << idleTime); @@ -726,7 +726,7 @@ RedQueue::DropPacket (Ptr p) { packetSize= p->GetSize (); m_packets.erase(iter); - m_bytesInQueue -= packetSize; + m_bytesInQueue -= packetSize; return 1; } }