#3269 Compdat Export Performance : Load all data before loop

This commit is contained in:
Magne Sjaastad
2018-08-24 09:59:37 +02:00
parent b3a7dc943c
commit 5f52dae545
5 changed files with 78 additions and 11 deletions

View File

@@ -655,16 +655,24 @@ const RigCaseCellResultsData* RimEclipseCase::results(RiaDefines::PorosityModelT
/// Convenience function used to pre-load data before const access of data
/// Used when implementing calculations in a parallelized loop
//--------------------------------------------------------------------------------------------------
void RimEclipseCase::loadStaticResultsByName(const std::vector<QString>& resultNames)
bool RimEclipseCase::loadStaticResultsByName(const std::vector<QString>& resultNames)
{
bool foundDataForAllResults = true;
RigCaseCellResultsData* cellResultsData = this->results(RiaDefines::MATRIX_MODEL);
if(cellResultsData)
{
for (const auto& resultName : resultNames)
{
cellResultsData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, resultName);
size_t resultIdx = cellResultsData->findOrLoadScalarResult(RiaDefines::STATIC_NATIVE, resultName);
if (resultIdx == cvf::UNDEFINED_SIZE_T)
{
foundDataForAllResults = false;
}
}
}
return foundDataForAllResults;
}
//--------------------------------------------------------------------------------------------------