mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7512 Support optimized summary reader
This commit is contained in:
@@ -74,6 +74,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RiaStatisticsTools-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter-Test.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp
|
||||
)
|
||||
|
||||
if (RESINSIGHT_ENABLE_GRPC)
|
||||
|
||||
113
ApplicationLibCode/UnitTests/RifSummaryDataReader-Test.cpp
Normal file
113
ApplicationLibCode/UnitTests/RifSummaryDataReader-Test.cpp
Normal file
@@ -0,0 +1,113 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
//#include "RiaTestDataDirectory.h"
|
||||
|
||||
#include "RifOpmCommonSummary.h"
|
||||
#include "RifReaderEclipseSummary.h"
|
||||
#include <chrono>
|
||||
|
||||
size_t iterationCount = 5;
|
||||
size_t maxCount = 500;
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST( DISABLED_RifSummaryDataTest, OpmCommonAllData )
|
||||
{
|
||||
QString filename = "e:/models/reek_history_match_large/realization-1/iter-0/eclipse/model/R001_REEK-1.SMSPEC";
|
||||
|
||||
for ( size_t iteration = 0; iteration < iterationCount; iteration++ )
|
||||
{
|
||||
RifOpmCommonEclipseSummary reader;
|
||||
|
||||
{
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
reader.open( filename, true );
|
||||
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double> diff = end - start;
|
||||
std::cout << "OPM : Open " << std::setw( 9 ) << diff.count() << " s\n";
|
||||
}
|
||||
|
||||
// for ( auto adr : reader.allResultAddresses() )
|
||||
// {
|
||||
// std::cout << adr.uiText();
|
||||
// std::cout << std::endl;
|
||||
// }
|
||||
|
||||
{
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
size_t totalValuesRead = 0;
|
||||
|
||||
// do some work
|
||||
size_t i = 0;
|
||||
for ( auto adr : reader.allResultAddresses() )
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
reader.values( adr, &values );
|
||||
totalValuesRead += values.size();
|
||||
i++;
|
||||
if ( i > maxCount ) break;
|
||||
}
|
||||
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double> diff = end - start;
|
||||
std::cout << "OPM Read data " << std::setw( 9 ) << totalValuesRead << "totalValueCount" << diff.count()
|
||||
<< " s\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
TEST( DISABLED_RifSummaryDataTest, LibEclAllData )
|
||||
{
|
||||
QString filename = "e:/models/reek_history_match_large/realization-1/iter-0/eclipse/model/R001_REEK-1.SMSPEC";
|
||||
|
||||
for ( size_t iteration = 0; iteration < iterationCount; iteration++ )
|
||||
{
|
||||
RifReaderEclipseSummary reader;
|
||||
{
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
reader.open( filename, true );
|
||||
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double> diff = end - start;
|
||||
std::cout << "LibEcl : Open " << std::setw( 9 ) << diff.count() << " s\n";
|
||||
}
|
||||
|
||||
// for ( auto adr : reader.allResultAddresses() )
|
||||
// {
|
||||
// std::cout << adr.uiText();
|
||||
// std::cout << std::endl;
|
||||
// }
|
||||
|
||||
{
|
||||
auto start = std::chrono::high_resolution_clock::now();
|
||||
|
||||
size_t totalValuesRead = 0;
|
||||
|
||||
size_t i = 0;
|
||||
for ( auto adr : reader.allResultAddresses() )
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
reader.values( adr, &values );
|
||||
totalValuesRead += values.size();
|
||||
|
||||
i++;
|
||||
if ( i > maxCount ) break;
|
||||
}
|
||||
|
||||
auto end = std::chrono::high_resolution_clock::now();
|
||||
std::chrono::duration<double> diff = end - start;
|
||||
std::cout << "LibEcl read data" << std::setw( 9 ) << totalValuesRead << "totalValueCount" << diff.count()
|
||||
<< " s\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user