mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5022 Performance Summary : Use openmp when loading metadata for cases
This commit is contained in:
parent
aa11e3601b
commit
8157790068
@ -328,6 +328,15 @@ RiaPreferences::RiaPreferences( void )
|
|||||||
"",
|
"",
|
||||||
"" );
|
"" );
|
||||||
m_showSummaryTimeAsLongString.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
m_showSummaryTimeAsLongString.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||||
|
|
||||||
|
CAF_PDM_InitField( &m_useMultipleThreadsWhenLoadingSummaryData,
|
||||||
|
"useMultipleThreadsWhenLoadingSummaryData",
|
||||||
|
false,
|
||||||
|
"Use multiple threads when loading summary data",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"" );
|
||||||
|
m_useMultipleThreadsWhenLoadingSummaryData.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -365,7 +374,8 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
|||||||
field == &m_showTestToolbar || field == &m_includeFractureDebugInfoFile ||
|
field == &m_showTestToolbar || field == &m_includeFractureDebugInfoFile ||
|
||||||
field == &showLasCurveWithoutTvdWarning || field == &holoLensDisableCertificateVerification ||
|
field == &showLasCurveWithoutTvdWarning || field == &holoLensDisableCertificateVerification ||
|
||||||
field == &m_showProjectChangedDialog || field == &m_searchPlotTemplateFoldersRecursively ||
|
field == &m_showProjectChangedDialog || field == &m_searchPlotTemplateFoldersRecursively ||
|
||||||
field == &showLegendBackground || field == &m_showSummaryTimeAsLongString || field == &m_showViewIdInProjectTree )
|
field == &showLegendBackground || field == &m_showSummaryTimeAsLongString ||
|
||||||
|
field == &m_showViewIdInProjectTree || field == &m_useMultipleThreadsWhenLoadingSummaryData )
|
||||||
{
|
{
|
||||||
caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute );
|
caf::PdmUiCheckBoxEditorAttribute* myAttr = dynamic_cast<caf::PdmUiCheckBoxEditorAttribute*>( attribute );
|
||||||
if ( myAttr )
|
if ( myAttr )
|
||||||
@ -452,6 +462,7 @@ void RiaPreferences::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
|
|||||||
uiOrdering.add( &m_dateFormat );
|
uiOrdering.add( &m_dateFormat );
|
||||||
uiOrdering.add( &m_timeFormat );
|
uiOrdering.add( &m_timeFormat );
|
||||||
uiOrdering.add( &m_showSummaryTimeAsLongString );
|
uiOrdering.add( &m_showSummaryTimeAsLongString );
|
||||||
|
uiOrdering.add( &m_useMultipleThreadsWhenLoadingSummaryData );
|
||||||
|
|
||||||
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Plot Templates" );
|
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Plot Templates" );
|
||||||
group->add( &m_plotTemplateFolders );
|
group->add( &m_plotTemplateFolders );
|
||||||
@ -812,6 +823,14 @@ bool RiaPreferences::showSummaryTimeAsLongString() const
|
|||||||
return m_showSummaryTimeAsLongString;
|
return m_showSummaryTimeAsLongString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
bool RiaPreferences::useMultipleThreadsWhenReadingSummaryData() const
|
||||||
|
{
|
||||||
|
return m_useMultipleThreadsWhenLoadingSummaryData;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -93,6 +93,7 @@ public:
|
|||||||
QString defaultPlotTemplateAbsolutePath() const;
|
QString defaultPlotTemplateAbsolutePath() const;
|
||||||
void setDefaultPlotTemplatePath( const QString& templatePath );
|
void setDefaultPlotTemplatePath( const QString& templatePath );
|
||||||
bool showSummaryTimeAsLongString() const;
|
bool showSummaryTimeAsLongString() const;
|
||||||
|
bool useMultipleThreadsWhenReadingSummaryData() const;
|
||||||
|
|
||||||
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> defaultFontSizes() const;
|
std::map<RiaDefines::FontSettingType, RiaFontCache::FontSize> defaultFontSizes() const;
|
||||||
|
|
||||||
@ -181,6 +182,7 @@ private:
|
|||||||
caf::PdmField<QString> m_dateFormat;
|
caf::PdmField<QString> m_dateFormat;
|
||||||
caf::PdmField<QString> m_timeFormat;
|
caf::PdmField<QString> m_timeFormat;
|
||||||
caf::PdmField<bool> m_showSummaryTimeAsLongString;
|
caf::PdmField<bool> m_showSummaryTimeAsLongString;
|
||||||
|
caf::PdmField<bool> m_useMultipleThreadsWhenLoadingSummaryData;
|
||||||
|
|
||||||
caf::PdmField<QString> m_plotTemplateFolders;
|
caf::PdmField<QString> m_plotTemplateFolders;
|
||||||
caf::PdmField<bool> m_searchPlotTemplateFoldersRecursively;
|
caf::PdmField<bool> m_searchPlotTemplateFoldersRecursively;
|
||||||
|
@ -346,11 +346,39 @@ void RimSummaryCaseMainCollection::loadAllSummaryCaseData()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RimSummaryCaseMainCollection::loadSummaryCaseData( std::vector<RimSummaryCase*> summaryCases )
|
void RimSummaryCaseMainCollection::loadSummaryCaseData( std::vector<RimSummaryCase*> summaryCases )
|
||||||
{
|
{
|
||||||
caf::ProgressInfo progInfo( summaryCases.size(), "Loading Summary Cases" );
|
std::vector<RimFileSummaryCase*> fileSummaryCases;
|
||||||
|
std::vector<RimSummaryCase*> otherSummaryCases;
|
||||||
|
|
||||||
for ( int cIdx = 0; cIdx < static_cast<int>( summaryCases.size() ); ++cIdx )
|
if ( RiaApplication::instance()->preferences()->useMultipleThreadsWhenReadingSummaryData() )
|
||||||
{
|
{
|
||||||
RimSummaryCase* sumCase = summaryCases[cIdx];
|
for ( auto c : summaryCases )
|
||||||
|
{
|
||||||
|
auto fileCase = dynamic_cast<RimFileSummaryCase*>( c );
|
||||||
|
if ( fileCase )
|
||||||
|
{
|
||||||
|
fileSummaryCases.push_back( fileCase );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
otherSummaryCases.push_back( c );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
otherSummaryCases = summaryCases;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !fileSummaryCases.empty() )
|
||||||
|
{
|
||||||
|
loadFileSummaryCaseData( fileSummaryCases );
|
||||||
|
}
|
||||||
|
|
||||||
|
caf::ProgressInfo progInfo( otherSummaryCases.size(), "Loading Summary Cases" );
|
||||||
|
|
||||||
|
for ( int cIdx = 0; cIdx < static_cast<int>( otherSummaryCases.size() ); ++cIdx )
|
||||||
|
{
|
||||||
|
RimSummaryCase* sumCase = otherSummaryCases[cIdx];
|
||||||
if ( sumCase )
|
if ( sumCase )
|
||||||
{
|
{
|
||||||
sumCase->createSummaryReaderInterface();
|
sumCase->createSummaryReaderInterface();
|
||||||
@ -364,6 +392,27 @@ void RimSummaryCaseMainCollection::loadSummaryCaseData( std::vector<RimSummaryCa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimSummaryCaseMainCollection::loadFileSummaryCaseData( std::vector<RimFileSummaryCase*> fileSummaryCases )
|
||||||
|
{
|
||||||
|
// Use openMP when reading file summary case meta data. Avoid using the virtual interface of base class
|
||||||
|
// RimSummaryCase, as it is difficult to make sure all variants of the leaf classes are thread safe.
|
||||||
|
|
||||||
|
#pragma omp parallel for
|
||||||
|
for ( int cIdx = 0; cIdx < static_cast<int>( fileSummaryCases.size() ); ++cIdx )
|
||||||
|
{
|
||||||
|
RimFileSummaryCase* fileSummaryCase = fileSummaryCases[cIdx];
|
||||||
|
if ( fileSummaryCase )
|
||||||
|
{
|
||||||
|
fileSummaryCase->createSummaryReaderInterface();
|
||||||
|
fileSummaryCase->createRftReaderInterface();
|
||||||
|
addCaseRealizationParametersIfFound( *fileSummaryCase, fileSummaryCase->summaryHeaderFilename() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
class RimGridSummaryCase;
|
class RimGridSummaryCase;
|
||||||
class RimSummaryCase;
|
class RimSummaryCase;
|
||||||
|
class RimFileSummaryCase;
|
||||||
class RimEclipseResultCase;
|
class RimEclipseResultCase;
|
||||||
class RimSummaryCaseCollection;
|
class RimSummaryCaseCollection;
|
||||||
class RifSummaryCaseFileResultInfo;
|
class RifSummaryCaseFileResultInfo;
|
||||||
@ -73,6 +74,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static void loadSummaryCaseData( std::vector<RimSummaryCase*> summaryCases );
|
static void loadSummaryCaseData( std::vector<RimSummaryCase*> summaryCases );
|
||||||
|
static void loadFileSummaryCaseData( std::vector<RimFileSummaryCase*> fileSummaryCases );
|
||||||
static RimSummaryCaseCollection* defaultAllocator();
|
static RimSummaryCaseCollection* defaultAllocator();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user