aboutsummaryrefslogtreecommitdiff
path: root/src/simulator.cc
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2021-05-21 11:45:30 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2021-05-21 11:45:30 +0200
commit659ad990e80fd23ac9e6d1f1f1efee274c66f574 (patch)
tree74bd58103b88d3853401d756706cc323c602c61d /src/simulator.cc
parent9535a039fe275fc50f3246142387724dd846633f (diff)
Cleaning
Diffstat (limited to 'src/simulator.cc')
-rw-r--r--src/simulator.cc20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/simulator.cc b/src/simulator.cc
index 02fbdc6..7b288e4 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,i.hint_size,uptime)); \
+ SEND(m_ded->put(hint_forward,0,uptime)); \
} \
catch(...){ \
XBT_INFO("%s fail to forward a hint",CNAME); \
@@ -57,8 +57,6 @@ 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
@@ -80,13 +78,6 @@ 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)
@@ -105,15 +96,12 @@ int main(int argc, char **argv) {
XBT_INFO("-------------------------------------------------");
// Init all nodes actors
- nON=simgrid::s4u::Engine::get_instance()->get_host_count();
- data_ready=(bool*)malloc(sizeof(bool)*nON);
+ u32 nON=simgrid::s4u::Engine::get_instance()->get_host_count();
for(u32 i=0;i<nON;i++){
std::vector<std::string> args;
std::ostringstream ss;
ss<< "on" <<i;
- 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);
+ simgrid::s4u::Actor::create("ON", simgrid::s4u::Host::by_name(ss.str()), obs_node, args);
}
// Launch the simulation
@@ -129,7 +117,6 @@ 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");
@@ -294,7 +281,6 @@ 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)
}