mirror of
https://gitlab.com/manzerbredes/loosely-coupled-dss.git
synced 2025-04-05 11:06:25 +02:00
Cleaning
This commit is contained in:
parent
e3c7d5219d
commit
00dfd87c85
3 changed files with 2 additions and 14 deletions
Binary file not shown.
Before Width: | Height: | Size: 227 KiB After Width: | Height: | Size: 244 KiB |
Binary file not shown.
Before Width: | Height: | Size: 140 KiB After Width: | Height: | Size: 145 KiB |
|
@ -56,15 +56,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[DAO] Loosely Coupled DSS");
|
|||
|
||||
/// @brief For convenience sake
|
||||
typedef unsigned int u32;
|
||||
u32 nON;
|
||||
bool *data_ready;
|
||||
bool is_data_rcv_ready(){
|
||||
for(int i=0;i<nON;i++){
|
||||
if(data_ready[i])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data that will be exchange between the nodes
|
||||
*/
|
||||
|
@ -101,14 +93,11 @@ 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("ON", simgrid::s4u::Host::by_name(ss.str()), obs_node, args);
|
||||
}
|
||||
|
||||
|
@ -125,7 +114,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");
|
||||
|
|
Loading…
Add table
Reference in a new issue