mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3253 OpenMP : Give name to all critical sections
This commit is contained in:
@@ -212,7 +212,7 @@ void RiaLogging::error(const QString& message)
|
||||
{
|
||||
if (sm_logger && sm_logger->level() >= RI_LL_ERROR)
|
||||
{
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_logging)
|
||||
sm_logger->error(message.toLatin1().constData());
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ void RiaLogging::warning(const QString& message)
|
||||
{
|
||||
if (sm_logger && sm_logger->level() >= RI_LL_WARNING)
|
||||
{
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_logging)
|
||||
sm_logger->warning(message.toLatin1().constData());
|
||||
}
|
||||
}
|
||||
@@ -236,7 +236,7 @@ void RiaLogging::info(const QString& message)
|
||||
{
|
||||
if (sm_logger && sm_logger->level() >= RI_LL_INFO)
|
||||
{
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_logging)
|
||||
sm_logger->info(message.toLatin1().constData());
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ void RiaLogging::debug(const QString& message)
|
||||
{
|
||||
if (sm_logger && sm_logger->level() >= RI_LL_DEBUG)
|
||||
{
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_logging)
|
||||
sm_logger->debug(message.toLatin1().constData());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,21 +184,23 @@ void RifEclipseOutputFileTools::timeSteps(ecl_file_type* ecl_file, std::vector<Q
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<double>* values)
|
||||
{
|
||||
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, RiaStringEncodingTools::toNativeEncoded(keyword).data(), static_cast<int>(fileKeywordOccurrence));
|
||||
if (kwData)
|
||||
#pragma omp critical(critical_section_keywordData_double)
|
||||
{
|
||||
size_t numValues = ecl_kw_get_size(kwData);
|
||||
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, RiaStringEncodingTools::toNativeEncoded(keyword).data(), static_cast<int>(fileKeywordOccurrence));
|
||||
if (kwData)
|
||||
{
|
||||
size_t numValues = ecl_kw_get_size(kwData);
|
||||
|
||||
std::vector<double> doubleData;
|
||||
doubleData.resize(numValues);
|
||||
std::vector<double> doubleData;
|
||||
doubleData.resize(numValues);
|
||||
|
||||
ecl_kw_get_data_as_double(kwData, doubleData.data());
|
||||
values->insert(values->end(), doubleData.begin(), doubleData.end());
|
||||
ecl_kw_get_data_as_double(kwData, doubleData.data());
|
||||
values->insert(values->end(), doubleData.begin(), doubleData.end());
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -206,21 +208,23 @@ bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QStri
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEclipseOutputFileTools::keywordData(ecl_file_type* ecl_file, const QString& keyword, size_t fileKeywordOccurrence, std::vector<int>* values)
|
||||
{
|
||||
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, RiaStringEncodingTools::toNativeEncoded(keyword).data(), static_cast<int>(fileKeywordOccurrence));
|
||||
if (kwData)
|
||||
#pragma omp critical(critical_section_keywordData_int)
|
||||
{
|
||||
size_t numValues = ecl_kw_get_size(kwData);
|
||||
ecl_kw_type* kwData = ecl_file_iget_named_kw(ecl_file, RiaStringEncodingTools::toNativeEncoded(keyword).data(), static_cast<int>(fileKeywordOccurrence));
|
||||
if (kwData)
|
||||
{
|
||||
size_t numValues = ecl_kw_get_size(kwData);
|
||||
|
||||
std::vector<int> integerData;
|
||||
integerData.resize(numValues);
|
||||
std::vector<int> integerData;
|
||||
integerData.resize(numValues);
|
||||
|
||||
ecl_kw_get_memcpy_int_data(kwData, integerData.data());
|
||||
values->insert(values->end(), integerData.begin(), integerData.end());
|
||||
ecl_kw_get_memcpy_int_data(kwData, integerData.data());
|
||||
values->insert(values->end(), integerData.begin(), integerData.end());
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -234,7 +234,7 @@ void RivFemPartGeometryGenerator::computeArrays()
|
||||
qElmNodeResIdx[2] = m_part->elementNodeResultIdx(elmIdx, localElmNodeIndicesForFace[2]);
|
||||
qElmNodeResIdx[3] = m_part->elementNodeResultIdx(elmIdx, localElmNodeIndicesForFace[3]);
|
||||
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_RivFemPartGeometryGenerator_computeArrays)
|
||||
{
|
||||
vertices.push_back(quadVxs0);
|
||||
vertices.push_back(quadVxs1);
|
||||
|
||||
@@ -183,7 +183,7 @@ void RivFaultGeometryGenerator::computeArrays()
|
||||
m_grid->cellFaceVertexIndices(face, faceConn);
|
||||
|
||||
// Critical section to avoid two threads accessing the arrays at the same time.
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_RivFaultGeometryGenerator_computeArrays)
|
||||
{
|
||||
int n;
|
||||
for (n = 0; n < 4; n++)
|
||||
|
||||
@@ -123,7 +123,7 @@ void RivNNCGeometryGenerator::computeArrays()
|
||||
{
|
||||
vx2 = vx3;
|
||||
vx3 = cvf::Vec3f( conn.m_polygon[vxIdx] - offset);
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_RivNNCGeometryGenerator_computeArrays)
|
||||
{
|
||||
vertices.push_back(vx1);
|
||||
vertices.push_back(vx2);
|
||||
|
||||
@@ -480,7 +480,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
||||
}
|
||||
|
||||
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_RigFlowDiagSolverInterface_calculate)
|
||||
{
|
||||
result.setInjProdWellPairFlux(uiInjectorTracerName,
|
||||
uiProducerTracerName,
|
||||
|
||||
@@ -412,7 +412,7 @@ void StructGridGeometryGenerator::computeArrays()
|
||||
m_grid->cellFaceVertexIndices(face, faceConn);
|
||||
|
||||
// Critical section to avoid two threads accessing the arrays at the same time.
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_StructGridGeometryGenerator_computeArrays)
|
||||
{
|
||||
int n;
|
||||
for (n = 0; n < 4; n++)
|
||||
|
||||
@@ -1332,7 +1332,7 @@ bool DrawableGeo::rayIntersect(const Ray& ray, Vec3d* intersectionPoint, uint* f
|
||||
{
|
||||
const double distSquared = (ray.origin() - localIntersect).lengthSquared();
|
||||
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_rayIntersect2)
|
||||
{
|
||||
if (distSquared < minDistSquared)
|
||||
{
|
||||
@@ -1415,7 +1415,7 @@ bool DrawableGeo::rayIntersect(const Ray& ray, Vec3dArray* intersectionPoints, U
|
||||
|
||||
if (hitThisFace)
|
||||
{
|
||||
#pragma omp critical
|
||||
#pragma omp critical(critical_section_rayIntersect1)
|
||||
{
|
||||
isectPts.push_back(localIntersect);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user