Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[ns3, trace] tracing needs the sentBytes variable being updated by the datasent callback
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Tue, 20 Sep 2011 12:35:32 +0000 (14:35 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Tue, 20 Sep 2011 12:35:32 +0000 (14:35 +0200)
examples/msg/ns3/ns3.tesh
src/surf/ns3/ns3_simulator.cc

index eb71bc1..f9770e3 100644 (file)
@@ -13,16 +13,17 @@ $ ns3/ns3 ${srcdir:=.}/ns3/3links-p.xml ${srcdir:=.}/ns3/3links-d.xml --cfg=netw
 > [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)
 > [C1:slave:(2) 0.104428] [msg_test/INFO] FLOW[1] : Receive 100000 bytes from S1 to C1
-> [C2:slave:(4) 0.555698] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from S2 to C2
-> [C3:slave:(6) 1.076972] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from S3 to C3
+> [C2:slave:(4) 1.041346] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from S2 to C2
+> [C3:slave:(6) 2.082380] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from S3 to C3
+
 
 $ ns3/ns3 ${srcdir:=.}/ns3/3links-p.xml ${srcdir:=.}/ns3/3links-d-timer.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)
 > [C1:slave:(2) 0.104428] [msg_test/INFO] FLOW[1] : Receive 100000 bytes from S1 to C1
-> [C2:slave:(4) 0.555698] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from S2 to C2
-> [C3:slave:(6) 1.076972] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from S3 to C3
-> [C3:slave:(7) 3.076972] [msg_test/INFO] FLOW[4] : Receive 2000000 bytes from S3 to C3
+> [C2:slave:(4) 1.041346] [msg_test/INFO] FLOW[2] : Receive 1000000 bytes from S2 to C2
+> [C3:slave:(6) 2.082422] [msg_test/INFO] FLOW[3] : Receive 2000000 bytes from S3 to C3
+> [C3:slave:(7) 4.164594] [msg_test/INFO] FLOW[4] : Receive 2000000 bytes from S3 to C3
 
 
 p One cluster
index 9509298..8b8a00c 100644 (file)
@@ -140,7 +140,7 @@ static void send_callback(Ptr<Socket> localSocket, uint32_t txSpace){
 
        uint8_t *data = (uint8_t*)malloc(sizeof(uint8_t)*txSpace);
 
-       while (mysocket->sentBytes < mysocket->totalBytes
+       while (mysocket->bufferedBytes < mysocket->totalBytes
                        && localSocket->GetTxAvailable () > 0)
        {
       uint32_t toWrite = min ((mysocket->remaining), txSpace);
@@ -149,15 +149,15 @@ static void send_callback(Ptr<Socket> localSocket, uint32_t txSpace){
 
       if(amountSent < 0)
          return;
-         (mysocket->sentBytes) += amountSent;
-         (mysocket->remaining) -= amountSent;
+      (mysocket->bufferedBytes) += amountSent;
+      (mysocket->remaining) -= amountSent;
       XBT_DEBUG("send_cb of F[%p, %p, %d] (%d/%d) %d buffered", mysocket, mysocket->action, mysocket->totalBytes, mysocket->remaining, mysocket->totalBytes, amountSent);
 
     }
 
        free(data);
 
-       if ((mysocket->sentBytes) >= mysocket->totalBytes){
+       if ((mysocket->bufferedBytes) >= mysocket->totalBytes){
                localSocket->Close();
        }
 }