aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--results/energy.pngbin231972 -> 262007 bytes
-rwxr-xr-xresults/paper.sh4
-rw-r--r--results/success.pngbin161481 -> 192844 bytes
-rw-r--r--src/simulator.cc20
4 files changed, 20 insertions, 4 deletions
diff --git a/results/energy.png b/results/energy.png
index 283fb5e..91e2a37 100644
--- a/results/energy.png
+++ b/results/energy.png
Binary files differ
diff --git a/results/paper.sh b/results/paper.sh
index e72a495..4e65152 100755
--- a/results/paper.sh
+++ b/results/paper.sh
@@ -21,7 +21,7 @@ run-simulation () {
[ $gen_log -eq 1 ] && echo -e "* seed=$seed simtime=$simtime wakeupevery=$wakeupevery wakeupfor=$wakeupfor n_nodes=$n_nodes extended=$extended hint=$hint poff=$poff pon=$pon prx=$prx ptx=$ptx datasize=$datasize bitrate=$bitrate \n" >> "${log_file}"
# Run simulations
- if [ -e "$results" ]
+ if [ -e "$results" ]
then
# Create new result file
if [ $gen_log -eq 1 ]
@@ -58,6 +58,8 @@ hintsize=8 # Integer
latency=0 # in Seconds
bitrate="100kbps"
+
+
run-scenarios() {
# Configure number of seed per scenarios
nseed=100
diff --git a/results/success.png b/results/success.png
index 3cb7b6d..eb67c80 100644
--- a/results/success.png
+++ b/results/success.png
Binary files differ
diff --git a/src/simulator.cc b/src/simulator.cc
index 7b288e4..02fbdc6 100644
--- a/src/simulator.cc
+++ b/src/simulator.cc
@@ -43,7 +43,7 @@
TRACK_UPTIME(m->put(hint_forward,0,TRY_FORWARD_DURING)); \
simgrid::s4u::Mailbox *m_ded= simgrid::s4u::Mailbox::by_name(hint_forward->DedicatedMailbox); \
MODE_TX(); \
- SEND(m_ded->put(hint_forward,0,uptime)); \
+ SEND(m_ded->put(hint_forward,i.hint_size,uptime)); \
} \
catch(...){ \
XBT_INFO("%s fail to forward a hint",CNAME); \
@@ -57,6 +57,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[DAO] Loosely Coupled DSS");
/// @brief For convenience sake
typedef unsigned int u32;
+u32 nON;
+bool *data_ready;
/**
* Data that will be exchange between the nodes
@@ -78,6 +80,13 @@ public:
/// @brief Observation node code
static void obs_node(std::vector<std::string> args);
+bool is_data_rcv_ready(){
+ for(int i=0;i<nON;i++){
+ if(data_ready[i])
+ return true;
+ }
+ return false;
+}
/**
* No arguments are require (cf inputs.json)
@@ -96,12 +105,15 @@ int main(int argc, char **argv) {
XBT_INFO("-------------------------------------------------");
// Init all nodes actors
- u32 nON=simgrid::s4u::Engine::get_instance()->get_host_count();
+ nON=simgrid::s4u::Engine::get_instance()->get_host_count();
+ data_ready=(bool*)malloc(sizeof(bool)*nON);
for(u32 i=0;i<nON;i++){
std::vector<std::string> args;
std::ostringstream ss;
ss<< "on" <<i;
- simgrid::s4u::Actor::create("ON", simgrid::s4u::Host::by_name(ss.str()), obs_node, args);
+ args.push_back(std::to_string(i));
+ data_ready[i]=false;
+ simgrid::s4u::Actor::create("obs_node", simgrid::s4u::Host::by_name(ss.str()), obs_node, args);
}
// Launch the simulation
@@ -117,6 +129,7 @@ int main(int argc, char **argv) {
static void obs_node(std::vector<std::string> args) {
// Init various variables
std::string selfName = simgrid::s4u::this_actor::get_host()->get_name();
+ int id=stoi(args[0]);
simgrid::s4u::this_actor::get_host()->turn_on();
Inputs i(selfName);
simgrid::s4u::Mailbox *m = simgrid::s4u::Mailbox::by_name("medium");
@@ -281,6 +294,7 @@ static void obs_node(std::vector<std::string> args) {
XBT_INFO("%s could not receive any data",CNAME);
nRcvFail++;
}
+ data_ready[id]=false;
}
forward_mode=!forward_mode; // Toggle mode (go back and forth between receiving and forwarding)
}