This commit is contained in:
Loic Guegan 2021-05-20 14:36:34 +02:00
parent a342ca0c89
commit e3c7d5219d
8 changed files with 1400 additions and 8897 deletions

View file

@ -15,8 +15,8 @@ finalEnergy=data%>%group_by(simkey,wireless,wakeupfor)%>%summarize(wireless=firs
finalStats=data%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(sd_success=sd(nSend),success=mean(nSend))
# Hint Added
hintAdded=data%>%filter(isSender==0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(hint_added=mean(hint_added))
finalStats=finalStats%>%left_join(hintAdded,by=c("simkey","wireless","wakeupfor"))
#hintAdded=data%>%filter(isSender==0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(hint_added=mean(hint_added))
#finalStats=finalStats%>%left_join(hintAdded,by=c("simkey","wireless","wakeupfor"))
# Sender energy
senderEnergy=data%>%filter(isSender!=0)%>%group_by(simkey,wireless,wakeupfor)%>%summarise(senderEnergy=mean(energy))

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

After

Width:  |  Height:  |  Size: 227 KiB

View file

@ -60,7 +60,7 @@ bitrate="100kbps"
run-scenarios() {
# Configure number of seed per scenarios
nseed=50
nseed=10
# Baseline
echo "Baseline..."

File diff suppressed because it is too large Load diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

After

Width:  |  Height:  |  Size: 140 KiB

View file

@ -1,33 +1,33 @@
|simkey |wireless | wakeupfor| sd| energy|
|:---------------|:--------|---------:|----------:|---------:|
|baseline |lora | 60| 16.93828| 585.7987|
|extended |lora | 60| 4396.48015| 2901.8214|
|hint |lora | 60| 113.61249| 679.9324|
|hintandextended |lora | 60| 127.91979| 653.7922|
|simkey |wireless | wakeupfor| sd| energy|
|:---------------|:--------|---------:|---------:|---------:|
|baseline |nbiot | 60| 65.4062| 613.2213|
|extended |nbiot | 60| 8263.3383| 4860.8439|
|hint |nbiot | 60| 120.6206| 667.5331|
|hintandextended |nbiot | 60| 122.1119| 626.9545|
|simkey |wireless | wakeupfor| sd| energy|
|:---------------|:--------|---------:|----------:|--------:|
|baseline |lora | 180| 96.24996| 1797.365|
|extended |lora | 180| 3775.92822| 4470.672|
|hint |lora | 180| 209.55557| 2069.933|
|hintandextended |lora | 180| 167.57725| 1864.873|
|simkey |wireless | wakeupfor| sd| energy|
|:---------------|:--------|---------:|---------:|--------:|
|baseline |lora | 60| 15.27504| 584.4667|
|extended |lora | 60| 101.64624| 637.2433|
|hint |lora | 60| 23.81539| 590.4819|
|hintandextended |lora | 60| 114.57070| 647.3435|
|simkey |wireless | wakeupfor| sd| energy|
|:---------------|:--------|---------:|---------:|--------:|
|baseline |nbiot | 180| 287.1412| 1902.883|
|extended |nbiot | 180| 7184.9505| 6944.547|
|hint |nbiot | 180| 336.6721| 2009.567|
|hintandextended |nbiot | 180| 353.9554| 1983.746|
|baseline |nbiot | 60| 58.67243| 607.8669|
|extended |nbiot | 60| 56.56835| 606.4526|
|hint |nbiot | 60| 103.98686| 644.1689|
|hintandextended |nbiot | 60| 90.73827| 636.3234|
|simkey |wireless | wakeupfor| sd| energy|
|:---------------|:--------|---------:|---------:|--------:|
|baseline |lora | 180| 93.38861| 1788.865|
|extended |lora | 180| 110.07750| 1793.727|
|hint |lora | 180| 213.29502| 2056.414|
|hintandextended |lora | 180| 162.90229| 1912.699|
|simkey |wireless | wakeupfor| sd| energy|
|:---------------|:--------|---------:|--------:|--------:|
|baseline |nbiot | 180| 216.6888| 1823.300|
|extended |nbiot | 180| 184.0252| 1803.931|
|hint |nbiot | 180| 178.1057| 1944.607|
|hintandextended |nbiot | 180| 165.2183| 1906.130|

View file

@ -1,33 +1,33 @@
|simkey |wireless | wakeupfor| sd_success| success| hint_added| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|-------:|----------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |lora | 60| 0.000000| 0.00| 0.0000000| 633.8784| 581.4278| 1440.000| 1439.978| 32.48|
|extended |lora | 60| 1.443352| 4.72| 0.0000000| 907.5632| 3096.5731| 1954.700| 5935.148| 20.24|
|hint |lora | 60| 0.000000| 0.00| 2.9563636| 784.7349| 670.4049| 1440.000| 1614.415| 28.96|
|hintandextended |lora | 60| 1.462595| 6.06| 0.0781818| 1015.8779| 620.8753| 2111.888| 1513.428| 28.18|
|simkey |wireless | wakeupfor| sd_success| success| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|-------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |lora | 60| 0.000000| 0.0| 627.1360| 580.5876| 1440.000| 1440.000| 0|
|extended |lora | 60| 1.523884| 5.1| 935.9200| 610.0909| 2013.400| 1495.555| 0|
|hint |lora | 60| 0.000000| 0.0| 635.4400| 586.3948| 1440.000| 1451.391| 0|
|hintandextended |lora | 60| 1.505545| 5.4| 988.2212| 616.3547| 2071.081| 1503.998| 0|
|simkey |wireless | wakeupfor| sd_success| success| hint_added| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|--------:|----------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |nbiot | 60| 1.152814| 1.240000| 0.0000000| 800.1330| 596.2294| 1440.000| 1439.978| 30.70|
|extended |nbiot | 60| 1.518458| 5.020000| 0.0000000| 777.2571| 5259.6316| 1467.477| 5887.267| 23.54|
|hint |nbiot | 60| 1.754084| 7.108696| 0.9404332| 994.3676| 640.3953| 1440.000| 1495.508| 45.68|
|hintandextended |nbiot | 60| 1.607689| 6.395833| 0.1159420| 874.4999| 605.4288| 1476.819| 1455.902| 33.84|
|simkey |wireless | wakeupfor| sd_success| success| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|-------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |nbiot | 60| 1.418136| 1.3| 773.9900| 592.7648| 1440.000| 1440.000| 0|
|extended |nbiot | 60| 1.837873| 5.6| 776.6612| 590.9791| 1480.925| 1444.349| 0|
|hint |nbiot | 60| 3.645393| 4.2| 871.7506| 623.4797| 1440.000| 1473.591| 0|
|hintandextended |nbiot | 60| 2.299758| 8.2| 900.6119| 612.2971| 1499.986| 1459.351| 0|
|simkey |wireless | wakeupfor| sd_success| success| hint_added| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|--------:|----------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |lora | 180| 1.1752551| 1.080000| 0.0000000| 2094.030| 1770.395| 4319.780| 4317.385| 43.28|
|extended |lora | 180| 1.1952286| 8.800000| 0.0000000| 2133.163| 4701.196| 4711.300| 9595.870| 21.04|
|hint |lora | 180| 0.3631365| 9.857143| 3.4112628| 2245.385| 2065.741| 4319.500| 4904.259| 47.04|
|hintandextended |lora | 180| 0.8139410| 9.562500| 0.4991424| 2369.251| 1851.030| 4773.883| 4472.729| 53.20|
|simkey |wireless | wakeupfor| sd_success| success| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|-------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |lora | 180| 1.100505| 0.9| 2079.000| 1762.489| 4319.300| 4317.609| 0|
|extended |lora | 180| 1.349897| 9.4| 2145.360| 1761.760| 4733.400| 4349.709| 0|
|hint |lora | 180| 2.626785| 9.3| 2182.152| 2044.983| 4319.300| 4875.818| 0|
|hintandextended |lora | 180| 0.000000| 11.0| 2275.506| 1879.717| 4842.804| 4561.617| 0|
|simkey |wireless | wakeupfor| sd_success| success| hint_added| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|--------:|----------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |nbiot | 180| 1.4359926| 6.979592| 0.0000000| 2777.687| 1825.088| 4319.776| 4317.390| 32.24|
|extended |nbiot | 180| 1.1241323| 8.960000| 0.0000000| 2450.170| 7388.655| 4337.550| 9642.147| 23.90|
|hint |nbiot | 180| 0.6333237| 9.642857| 0.6962457| 3445.563| 1975.260| 4320.000| 4434.560| 67.90|
|hintandextended |nbiot | 180| 0.6063391| 9.647059| 0.4914089| 3328.208| 1944.475| 4334.321| 4406.019| 68.68|
|simkey |wireless | wakeupfor| sd_success| success| senderEnergy| receiverEnergy| senderUptime| receiverUptime| nSendFail|
|:---------------|:--------|---------:|----------:|-------:|------------:|--------------:|------------:|--------------:|---------:|
|baseline |nbiot | 180| 1.595131| 9.1| 2511.166| 1760.766| 4319.300| 4317.609| 0|
|extended |nbiot | 180| 1.264911| 9.6| 2393.062| 1750.373| 4331.310| 4319.192| 0|
|hint |nbiot | 180| 0.000000| 11.0| 2209.184| 1920.554| 4319.300| 4465.173| 0|
|hintandextended |nbiot | 180| 0.000000| 11.0| 2176.211| 1881.577| 4341.277| 4438.185| 0|

View file

@ -70,11 +70,12 @@ bool is_data_rcv_ready(){
*/
class Payload{
public:
Payload():hint(0),duration(0),HasHint(false),HisForward(false){}
Payload():hint(0),duration(0),HasHint(false),HisForward(false),HasData(false){}
Payload(Payload &p):hint(p.hint),duration(p.duration),HasHint(p.HasHint),DedicatedMailbox(p.DedicatedMailbox),HisForward(p.HisForward){}
double hint; // The timestamp that should be used by the receiver
double duration; // The duration that should be used by the receiver
bool HasHint;
bool HasData;
bool HisForward;
std::string DedicatedMailbox; // Dedicated mailbox used by the sender/receiver
};
@ -140,6 +141,7 @@ static void obs_node(std::vector<std::string> args) {
u32 hint_added=0;
double totalUptime=0;
Payload *hint_forward=NULL;
bool init_issender=i.is_sender;
while(i.ShouldContinue()){
// Start by sleeping
XBT_INFO("%s is spleeping",CNAME);
@ -154,57 +156,62 @@ static void obs_node(std::vector<std::string> args) {
double upuntil=i.GetTS()+i.GetDuration();
bool forward_mode=false;
bool onlyf=false;
bool sendhint_mode=false;
while(uptime>0)
{
if(i.is_sender){
Payload *p=new Payload();
p->DedicatedMailbox="dedicated"+selfName;
// Add hint informations to the payload
if(i.use_hint && i.HasNext()){
double try_for=sendhint_mode ? 0.3 : 1;
try_for=try_for>uptime ? uptime : try_for; // Ensure we do not exceed uptime
try_for=(i.use_hint && i.HasNext()) ? try_for: uptime; // Ensure we shoud use hint otherwise only send data
// Send hint
if(i.use_hint && sendhint_mode && i.HasNext()){
Payload *p=new Payload();
p->DedicatedMailbox="hintmailbox"+selfName;
p->HasHint=true;
p->duration=i.GetNextDuration();
p->hint=i.GetNextTS();
}
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
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
if(p->HasHint){
TRACK_UPTIME(SEND(m_ded->put(p,i.hint_size,uptime)));
try {
TRACK_UPTIME(m->put(p,0,try_for));
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(p->DedicatedMailbox);
MODE_TX();
SEND(m_ded->put(p,i.hint_size,uptime));
XBT_INFO("%s sent a hint successfully",CNAME);
}
MODE_TX();
// Then try sending the data
if(is_data_rcv_ready()){
catch(...){}
}
else{ // Send data
Payload *p=new Payload();
p->DedicatedMailbox="datamailbox"+selfName;
p->HasData=true;
p->HasHint=false;
if(i.use_hint && i.HasNext()){
p->HasHint=true;
p->duration=i.GetNextDuration();
p->hint=i.GetNextTS();
}
try {
TRACK_UPTIME(m->put(p,0,try_for));
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(p->DedicatedMailbox);
MODE_TX();
if(i.extended){
SEND(m_ded->put(p,i.data_size));
SEND(m_ded->put(p,i.data_size));
}
else{
SEND(m_ded->put(p,i.data_size,uptime));
}
XBT_INFO("%s sent data successfully",CNAME);
nSend++;
i.is_sender=(nSend<(i.n_nodes-1));
isObserver=!i.is_sender;
}
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++;
i.is_sender=(nSend<(i.n_nodes-1));
isObserver=!i.is_sender;
}
catch(...){
XBT_INFO("%s could not send any data",CNAME);
nSendFail++;
catch(...){}
}
sendhint_mode=!sendhint_mode; // Switch to send hint mode
}
else if(!isObserver){
// Here we try to forward hint for 1 sec and try to receive data for 5 secs
double try_for=forward_mode ? 1 : 1;
double try_for=forward_mode ? 0.3 : 1;
try_for=try_for>uptime ? uptime : try_for; // Ensure we do not exceed uptime
// Forward hint mode
if(forward_mode){
@ -238,24 +245,36 @@ static void obs_node(std::vector<std::string> args) {
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(p->DedicatedMailbox);
// Start receiving data
MODE_RX();
if(p->HasHint){
if(p->HasHint && !p->HasData){
TRACK_UPTIME(p=m_ded->get<Payload>(uptime));
XBT_INFO("%s received a hint successfully",CNAME);
hint=new Payload(*p); // Save hint
hint_forward=new Payload(*p); // Enable hint forwarding
hintReceived=true;
if(CLOCK < p->hint){
i.AddEvent(p->hint, p->duration);
hint_forward=new Payload(*p);
hint_added++;
}
}
data_ready[id]=true; // Say to the receiver that he can send (to avoid deadlock in extended mode)
if(i.extended){
p=m_ded->get<Payload>(); // Fetch data until sended
else {
if(i.extended){
p=m_ded->get<Payload>(); // Fetch data until sended
}
else
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);
if(p->HasHint){
XBT_INFO("%s received a hint along with data successfully",CNAME);
hint=new Payload(*p); // Save hint
hint_forward=new Payload(*p); // Enable hint forwarding
hintReceived=true;
}
nDataRcv++;
isObserver=true;
i.is_sender=false;
}
else
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);
nDataRcv++;
isObserver=true;
i.is_sender=false;
}catch(...){
XBT_INFO("%s could not receive any data",CNAME);
@ -265,7 +284,6 @@ static void obs_node(std::vector<std::string> args) {
hint_added++;
}
}
data_ready[id]=false;
}
forward_mode=!forward_mode; // Toggle mode (go back and forth between receiving and forwarding)
}
@ -319,5 +337,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)",CNAME,CNAME,init_issender,nSend,nWakeUp,nDataRcv,nSendFail,nRcvFail,totalUptime,i.seed,hint_added);
}