]> AND Private Git Repository - loba.git/blobdiff - communicator.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Do not import full std::tr1 namespace.
[loba.git] / communicator.cpp
index 83935155dfce1308c380ab567eb80c929698c0a7..f3e6bf9fae1eddd27ec2f25e11977dfd727d15c4 100644 (file)
@@ -1,25 +1,26 @@
-#include "communicator.h"
-
 #include <algorithm>
 #include <tr1/functional>
 #include <sstream>
 #include <msg/msg.h>
 #include <xbt/log.h>
+
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(comm);
+
 #include "misc.h"
 #include "options.h"
 
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(comm);
+#include "communicator.h"
 
 std::string message::to_string()
 {
     static const char* str[] = { "INFO", "CREDIT", "LOAD",
                                  "CTRL_CLOSE", "DATA_CLOSE" };
     std::ostringstream oss;
-    oss << str[type] << " (" << amount << ")";
+    oss << str[type] << ": " << amount;
     return oss.str();
 }
 
-const int communicator::send_count_before_flush = 128;
+const int communicator::send_count_before_flush = 4;
 
 communicator::communicator()
     : host((hostdata* )MSG_host_get_data(MSG_host_self()))
@@ -114,8 +115,8 @@ bool communicator::recv(message*& msg, m_host_t& from, bool wait)
 
 void communicator::flush(bool wait)
 {
-    using namespace std::tr1;
-    using namespace std::tr1::placeholders;
+    using std::tr1::bind;
+    using std::tr1::placeholders::_1;
 
     sent_comm.remove_if(comm_test_n_destroy);
     if (wait && !sent_comm.empty()) {