From adc7443aa5d9762f07a54c05be1cd234815451ab Mon Sep 17 00:00:00 2001 From: Alexey Rybalchenko Date: Fri, 28 Mar 2014 12:00:13 +0100 Subject: [PATCH] Allow easier testing without having to recompile for use of binary/boost/protobuf payload. to use different data transfer method, just provide a parameter to the script, e.g.: ./startAll bin ./startAll boost ./startAll proto etc. if no or incorrect parameters is provided, binary method will be used! protobuf method works only if the library is available on the system, otherwise it is not compiled. --- fairmq/CMakeLists.txt | 8 +++++++- fairmq/FairMQDevice.cxx | 11 +++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/fairmq/CMakeLists.txt b/fairmq/CMakeLists.txt index b41fdb86..0e5c4a09 100644 --- a/fairmq/CMakeLists.txt +++ b/fairmq/CMakeLists.txt @@ -102,7 +102,13 @@ set(LIBRARY_NAME FairMQ) GENERATE_LIBRARY() -set(Exe_Names bsampler buffer splitter merger sink proxy) +set(Exe_Names + bsampler + buffer + splitter + merger + sink + proxy) if(PROTOBUF_FOUND) set(Exe_Names diff --git a/fairmq/FairMQDevice.cxx b/fairmq/FairMQDevice.cxx index 6618602e..ed37c3ac 100644 --- a/fairmq/FairMQDevice.cxx +++ b/fairmq/FairMQDevice.cxx @@ -280,8 +280,6 @@ void FairMQDevice::LogSocketRates() while ( true ) { try { - boost::this_thread::sleep(boost::posix_time::milliseconds(fLogIntervalInMs)); - t1 = get_timestamp(); timeSinceLastLog_ms = (t1 - t0) / 1000.0L; @@ -314,12 +312,8 @@ void FairMQDevice::LogSocketRates() i = 0; - for ( vector::iterator itr = fPayloadOutputs->begin(); itr != fPayloadOutputs->end(); itr++ ) { - - // #ifdef NANOMSG - // LOG(ERROR) << "OK THEN"; - // #endif - + for ( vector::iterator itr = fPayloadOutputs->begin(); itr != fPayloadOutputs->end(); itr++ ) + { bytesOutputNew[i] = (*itr)->GetBytesTx(); megabytesPerSecondOutput[i] = ((double) (bytesOutputNew[i] - bytesOutput[i]) / (1024. * 1024.)) / (double) timeSinceLastLog_ms * 1000.; bytesOutput[i] = bytesOutputNew[i]; @@ -355,6 +349,7 @@ void FairMQDevice::LogSocketRates() // End of temp stuff t0 = t1; + boost::this_thread::sleep(boost::posix_time::milliseconds(fLogIntervalInMs)); } catch (boost::thread_interrupted&) { cout << "rateLogger interrupted" << endl; break;