mirror of
https://gitlab.com/manzerbredes/loosely-coupled-dss.git
synced 2025-06-26 23:37:40 +00:00
Improve data analysis
This commit is contained in:
parent
84d9ce59ae
commit
0a125c3661
32 changed files with 205278 additions and 38517 deletions
|
@ -18,6 +18,11 @@
|
|||
#define CLOCK (simgrid::s4u::Engine::get_clock())
|
||||
#define CNAME (selfName.c_str())
|
||||
#define FOR(t) (t<uptime?t:uptime)
|
||||
#define ADD_EVENT(HINT) \
|
||||
{ \
|
||||
XBT_INFO("%s add a new hint at %f for a duration of %f",CNAME,HINT->hint,HINT->duration); \
|
||||
i.AddEvent(HINT->hint, HINT->duration); \
|
||||
}
|
||||
#define TRACK_UPTIME(instruction) \
|
||||
{ \
|
||||
double uptimeTrack=CLOCK; \
|
||||
|
@ -44,6 +49,7 @@
|
|||
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(hint_forward->DedicatedMailbox); \
|
||||
MODE_TX(); \
|
||||
SEND(m_ded->put(hint_forward,0,uptime)); \
|
||||
XBT_INFO("%s forward a hint successfully",CNAME); \
|
||||
} \
|
||||
catch(...){ \
|
||||
XBT_INFO("%s fail to forward a hint",CNAME); \
|
||||
|
@ -134,6 +140,7 @@ static void obs_node(std::vector<std::string> args) {
|
|||
Payload *hint_forward=NULL; // Contains the hint to forward
|
||||
bool is_sender=i.is_sender; // This variable might change if all receiver have received the data
|
||||
bool isObserver=false;
|
||||
double timeDataRcv=-1;
|
||||
while(i.ShouldContinue()){
|
||||
// Start by sleeping
|
||||
XBT_INFO("%s is sleeping",CNAME);
|
||||
|
@ -166,6 +173,7 @@ static void obs_node(std::vector<std::string> args) {
|
|||
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(p->DedicatedMailbox);
|
||||
MODE_TX();
|
||||
SEND(m_ded->put(p,p->DataSize,uptime)); // Send the actual hint
|
||||
MODE_ON();
|
||||
XBT_INFO("%s sent a hint successfully",CNAME);
|
||||
}
|
||||
catch(...){}
|
||||
|
@ -209,6 +217,7 @@ static void obs_node(std::vector<std::string> args) {
|
|||
catch(...){}
|
||||
}
|
||||
sendhint_mode=!sendhint_mode; // Switch back and forth between sending hint and data
|
||||
MODE_ON();
|
||||
}
|
||||
// ---------- RECEIVER ----------
|
||||
else if(!isObserver){
|
||||
|
@ -235,7 +244,7 @@ static void obs_node(std::vector<std::string> args) {
|
|||
MODE_ON();
|
||||
XBT_INFO("%s received a forwarded hint successfully",CNAME);
|
||||
if(CLOCK < p->hint){
|
||||
i.AddEvent(p->hint, p->duration);
|
||||
ADD_EVENT(p);
|
||||
hint_forward=new Payload(*p);
|
||||
hint_added++;
|
||||
}
|
||||
|
@ -250,7 +259,7 @@ static void obs_node(std::vector<std::string> args) {
|
|||
XBT_INFO("%s received a hint successfully",CNAME);
|
||||
hint_forward=new Payload(*p); // Enable hint forwarding
|
||||
if(CLOCK < p->hint){
|
||||
i.AddEvent(p->hint, p->duration);
|
||||
ADD_EVENT(p);
|
||||
hint_forward=new Payload(*p);
|
||||
hint_added++;
|
||||
}
|
||||
|
@ -268,6 +277,7 @@ static void obs_node(std::vector<std::string> args) {
|
|||
p=m_ded->get<Payload>(uptime); // Fetch data until sended or uptime expire
|
||||
// If we reach here, data has been received successfully
|
||||
XBT_INFO("%s received data successfully",CNAME);
|
||||
timeDataRcv=CLOCK;
|
||||
if(p->HasHint){
|
||||
XBT_INFO("%s received a hint along with data successfully",CNAME);
|
||||
hint_forward=new Payload(*p); // Enable hint forwarding
|
||||
|
@ -337,5 +347,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)",CNAME,CNAME,i.is_sender,nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,totalUptime,i.seed,hint_added);
|
||||
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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue