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

[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
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" );
}
}
}
......
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