mirror of
https://gitlab.com/manzerbredes/loosely-coupled-dss.git
synced 2025-04-25 06:48:33 +00:00
Debug network model
This commit is contained in:
parent
9365501740
commit
c757315893
11 changed files with 32317 additions and 13100 deletions
src
|
@ -24,7 +24,14 @@
|
|||
uptimeTrack=CLOCK-uptimeTrack; \
|
||||
uptime-=uptimeTrack; \
|
||||
uptime=uptime > 0 ? uptime : 0; \
|
||||
}
|
||||
}
|
||||
/// @brief Note that we need to simulate latency our self since we need to send instantaneous messages
|
||||
#define SEND(instruction) \
|
||||
{ \
|
||||
simgrid::s4u::this_actor::sleep_for(i.latency); \
|
||||
instruction; \
|
||||
}
|
||||
|
||||
|
||||
/// @brief Required by SimGrid
|
||||
XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[DAO] Loosely Coupled DSS");
|
||||
|
@ -123,25 +130,26 @@ static void obs_node(std::vector<std::string> args) {
|
|||
p->duration=i.GetNextDuration();
|
||||
p->hint=i.GetNextTS();
|
||||
}
|
||||
MODE_ON();
|
||||
try {
|
||||
// First we send and instantaneous message
|
||||
// This allow first to detect if their is a receiver
|
||||
// (to not cause deadlock for the extended mode) and second
|
||||
// to inform the receiver if he should get a hint first
|
||||
MODE_TX();
|
||||
TRACK_UPTIME(m->put(p,0,uptime));
|
||||
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(p->DedicatedMailbox);
|
||||
// First send hint if it is required
|
||||
MODE_TX();
|
||||
if(p->HasHint){
|
||||
TRACK_UPTIME(m_ded->put(p,i.hint_size,uptime));
|
||||
TRACK_UPTIME(SEND(m_ded->put(p,i.hint_size,uptime)));
|
||||
XBT_INFO("%s sent a hint successfully",CNAME);
|
||||
}
|
||||
// Then try sending the data
|
||||
if(i.extended)
|
||||
m_ded->put(p,i.data_size);
|
||||
else
|
||||
m_ded->put(p,i.data_size,uptime);
|
||||
if(i.extended){
|
||||
SEND(m_ded->put(p,i.data_size));
|
||||
}
|
||||
else{
|
||||
SEND(m_ded->put(p,i.data_size,uptime));
|
||||
}
|
||||
// If we reach here, data has been sent successfully
|
||||
XBT_INFO("%s sent data successfully",CNAME);
|
||||
nSend++;
|
||||
|
@ -157,7 +165,6 @@ static void obs_node(std::vector<std::string> args) {
|
|||
Payload *p; // Received data
|
||||
Payload *hint; // To Save the received hint
|
||||
bool hintReceived=false; // In case of error during data rx this will be use to check if we could use the *hint Payload object
|
||||
MODE_ON();
|
||||
try {
|
||||
// Get the instantaneous message
|
||||
TRACK_UPTIME(p=m->get<Payload>(uptime));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue