From 4d107863208d72ee755b6de2392bcba0372a40fa Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 30 Jun 2021 15:41:03 +0200 Subject: Extend simulator --- src/simulator.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/simulator.cc') 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 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 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 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 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 -- cgit v1.2.3