MPI: fix in handling SplitN_? equal 1 or smaller

pull/1/head
Thorsten Liebig 2011-03-08 11:39:02 +01:00
parent 28c5b496ed
commit 75fb5a0cc9
1 changed files with 9 additions and 7 deletions

View File

@ -136,14 +136,16 @@ bool openEMS_FDTD_MPI::SetupMPI(TiXmlElement* FDTD_Opts)
int SplitN=0; int SplitN=0;
if (MPI_Elem->QueryIntAttribute( arg_N_Names[n].c_str(), &SplitN) == TIXML_SUCCESS) if (MPI_Elem->QueryIntAttribute( arg_N_Names[n].c_str(), &SplitN) == TIXML_SUCCESS)
{ {
if (SplitN<=1) if (SplitN>1)
break;
vector<unsigned int> jobs = AssignJobs2Threads(m_Original_Grid->GetQtyLines(n)-1, SplitN, true);
unsigned int line=0;
for (size_t i = 0; i<jobs.size()-1;++i)
{ {
line += jobs.at(i);
SplitNumber[n].push_back(line); vector<unsigned int> jobs = AssignJobs2Threads(m_Original_Grid->GetQtyLines(n)-1, SplitN, true);
unsigned int line=0;
for (size_t i = 0; i<jobs.size()-1;++i)
{
line += jobs.at(i);
SplitNumber[n].push_back(line);
}
} }
} }
} }