Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix ns3
authorPaul Bédaride <paul.bedaride@gmail.com>
Mon, 30 Jun 2014 12:06:38 +0000 (14:06 +0200)
committerPaul Bédaride <paul.bedaride@gmail.com>
Mon, 30 Jun 2014 12:06:38 +0000 (14:06 +0200)
examples/msg/ns3/ns3.tesh
src/surf/network_ns3.cpp
src/surf/ns3/red-queue.cc

index 036f806..b2f9d85 100644 (file)
@@ -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
index 403e1a5..78394c5 100644 (file)
@@ -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;
index 02d68d7..3be1e16 100644 (file)
@@ -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<Packet> p)
         {
          packetSize= p->GetSize ();
           m_packets.erase(iter);
-          m_bytesInQueue -= packetSize; 
+          m_bytesInQueue -= packetSize;
           return 1;
         }
     }