diff --git a/FDTD/engine_multithread.cpp b/FDTD/engine_multithread.cpp index 9c70e83..b9c4c1d 100644 --- a/FDTD/engine_multithread.cpp +++ b/FDTD/engine_multithread.cpp @@ -95,10 +95,6 @@ void Engine_Multithread::Init() if (m_numThreads == 0) m_numThreads = boost::thread::hardware_concurrency(); - unsigned int linesPerThread = round((float)numLines[0] / (float)m_numThreads); - if ((m_numThreads-1) * linesPerThread >= numLines[0]) - --m_numThreads; - cout << "Multithreaded engine using " << m_numThreads << " threads. Utilization: ("; m_barrier_VoltUpdate = new boost::barrier(m_numThreads); // numThread workers m_barrier_VoltExcite = new boost::barrier(m_numThreads+1); // numThread workers + 1 excitation thread @@ -113,7 +109,9 @@ void Engine_Multithread::Init() m_startBarrier = new boost::barrier(m_numThreads+1); // numThread workers + 1 controller m_stopBarrier = new boost::barrier(m_numThreads+1); // numThread workers + 1 controller - for (unsigned int n=0; n= numLines[0]) + --m_numThreads; + cout << "Multithreaded operator using " << m_numThreads << " threads." << std::endl; m_thread_group.join_all(); @@ -88,7 +92,6 @@ int Operator_Multithread::CalcECOperator() delete m_CalcPEC_Start;m_CalcPEC_Start = new boost::barrier(m_numThreads+1); // numThread workers + 1 controller delete m_CalcPEC_Stop;m_CalcPEC_Stop = new boost::barrier(m_numThreads+1); // numThread workers + 1 controller - unsigned int linesPerThread = round((float)numLines[0] / (float)m_numThreads); for (unsigned int n=0; n