diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-06-30 15:41:03 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-06-30 15:41:03 +0200 |
| commit | 4d107863208d72ee755b6de2392bcba0372a40fa (patch) | |
| tree | 0e64395373fc8235bb775429884097b58b62b789 /src/simulator.cc | |
| parent | 9ed371278933220a193584cd294e6064ac6dd88c (diff) | |
Extend simulator
Diffstat (limited to 'src/simulator.cc')
| -rw-r--r-- | src/simulator.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/simulator.cc b/src/simulator.cc index aedf810..865aabc 100644 --- a/src/simulator.cc +++ b/src/simulator.cc @@ -188,8 +188,8 @@ static void obs_node(std::vector<std::string> args) { // Add hint to the data if possible if(i.use_hint && i.HasNext()){ p->HasHint=true; - p->duration=i.GetNextDuration(); - p->hint=i.GetNextTS(); + p->duration=i.GetHintDuration(CLOCK); + p->hint=i.GetHintTS(CLOCK); p->DataSize+=i.hint_size; // Don't forget!! } // Send the data @@ -283,6 +283,8 @@ static void obs_node(std::vector<std::string> args) { XBT_INFO("%s received a hint along with data successfully",CNAME); hint_forward=new Payload(*p); // Enable hint forwarding } + if(i.shutdown_on_rcv) + upuntil=CLOCK; nDataRcv++; isObserver=true; is_sender=false; @@ -342,6 +344,9 @@ static void obs_node(std::vector<std::string> args) { uptime=upuntil-CLOCK; // Note that uptime can be < 0 in extended mode uptime=uptime > 0 ? uptime : 0; // Just in case } + // Check if we use unschedule_on_rcv + if(i.unschedule_on_rcv) + i.ResetEvents(CLOCK); // Load next event i.GotoNextEvent(); nWakeUp++; // Increase the number of wake up @@ -349,5 +354,5 @@ static void obs_node(std::vector<std::string> args) { } // Done MODE_OFF() - XBT_INFO("Observation node %s finished [LOG2PARSE](node:%s|isSender:%d|nSend:%d|nWakeUp:%d|nDataRcv:%d|nSendFail:%d|nRcvFail:%d|totalUptime:%f|seed:%d|hint_added:%d|timeDataRcv:%f)",CNAME,CNAME,i.is_sender,nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,totalUptime,i.seed,hint_added,timeDataRcv); + XBT_INFO("Observation node %s finished [LOG2PARSE](node:%s|isSender:%d|nSend:%d|nWakeUp:%d|nDataRcv:%d|nSendFail:%d|nRcvFail:%d|totalUptime:%f|seed:%d|hint_added:%d|timeDataRcv:%f|shutdown_on_rcv:%d|unschedule_on_rcv:%d|farhint:%d|hintdist:%f)",CNAME,CNAME,i.is_sender,nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,totalUptime,i.seed,hint_added,timeDataRcv,i.shutdown_on_rcv,i.unschedule_on_rcv,i.farhint,i.hintdist); }
\ No newline at end of file |
