diff --git a/include/wrench/simgrid_S4U_util/S4U_CommPort.h b/include/wrench/simgrid_S4U_util/S4U_CommPort.h index 7991a0cb8c..49ec4d296f 100755 --- a/include/wrench/simgrid_S4U_util/S4U_CommPort.h +++ b/include/wrench/simgrid_S4U_util/S4U_CommPort.h @@ -63,8 +63,6 @@ namespace wrench { std::unique_ptr getMessage(const std::string &error_prefix = "") { auto id = ++messageCounter; #ifndef NDEBUG -// char const *type_name = typeid(TMessageType).name(); -// std::string tn = boost::core::demangle(type_name); auto tn = this->templateWaitingLog(get_type_name(), id); #endif @@ -77,8 +75,6 @@ namespace wrench { message.release(); return std::unique_ptr(msg); } else { -// char const *type_name = typeid(TMessageType).name(); -// std::string tn = boost::core::demangle(type_name); throw std::runtime_error(error_prefix + " Unexpected [" + message->getName() + "] message while waiting for " + get_type_name() + ". Request ID: " + std::to_string(id)); } @@ -98,8 +94,6 @@ namespace wrench { std::unique_ptr getMessage(double timeout, const std::string &error_prefix = "") { auto id = ++messageCounter; #ifndef NDEBUG -// char const *type_name = typeid(TMessageType).name(); -// std::string tn = boost::core::demangle(type_name); auto tn = get_type_name(); this->templateWaitingLog(tn, id); #endif @@ -114,8 +108,6 @@ namespace wrench { #endif return std::unique_ptr(msg); } else { -// char const *type_name = typeid(TMessageType).name(); -// std::string tn = boost::core::demangle(type_name); throw std::runtime_error(error_prefix + " Unexpected [" + message->getName() + "] message while waiting for " + get_type_name() + ". Request ID: " + std::to_string(id)); } @@ -144,13 +136,14 @@ namespace wrench { return this->getMessage(timeout, true); } + void putMessage(SimulationMessage *m); void dputMessage(SimulationMessage *msg); std::shared_ptr iputMessage(SimulationMessage *msg); std::shared_ptr igetMessage(); - static unsigned long generateUniqueSequenceNumber(); + static unsigned long generateUniqueSequenceNumber(); static S4U_CommPort *getTemporaryCommPort(); static void retireTemporaryCommPort(S4U_CommPort *commport); static void createCommPortPool(unsigned long num_commports); @@ -180,6 +173,8 @@ namespace wrench { } private: + + friend class S4U_Daemon; friend class S4U_PendingCommunication; @@ -189,6 +184,7 @@ namespace wrench { std::unique_ptr getMessage(bool log); std::unique_ptr getMessage(double timeout, bool log); + void templateWaitingLog(const std::string& type, unsigned long long id); void templateWaitingLogUpdate(const std::string& type, unsigned long long id); diff --git a/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp b/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp index ce4c5475ac..88f120ffb9 100755 --- a/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp +++ b/src/wrench/simgrid_S4U_util/S4U_CommPort.cpp @@ -39,13 +39,10 @@ namespace wrench { double S4U_CommPort::default_control_message_size; - - class WorkflowTask; /** - * @brief Helper method that avoids calling WRENCH_DEBUG from a .h file and do the logging for the templated getMessage() method. + * @brief Helper method that avoids calling WRENCH_DEBUG from a .h file and do the logging for the templated getMessage() method. * It also has the added bonus of checking for inheritance * - * @param commport: the commport so we can get its name * @param type: a pointer to the message so we have its type * @param id: an integer id * @@ -56,10 +53,9 @@ namespace wrench { } /** - * @brief Helper method that avoids calling WRENCH_DEBUG from a .h file and do the logging for the templated getMessage() method. + * @brief Helper method that avoids calling WRENCH_DEBUG from a .h file and do the logging for the templated getMessage() method. * It also has the added bonus of checking for inheritance. * - * @param commport: the commport so we can get its name * @param type: a pointer to the message so we have its type * @param id: an integer id * diff --git a/test/simulation/S4U_CommPortTest.cpp b/test/simulation/S4U_CommPortTest.cpp index 6e8a964de1..9b32206f12 100755 --- a/test/simulation/S4U_CommPortTest.cpp +++ b/test/simulation/S4U_CommPortTest.cpp @@ -369,7 +369,7 @@ void S4U_CommPortTest::do_NetworkTimeout_test() { /**********************************************************************/ -/** NULL MAILBOX TEST **/ +/** NULL COMPORT TEST **/ /**********************************************************************/ class NullCommPortTestWMS : public wrench::ExecutionController { diff --git a/test/simulation/SimulationCommandLineArgumentsTest.cpp b/test/simulation/SimulationCommandLineArgumentsTest.cpp index 261f277c51..34ce481f41 100755 --- a/test/simulation/SimulationCommandLineArgumentsTest.cpp +++ b/test/simulation/SimulationCommandLineArgumentsTest.cpp @@ -290,7 +290,7 @@ void SimulationCommandLineArgumentsTest::do_HelpArgument_test() { } /**********************************************************************/ -/** MAILBOX-POOL-SIZE COMMAND-LINE ARGUMENT **/ +/** COMMPORT-POOL-SIZE COMMAND-LINE ARGUMENT **/ /**********************************************************************/ TEST_F(SimulationCommandLineArgumentsTest, CommPortPoolSizeArgument) {