Hi, I'm using a basic omp parallel for, which works most of the time, but sometimes (with no difference in the input data) makes the program crash with the error:
Fatal user error 1002
Not all work sharing construct executed by all threads.
#pragma omp parallel for \
shared(szDetailedError, aCG) \
private(pChannelGraph, szError) \
num_threads(8)
for (int i=0; i<aCG.size(); ++i)
{
pChannelGraph = aCG[i];
szError = pChannelGraph->getCurve()->applyFilter(szFilter);
if ( !pChannelGraph->getCurve()->isSgrm()
&& szError.isEmpty()
)
{
pChannelGraph->updateLegend(m_aFilterNames.join("\n"));
}
if (!szError.isEmpty())
{
szDetailedError += QString("%1\n\n").arg(szError);
}
}
What's causing this error, and how can I fix it?
Thanks.