This commit is contained in:
Loic Guegan 2021-05-20 11:13:19 +02:00
parent 404eb004ad
commit a342ca0c89
6 changed files with 3228 additions and 3223 deletions

View file

@ -153,6 +153,7 @@ static void obs_node(std::vector<std::string> args) {
double upsince=simgrid::s4u::Engine::get_clock();
double upuntil=i.GetTS()+i.GetDuration();
bool forward_mode=false;
bool onlyf=false;
while(uptime>0)
{
if(i.is_sender){
@ -178,16 +179,18 @@ static void obs_node(std::vector<std::string> args) {
}
MODE_TX();
// Then try sending the data
if(i.extended){
if(is_data_rcv_ready()){
SEND(m_ded->put(p,i.data_size));
if(is_data_rcv_ready()){
if(i.extended){
SEND(m_ded->put(p,i.data_size));
}
else{
SEND(m_ded->put(p,i.data_size,uptime));
}
else
throw "Attemps to send when no receiver available in extended mode";
}
else{
SEND(m_ded->put(p,i.data_size,uptime));
}
else
throw "Attemps to send when no receiver available in extended mode";
// If we reach here, data has been sent successfully
XBT_INFO("%s sent data successfully",CNAME);
nSend++;
@ -272,7 +275,8 @@ static void obs_node(std::vector<std::string> args) {
if(i.use_hint){
double try_for=forward_mode ? 1 : 1;
try_for=try_for>uptime ? uptime : try_for;
if(onlyf)
forward_mode=true;
if(forward_mode && hint_forward!=NULL && CLOCK < hint_forward->hint){
FORWARD_HINT(try_for);
}
@ -284,6 +288,7 @@ static void obs_node(std::vector<std::string> args) {
} while(p->HisForward); // Ignore forwarded hint
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(p->DedicatedMailbox);
// Start receiving hint from sender
onlyf=true;
MODE_RX();
if(p->HasHint){
TRACK_UPTIME(p=m_ded->get<Payload>(uptime));