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