mirror of
https://github.com/dgirardeau/q3DMASC.git
synced 2026-08-29 08:34:48 +08:00
instability debuggin in progress
This commit is contained in:
@@ -260,7 +260,7 @@ bool ContextBasedFeature::prepare( const CorePoints& corePoints,
|
||||
if (cancelled)
|
||||
{
|
||||
//process cancelled by the user
|
||||
errorMessage = "Process cancelled";
|
||||
errorMessage = "[ContextBasedFeature] Process cancelled";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -425,7 +425,7 @@ static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints,
|
||||
#ifndef _DEBUG
|
||||
#if defined(_OPENMP)
|
||||
bool cancelled = false;
|
||||
#pragma omp parallel for num_threads(omp_get_max_threads())
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
#endif
|
||||
for (int i = 0; i < static_cast<int>(pointCount); ++i)
|
||||
@@ -479,7 +479,7 @@ static bool ComputeMathOpWithNearestNeighbor( const CorePoints& corePoints,
|
||||
if (cancelled)
|
||||
{
|
||||
//process cancelled by the user
|
||||
error = "Process cancelled";
|
||||
error = "[Point feature] Process cancelled";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -618,11 +618,11 @@ void q3DMASCPlugin::doTrainAction()
|
||||
//prepare the features and the test cloud
|
||||
if (!toPrepareTest.empty())
|
||||
{
|
||||
progressDlg.show();
|
||||
QString error;
|
||||
masc::CorePoints corePointsTest;
|
||||
corePointsTest.cloud = corePointsTest.origin = testCloud;
|
||||
corePointsTest.role = mainCloudLabel;
|
||||
progressDlg.show();
|
||||
QString error;
|
||||
if (!masc::Tools::PrepareFeatures(corePointsTest, toPrepareTest, error, &progressDlg, &generatedScalarFieldsTest))
|
||||
{
|
||||
m_app->dispToConsole(error, ccMainAppInterface::ERR_CONSOLE_MESSAGE);
|
||||
|
||||
@@ -210,7 +210,7 @@ bool Classifier::classify( const Feature::Source::Set& featureSources,
|
||||
#ifndef _DEBUG
|
||||
#if defined(_OPENMP)
|
||||
bool cancelled = false;
|
||||
#pragma omp parallel for num_threads(omp_get_max_threads())
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
#endif
|
||||
for (int i = 0; i < static_cast<int>(cloud->size()); ++i)
|
||||
|
||||
+20
-10
@@ -1236,16 +1236,16 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
|
||||
#ifndef _DEBUG
|
||||
#if defined(_OPENMP)
|
||||
int num_threads = omp_get_max_threads();
|
||||
ccLog::Print("Using OpenMP with " + QString::number(num_threads) + " threads ");
|
||||
bool cancelled = false;
|
||||
#pragma omp parallel for num_threads(num_threads)
|
||||
#pragma omp parallel for
|
||||
#endif
|
||||
#endif
|
||||
for (int i = 0; i < static_cast<int>(pointCount); ++i)
|
||||
{
|
||||
if (!cancelled)
|
||||
{
|
||||
QString localErrorStr;
|
||||
|
||||
//spherical neighborhood extraction structure
|
||||
CCCoreLib::DgmOctree::NearestNeighboursSearchStruct nNSS;
|
||||
{
|
||||
@@ -1329,7 +1329,7 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
if (!feature->computeValue(nNSS.pointsInNeighbourhood, nNSS.queryPoint, outputValue))
|
||||
{
|
||||
//an error occurred
|
||||
errorStr = "An error occurred during the computation of feature " + feature->toString() + "on cloud " + feature->cloud1->getName();
|
||||
localErrorStr = "An error occurred during the computation of feature " + feature->toString() + "on cloud " + feature->cloud1->getName();
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
@@ -1345,7 +1345,7 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
if (!feature->computeValue(nNSS.pointsInNeighbourhood, nNSS.queryPoint, outputValue))
|
||||
{
|
||||
//an error occurred
|
||||
errorStr = "An error occurred during the computation of feature " + feature->toString() + "on cloud " + feature->cloud2->getName();
|
||||
localErrorStr = "An error occurred during the computation of feature " + feature->toString() + "on cloud " + feature->cloud2->getName();
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
@@ -1364,7 +1364,7 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
if (!feature->computeValue(nNSS.pointsInNeighbourhood, nNSS.queryPoint, outputValue))
|
||||
{
|
||||
//an error occurred
|
||||
errorStr = "An error occurred during the computation of feature " + feature->toString() + "on cloud " + feature->cloud1->getName();
|
||||
localErrorStr = "An error occurred during the computation of feature " + feature->toString() + "on cloud " + feature->cloud1->getName();
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
@@ -1375,24 +1375,34 @@ bool Tools::PrepareFeatures(const CorePoints& corePoints, Feature::Set& features
|
||||
|
||||
if (!success)
|
||||
{
|
||||
break;
|
||||
ccLog::Warning(localErrorStr);
|
||||
ccLog::Warning("(!success) with currentScale " + QString::number(currentScale) + " point " + QString::number(i));
|
||||
}
|
||||
|
||||
} //for each scale
|
||||
}
|
||||
|
||||
if (!success)
|
||||
{
|
||||
mutex.lock();
|
||||
cancelled = true;
|
||||
errorStr = "Process cancelled (features computation not successful), point " + QString::number(i) + " (using OpenMP with " + QString::number(omp_get_num_threads()) + " threads)";
|
||||
ccLog::Warning(errorStr);
|
||||
mutex.unlock();
|
||||
}
|
||||
|
||||
if (progressCb)
|
||||
{
|
||||
mutex.lock();
|
||||
cancelled = !nProgress.oneStep();
|
||||
mutex.unlock();
|
||||
if (cancelled)
|
||||
{
|
||||
//process cancelled by the user
|
||||
ccLog::Warning("Process cancelled");
|
||||
errorStr = "Process cancelled, iteration " + QString::number(i);
|
||||
errorStr = "Process cancelled, point " + QString::number(i) + " (using OpenMP with " + QString::number(omp_get_num_threads()) + " threads)";
|
||||
ccLog::Warning(errorStr);
|
||||
success = false;
|
||||
}
|
||||
mutex.unlock();
|
||||
}
|
||||
}
|
||||
} //for each point
|
||||
|
||||
Reference in New Issue
Block a user