diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2021-05-07 09:07:20 +0200 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2021-05-07 09:07:20 +0200 |
| commit | 9bc9ab691afeeb676ae9b3c386a49c13a453dc0b (patch) | |
| tree | 5a0d86c07202375a48fe844b494bb98299122958 /src | |
| parent | b7abfc66f0a5a30e9703908c018032d68e65d6b7 (diff) | |
Debug parser and cleaning
Diffstat (limited to 'src')
| -rw-r--r-- | src/Inputs.cc | 6 | ||||
| -rw-r--r-- | src/simulator.cc | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/Inputs.cc b/src/Inputs.cc index de81aec..d71d8f7 100644 --- a/src/Inputs.cc +++ b/src/Inputs.cc @@ -5,7 +5,7 @@ #include <fstream> Inputs::Inputs(std::string node_name){ - // Here we doing all the boring stuff + // Here we do all the boring stuff FILE* input_file = fopen(INPUTS_FILE, "rb"); char input_file_buffer[JSON_BUFFER_SIZE]; rapidjson::FileReadStream is(input_file, input_file_buffer, sizeof(input_file_buffer)); @@ -64,7 +64,7 @@ void Inputs::MergeEvents(){ } double Inputs::GetNextTS(){ - // Ensure the caller is smart + // Ensure that the caller is smart if(wake_duration.size()<2){ std::cerr << "You are trying to access to the next timestamp but it does not exists" <<std::endl; exit(1); @@ -73,7 +73,7 @@ double Inputs::GetNextTS(){ } double Inputs::GetNextDuration(){ - // Ensure the caller is smart + // Ensure that the caller is smart if(wake_duration.size()<2){ std::cerr << "You are trying to access to the next duration but it does not exists" <<std::endl; exit(1); diff --git a/src/simulator.cc b/src/simulator.cc index 167810f..5da125d 100644 --- a/src/simulator.cc +++ b/src/simulator.cc @@ -17,7 +17,7 @@ /// @brief Required by SimGrid XBT_LOG_NEW_DEFAULT_CATEGORY(simulator, "[DAO]"); -/// @brief For convenience +/// @brief For convenience sake typedef unsigned int u32; /** @@ -61,7 +61,7 @@ int main(int argc, char **argv) { simgrid::s4u::Actor::create("ON", simgrid::s4u::Host::by_name(ss.str()), obs_node, args); } - // Setup/Run simulation + // Launch the simulation engine.run(); XBT_INFO("Simulation took %fs", simgrid::s4u::Engine::get_clock()); XBT_INFO("The simulated platform file is available in \"%s\"",PLATFORM_FILE); @@ -109,11 +109,11 @@ static void obs_node(std::vector<std::string> args) { } if(i.extended){ // We use a trick here - // First we send an instantanous message (size=0) with a timeout + // First we send an instantaneous message (size=0) with the usual timeout // to check whether there is a receiver! // If there is one, we are sure that a put in the "medium"+selfName // will not lead to a deadlock (cf anchor:5623) and we are using a exclusive - // channel (to avoid another receiver to get the message) + // channel (to avoid other receivers to get the message) m->put(p,0,i.GetDuration()); simgrid::s4u::Mailbox *m_ext= simgrid::s4u::Mailbox::by_name("medium"+selfName); m_ext->put(p,data_size); @@ -121,7 +121,7 @@ static void obs_node(std::vector<std::string> args) { else{ m->put(p,data_size,i.GetDuration()); } - XBT_INFO("%s send data successfully",selfName.c_str()); + XBT_INFO("%s sent data successfully",selfName.c_str()); isObserver=true; // Do one send for now... isSender=false; } @@ -130,7 +130,7 @@ static void obs_node(std::vector<std::string> args) { if(i.extended){ // anchor:5623 We can see here that // we first receive the instantaneous message - // and then use the mailbox specific to the sender (to have an exclusive channel) + // and then we use a mailbox specific to the sender (to have an exclusive channel) p=m->get<Payload>(i.GetDuration()); simgrid::s4u::Mailbox *m_ext_sender = simgrid::s4u::Mailbox::by_name("medium"+p->node); p=m_ext_sender->get<Payload>(); @@ -149,18 +149,18 @@ static void obs_node(std::vector<std::string> args) { } } else { - XBT_INFO("%s is observing is environment...",selfName.c_str()); + XBT_INFO("%s is observing his environment...",selfName.c_str()); simgrid::s4u::this_actor::sleep_until(i.GetDuration()); } } catch (...) { if(isSender){ - XBT_INFO("%s failed to send data",selfName.c_str()); + XBT_INFO("%s could not send any data",selfName.c_str()); nSendFail++; } else{ - XBT_INFO("%s failed to receive data",selfName.c_str()); + XBT_INFO("%s could not receive any data",selfName.c_str()); nRcvFail++; } } |
