Verbose: Print these messages only in verbose mode
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#include <boost/asio.hpp>
|
||||
#include <opts.h>
|
||||
#include <mind.h>
|
||||
#include <componentThread.h>
|
||||
#include <marionette/marionette.h>
|
||||
@@ -39,7 +40,13 @@ const std::shared_ptr<ComponentThread> ComponentThread::getSelf(void)
|
||||
|
||||
void ComponentThread::main(ComponentThread& self)
|
||||
{
|
||||
std::cout << self.name << ":" << __func__ << ": Waiting for JOLT" <<"\n";
|
||||
|
||||
if (OptionParser::getOptions().verbose)
|
||||
{
|
||||
std::cout << self.name << ":" << __func__ << ": Waiting for JOLT"
|
||||
<<"\n";
|
||||
}
|
||||
|
||||
self.getIoService().run();
|
||||
self.initializeTls();
|
||||
|
||||
@@ -304,7 +311,10 @@ void ComponentThread::pinToCpu(int cpuId)
|
||||
}
|
||||
|
||||
pinnedCpuId = cpuId;
|
||||
std::cout << name << ": Pinned to CPU " << cpuId << "\n";
|
||||
if (OptionParser::getOptions().verbose)
|
||||
{
|
||||
std::cout << name << ": Pinned to CPU " << cpuId << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace smo
|
||||
|
||||
+7
-3
@@ -1,4 +1,5 @@
|
||||
#include <iostream>
|
||||
#include <opts.h>
|
||||
#include <mind.h>
|
||||
#include <componentThread.h>
|
||||
|
||||
@@ -143,7 +144,10 @@ Mind::getMindThreads() const
|
||||
void Mind::distributeAndPinThreadsAcrossCpus()
|
||||
{
|
||||
int cpuCount = ComponentThread::getAvailableCpuCount();
|
||||
std::cout << "Available CPUs: " << cpuCount << "\n";
|
||||
|
||||
if (OptionParser::getOptions().verbose) {
|
||||
std::cout << __func__ << ": Available CPUs: " << cpuCount << "\n";
|
||||
}
|
||||
|
||||
// Distribute and pin threads across CPUs
|
||||
int threadIndex = 0;
|
||||
@@ -154,8 +158,8 @@ void Mind::distributeAndPinThreadsAcrossCpus()
|
||||
++threadIndex;
|
||||
}
|
||||
|
||||
std::cout << "Distributed " << threadIndex << " threads across "
|
||||
<< cpuCount << " CPUs\n";
|
||||
std::cout << __func__ << ": Distributed " << threadIndex << " threads "
|
||||
<< "across " << cpuCount << " CPUs\n";
|
||||
}
|
||||
|
||||
// Thread management methods (moved from ComponentThread)
|
||||
|
||||
Reference in New Issue
Block a user