Commit 0bff0985 authored by Dominik Thoennes's avatar Dominik Thoennes

[API] move SQLite into its own module

To break unneeded dependencies in postprocessing the SQLite part is
moved to its own module and namespace.
Therefore in the include and the function calls
"postprocessing" hast to be removed or replaced by "sqlite" e.g.:
#include "postprocessing/sqlite/SQLite.h" ->
#include "sqlite/SQLite.h"

postprocessing::store... -> sqlite::store...
parent 9f112210
Pipeline #17276 passed with stages
in 256 minutes and 58 seconds
waLBerla_link_files_to_builddir( "*.dat" )
waLBerla_add_executable( NAME CouetteFlow DEPENDS blockforest boundary core field lbm postprocessing stencil timeloop vtk )
waLBerla_add_executable( NAME CouetteFlow DEPENDS blockforest boundary core field lbm postprocessing stencil timeloop vtk sqlite )
##############
# Some tests #
......
......@@ -79,7 +79,7 @@
#include "lbm/vtk/NonEquilibrium.h"
#include "lbm/vtk/Velocity.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
#include "stencil/D3Q15.h"
#include "stencil/D3Q19.h"
......@@ -871,10 +871,10 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
realProperties[ "simulationProgress" ] = double_c( ( outerRun + uint_t(1) ) * innerTimeSteps ) / double_c( outerTimeSteps * innerTimeSteps );
auto runId = postprocessing::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
auto runId = sqlite::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
}
}
}
......
......@@ -4,4 +4,4 @@ waLBerla_link_files_to_builddir( "*.py" )
waLBerla_add_executable ( NAME FieldCommunication
DEPENDS blockforest core domain_decomposition field postprocessing )
DEPENDS blockforest core domain_decomposition field postprocessing sqlite )
......@@ -14,7 +14,7 @@
#include "field/communication/PackInfo.h"
#include "field/communication/StencilRestrictedPackInfo.h"
#include "field/communication/UniformMPIDatatypeInfo.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
#include "python_coupling/CreateConfig.h"
#include "stencil/D3Q7.h"
#include "stencil/D3Q19.h"
......@@ -414,9 +414,9 @@ int main( int argc, char **argv )
stringProperties["buildType"] = std::string( WALBERLA_BUILD_TYPE );
stringProperties["compilerFlags"] = std::string( WALBERLA_COMPILER_FLAGS );
auto runId = postprocessing::storeRunInSqliteDB( databaseFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( databaseFile, runId, timingPool, "TimingRoot" );
postprocessing::storeTimingPoolInSqliteDB( databaseFile, runId, *reducedTimingPool, "TimingReduced" );
auto runId = sqlite::storeRunInSqliteDB( databaseFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( databaseFile, runId, timingPool, "TimingRoot" );
sqlite::storeTimingPoolInSqliteDB( databaseFile, runId, *reducedTimingPool, "TimingReduced" );
}
}
......
......@@ -3,12 +3,12 @@ waLBerla_link_files_to_builddir( *.py )
waLBerla_add_executable ( NAME PE_GranularGas
FILES PE_GranularGas.cpp SQLProperties.cpp Parameters.cpp NodeTimings.cpp
DEPENDS blockforest core pe postprocessing )
DEPENDS blockforest core pe postprocessing sqlite )
waLBerla_add_executable ( NAME MESA_PD_GranularGas
FILES MESA_PD_GranularGas.cpp SQLProperties.cpp Parameters.cpp NodeTimings.cpp sortParticleStorage.cpp CreateParticles.cpp
DEPENDS blockforest core pe mesa_pd postprocessing vtk )
DEPENDS blockforest core pe mesa_pd postprocessing vtk sqlite )
waLBerla_add_executable ( NAME MESA_PD_KernelBenchmark
FILES MESA_PD_KernelBenchmark.cpp SQLProperties.cpp Parameters.cpp NodeTimings.cpp sortParticleStorage.cpp CreateParticles.cpp
DEPENDS blockforest core pe mesa_pd postprocessing vtk )
DEPENDS blockforest core pe mesa_pd postprocessing vtk sqlite )
......@@ -58,7 +58,7 @@
#include <core/OpenMP.h>
#include <core/timing/Timer.h>
#include <core/waLBerlaBuildInfo.h>
#include <postprocessing/sqlite/SQLite.h>
#include <sqlite/SQLite.h>
#include <vtk/VTKOutput.h>
#include <functional>
......@@ -372,8 +372,8 @@ int main( int argc, char ** argv )
addDomainPropertiesToSQL(*forest, integerProperties, realProperties, stringProperties);
addSlurmPropertiesToSQL(integerProperties, realProperties, stringProperties);
runId = postprocessing::storeRunInSqliteDB( params.sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( params.sqlFile, runId, *tp_reduced, "Timeloop" );
runId = sqlite::storeRunInSqliteDB( params.sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( params.sqlFile, runId, *tp_reduced, "Timeloop" );
}
if (params.storeNodeTimings)
......
......@@ -64,7 +64,7 @@
#include <core/timing/Timer.h>
#include <core/timing/TimingPool.h>
#include <core/waLBerlaBuildInfo.h>
#include <postprocessing/sqlite/SQLite.h>
#include <sqlite/SQLite.h>
#include <vtk/VTKOutput.h>
#include <functional>
......@@ -378,8 +378,8 @@ int main( int argc, char ** argv )
addDomainPropertiesToSQL(*forest, integerProperties, realProperties, stringProperties);
addSlurmPropertiesToSQL(integerProperties, realProperties, stringProperties);
runId = postprocessing::storeRunInSqliteDB( params.sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( params.sqlFile, runId, *tp_reduced, "Timeloop" );
runId = sqlite::storeRunInSqliteDB( params.sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( params.sqlFile, runId, *tp_reduced, "Timeloop" );
}
if (params.storeNodeTimings)
{
......
......@@ -63,7 +63,7 @@ void storeNodeTimings( const uint_t runId,
realProperties[v.first] = v.second.average();
}
postprocessing::storeAdditionalRunInfoInSqliteDB( runId,
sqlite::storeAdditionalRunInfoInSqliteDB( runId,
dbFile,
tableName,
integerProperties,
......
......@@ -23,7 +23,7 @@
#include <core/mpi/Gatherv.h>
#include <core/logging/Logging.h>
#include <core/timing/TimingPool.h>
#include <postprocessing/sqlite/SQLite.h>
#include <sqlite/SQLite.h>
namespace walberla {
namespace mesa_pd {
......
......@@ -34,7 +34,7 @@
#include <core/OpenMP.h>
#include <core/timing/TimingTree.h>
#include <core/waLBerlaBuildInfo.h>
#include <postprocessing/sqlite/SQLite.h>
#include <sqlite/SQLite.h>
#include <vtk/VTKOutput.h>
#include <functional>
......@@ -325,8 +325,8 @@ int main( int argc, char ** argv )
mesa_pd::addDomainPropertiesToSQL(*forest, integerProperties, realProperties, stringProperties);
mesa_pd::addSlurmPropertiesToSQL(integerProperties, realProperties, stringProperties);
runId = postprocessing::storeRunInSqliteDB( params.sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( params.sqlFile, runId, *tp_reduced, "Timeloop" );
runId = sqlite::storeRunInSqliteDB( params.sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( params.sqlFile, runId, *tp_reduced, "Timeloop" );
}
if (params.storeNodeTimings)
{
......
......@@ -3,4 +3,4 @@ waLBerla_link_files_to_builddir( "*.dat" )
waLBerla_add_executable ( NAME NonUniformGridBenchmark
DEPENDS blockforest boundary core domain_decomposition field lbm postprocessing timeloop vtk )
\ No newline at end of file
DEPENDS blockforest boundary core domain_decomposition field lbm postprocessing timeloop vtk sqlite)
\ No newline at end of file
......@@ -64,7 +64,7 @@
#include "lbm/vtk/Density.h"
#include "lbm/vtk/Velocity.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
#include "stencil/D3Q19.h"
#include "stencil/D3Q27.h"
......@@ -1034,12 +1034,12 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
}
}
auto runId = postprocessing::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
auto runId = sqlite::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
if( blockStructureRefreshDuringMeasurement )
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRefreshTiming, "BlockForestRefresh" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRefreshTiming, "BlockForestRefresh" );
}
}
}
......
waLBerla_link_files_to_builddir( "*.dat" )
waLBerla_add_executable( NAME PoiseuilleChannel DEPENDS blockforest boundary core field lbm postprocessing stencil timeloop vtk )
waLBerla_add_executable( NAME PoiseuilleChannel DEPENDS blockforest boundary core field lbm postprocessing stencil timeloop vtk sqlite)
##############
# Some tests #
......
......@@ -78,7 +78,7 @@
#include "lbm/vtk/NonEquilibrium.h"
#include "lbm/vtk/Velocity.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
#include "stencil/D3Q19.h"
#include "stencil/D3Q27.h"
......@@ -995,10 +995,10 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
realProperties[ "simulationProgress" ] = double_c( ( outerRun + uint_t(1) ) * innerTimeSteps ) / double_c( outerTimeSteps * innerTimeSteps );
auto runId = postprocessing::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
auto runId = sqlite::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
}
}
}
......
......@@ -4,4 +4,4 @@ waLBerla_add_executable ( NAME PackPerformance
waLBerla_add_executable ( NAME ProbeVsExtraMessage
FILES ProbeVsExtraMessage.cpp
DEPENDS core postprocessing stencil )
DEPENDS core postprocessing stencil sqlite)
......@@ -26,7 +26,7 @@
#include "core/mpi/BufferSystem.h"
#include "core/mpi/MPIManager.h"
#include "core/timing/TimingPool.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
#include "stencil/D3Q27.h"
#include "stencil/D3Q19.h"
#include "stencil/D3Q7.h"
......@@ -250,9 +250,9 @@ int main( int argc, char ** argv )
stringProperties["SLURM_NTASKS_PER_SOCKET"] = envToString(std::getenv( "SLURM_NTASKS_PER_SOCKET" ));
stringProperties["SLURM_TASKS_PER_NODE"] = envToString(std::getenv( "SLURM_TASKS_PER_NODE" ));
auto runId = postprocessing::storeRunInSqliteDB( "ProbeVsTwoMessages.sqlite", integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( "ProbeVsTwoMessages.sqlite", runId, tp_twoMessages, "twoMessages" );
postprocessing::storeTimingPoolInSqliteDB( "ProbeVsTwoMessages.sqlite", runId, tp_probe, "probe" );
auto runId = sqlite::storeRunInSqliteDB( "ProbeVsTwoMessages.sqlite", integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( "ProbeVsTwoMessages.sqlite", runId, tp_twoMessages, "twoMessages" );
sqlite::storeTimingPoolInSqliteDB( "ProbeVsTwoMessages.sqlite", runId, tp_probe, "probe" );
}
return 0;
......
waLBerla_link_files_to_builddir( "*.dat" )
waLBerla_add_executable( NAME SchaeferTurek DEPENDS blockforest boundary core field lbm postprocessing stencil timeloop vtk )
waLBerla_add_executable( NAME SchaeferTurek DEPENDS blockforest boundary core field lbm postprocessing stencil timeloop vtk sqlite )
waLBerla_execute_test( NO_MODULE_LABEL NAME SchaeferTurekTest COMMAND $<TARGET_FILE:SchaeferTurek> Test2D.dat PROCESSES 4 CONFIGURATIONS Release RelWithDbgInfo )
\ No newline at end of file
......@@ -93,7 +93,7 @@
#include "lbm/vtk/NonEquilibrium.h"
#include "lbm/vtk/Velocity.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
#include "stencil/D3Q15.h"
#include "stencil/D3Q19.h"
......@@ -2787,12 +2787,12 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
if( evaluationCheckFrequency != uint_t(0) )
evaluation->getResultsForSQLOnRoot( realProperties, integerProperties );
auto runId = postprocessing::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
auto runId = sqlite::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSTiming, "RefinementTimeStep" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRTSLTiming, "RefinementTimeStepLevelwise" );
if( dynamicBlockStructure )
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRefreshTiming, "BlockForestRefresh" );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedRefreshTiming, "BlockForestRefresh" );
}
}
}
......
......@@ -3,4 +3,4 @@ waLBerla_link_files_to_builddir( "*.dat" )
waLBerla_add_executable ( NAME UniformGridBenchmark
DEPENDS blockforest boundary core domain_decomposition field lbm postprocessing timeloop vtk )
\ No newline at end of file
DEPENDS blockforest boundary core domain_decomposition field lbm postprocessing timeloop vtk sqlite )
\ No newline at end of file
......@@ -70,7 +70,7 @@
#include "lbm/vtk/Density.h"
#include "lbm/vtk/Velocity.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
#include "stencil/D3Q19.h"
#include "stencil/D3Q27.h"
......@@ -783,8 +783,8 @@ void run( const shared_ptr< Config > & config, const LatticeModel_T & latticeMod
stringProperties[ "fullCommunication" ] = ( fullComm ? "yes" : "no" );
stringProperties[ "directComm"] = ( directComm ? "yes" : "no" );
auto runId = postprocessing::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
auto runId = sqlite::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *reducedTimeloopTiming, "Timeloop" );
}
}
}
......
......@@ -32,7 +32,7 @@
#include <core/math/Random.h>
#include <core/timing/TimingTree.h>
#include <core/waLBerlaBuildInfo.h>
#include <postprocessing/sqlite/SQLite.h>
#include <sqlite/SQLite.h>
#include <vtk/VTKOutput.h>
#include <functional>
......@@ -289,9 +289,9 @@ int main( int argc, char ** argv )
//! [SQL Save]
WALBERLA_ROOT_SECTION()
{
auto runId = postprocessing::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
postprocessing::storeTimingPoolInSqliteDB( sqlFile, runId, *tpReduced, "Timeloop" );
postprocessing::storeTimingTreeInSqliteDB( sqlFile, runId, tt, "TimingTree" );
auto runId = sqlite::storeRunInSqliteDB( sqlFile, integerProperties, stringProperties, realProperties );
sqlite::storeTimingPoolInSqliteDB( sqlFile, runId, *tpReduced, "Timeloop" );
sqlite::storeTimingTreeInSqliteDB( sqlFile, runId, tt, "TimingTree" );
}
//! [SQL Save]
......
......@@ -6,7 +6,7 @@ waLBerla_add_executable ( NAME 01_Tutorial_ConfinedGas
waLBerla_add_executable ( NAME 02_Tutorial_ConfinedGasExtended
FILES 02_ConfinedGasExtended.cpp
DEPENDS blockforest core pe postprocessing vtk )
DEPENDS blockforest core pe postprocessing vtk sqlite )
waLBerla_execute_test( NO_MODULE_LABEL NAME 01_Tutorial_ConfinedGas PROCESSES 8 )
waLBerla_execute_test( NO_MODULE_LABEL NAME 02_Tutorial_ConfinedGasExtended
......
......@@ -22,6 +22,4 @@
#pragma once
#include "MarchingCubes.h"
#include "sqlite/SQLite.h"
\ No newline at end of file
#include "MarchingCubes.h"
\ No newline at end of file
###################################################################################################
#
# Module sqlite
#
###################################################################################################
waLBerla_add_module( DEPENDS core )
###################################################################################################
......@@ -30,7 +30,7 @@
namespace walberla {
namespace postprocessing {
namespace sqlite {
SQLiteDB::SQLiteDB( const string & dbFile, const int busyTimeout )
......@@ -513,5 +513,5 @@ void storeTimingTreeInSqliteDB ( const string & dbFile, uint_t runId,
db.storeTimingTree( runId, tt, timingTreeName );
}
} // namespace postprocessing
} // namespace sqlite
} // namespace walberla
......@@ -35,7 +35,7 @@
struct sqlite3;
namespace walberla {
namespace postprocessing {
namespace sqlite {
using std::string;
using std::map;
......@@ -126,7 +126,7 @@ void storeTimingTreeInSqliteDB( const string & dbFile, uint_t runId, const WcTim
} // namespace postprocessing
} // namespace sqlite
} // namespace walberla
......@@ -41,7 +41,6 @@
#include <core/waLBerlaBuildInfo.h>
#include <core/math/Random.h>
#include <core/math/Utility.h>
#include <postprocessing/sqlite/SQLite.h>
#include <vtk/VTKOutput.h>
#include <functional>
......
......@@ -6,7 +6,4 @@
waLBerla_compile_test( FILES SphereTriangulate.cpp )
waLBerla_execute_test( NAME SphereTriangulate )
waLBerla_compile_test( FILES SQLiteTest.cpp )
waLBerla_execute_test( NAME SQLiteTest )
waLBerla_execute_test( NAME SphereTriangulate )
\ No newline at end of file
###################################################################################################
#
# Tests for sqlite module
#
###################################################################################################
waLBerla_compile_test( FILES SQLiteTest.cpp )
waLBerla_execute_test( NAME SQLiteTest )
\ No newline at end of file
......@@ -22,7 +22,7 @@
#include "core/debug/TestSubsystem.h"
#include "core/mpi/Environment.h"
#include "postprocessing/sqlite/SQLite.h"
#include "sqlite/SQLite.h"
int main( int argc, char ** argv )
......@@ -40,7 +40,7 @@ int main( int argc, char ** argv )
strColumns["property2"] = "value2";
strColumns["property3"] = "value3";
intColumns["i"] = int(i);
walberla::postprocessing::storeRunInSqliteDB( "dbFile.sqlite", intColumns, strColumns );
walberla::sqlite::storeRunInSqliteDB( "dbFile.sqlite", intColumns, strColumns );
}
for( int i=0; i< 100; ++i )
......@@ -49,7 +49,7 @@ int main( int argc, char ** argv )
strColumns["property2"] = "value2";
strColumns["property3"] = "value3";
largeColumns["i"] = 4294967297 + i;
walberla::postprocessing::storeRunInSqliteDB( "dbFile.sqlite", largeColumns, strColumns );
walberla::sqlite::storeRunInSqliteDB( "dbFile.sqlite", largeColumns, strColumns );
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment