fix in number of threads calc for multigrid engine

This commit is contained in:
Thorsten Liebig 2010-09-08 16:57:10 +02:00
parent 8d657430c0
commit e3c0805ad9

View File

@ -127,8 +127,8 @@ void Operator_CylinderMultiGrid::Init()
void Operator_CylinderMultiGrid::CalcStartStopLines(unsigned int &numThreads, vector<unsigned int> &start, vector<unsigned int> &stop) const
{
if (numLines[0]<numThreads) //in case more threads requested as lines in r-direction, reduce number of worker threads
numThreads = numLines[0];
if ((numLines[0] - m_Split_Pos + 1)<numThreads) //in case more threads requested as lines in r-direction, reduce number of worker threads
numThreads = numLines[0] - m_Split_Pos + 1;
unsigned int linesPerThread = round((float)(numLines[0] - m_Split_Pos + 1) / (float)numThreads);
if ((numThreads-1) * linesPerThread >= (numLines[0] - m_Split_Pos + 1))