3 #include "KernelBenchmarks-main.h"
8 #include "repositories/SolverRepository.h"
11 #include "exahype2/CellData.h"
12 #include "exahype2/dg/DGUtils.h"
15 #include "kernels/AderSolver/BufferSizes.h"
16 #include "kernels/AderSolver/DGMatrices.h"
17 #include "kernels/AderSolver/FaceIntegral.h"
18 #include "kernels/AderSolver/FusedSpaceTimePredictorVolumeIntegral.h"
19 #include "kernels/AderSolver/MaxScaledEigenvalue.h"
20 #include "kernels/AderSolver/Quadrature.h"
21 #include "kernels/AderSolver/RiemannSolver.h"
22 #include "peano4/peano4.h"
23 #include "tarch/accelerator/accelerator.h"
24 #include "tarch/accelerator/Device.h"
25 #include "tarch/logging/Log.h"
26 #include "tarch/multicore/BooleanSemaphore.h"
27 #include "tarch/multicore/Core.h"
28 #include "tarch/multicore/Lock.h"
29 #include "tarch/multicore/multicore.h"
30 #include "tarch/NonCriticalAssertions.h"
31 #include "tarch/timing/Measurement.h"
32 #include "tarch/timing/Watch.h"
37 #pragma float_control(precise, on)
38 #pragma STDC FENV_ACCESS ON
44 tarch::logging::Log
_log(
"::");
48 const tarch::la::Vector<DIMENSIONS, double>
49 cellCenter = benchmarks::exahype2::kernelbenchmarks::DomainOffset
50 + 0.5 * benchmarks::exahype2::kernelbenchmarks::DomainSize;
51 const tarch::la::Vector<DIMENSIONS, double>
cellSize = benchmarks::exahype2::kernelbenchmarks::DomainSize / 81.0;
54 static_assert(Accuracy >= std::numeric_limits<double>::epsilon() || Accuracy == 0.0);
56 int main(
int argc,
char** argv) {
57 peano4::init(&argc, &argv, benchmarks::exahype2::kernelbenchmarks::DomainOffset, benchmarks::exahype2::kernelbenchmarks::DomainSize);
58 repositories::initLogFilters();
60 if constexpr (EnableFPE) {
61 feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
64 logInfo(
"main()",
"number of compute threads: " << tarch::multicore::Core::getInstance().getNumberOfThreads());
65 logInfo(
"main()",
"number of threads launching compute kernels: " << NumberOfLaunchingThreads);
66 logInfo(
"main()",
"number of unknowns: " << AderSolver::NumberOfUnknowns);
67 logInfo(
"main()",
"number of auxiliary variables: " << AderSolver::NumberOfAuxiliaryVariables);
68 logInfo(
"main()",
"number of finite volumes per axis per cell: " << AderSolver::Order);
69 logInfo(
"main()",
"number of samples per measurement: " << NumberOfSamples);
70 logInfo(
"main()",
"floating-point exception handler enabled: " << std::boolalpha << EnableFPE);
71 logInfo(
"main()",
"performing accuracy checks with precision: " << Accuracy);
72 #if defined(WITH_GPU_SYCL)
73 logInfo(
"main()",
"set SYCL_DEVICE_FILTER=gpu or ONEAPI_DEVICE_SELECTOR=cuda:0 when using SYCL on the device");
74 logInfo(
"main()",
"set SYCL_PI_TRACE=2 in case of runtime errors");
77 std::ostringstream snapshotFileName;
78 snapshotFileName <<
"ader-benchmarks-prec-"
79 <<
typeid(SolverPrecision).
name()
81 std::ofstream file( snapshotFileName.str() );
82 file <<
"Variant,omp threads,cells,total compute time,total time (including launch),avg compute time,avg time,max,min,std deviation" << std::endl;
84 for (
int i = 0; i < NumberOfCellsToStudy.size(); i++) {
85 logInfo(
"main()",
"number of cells: " << NumberOfCellsToStudy[i]);
constexpr double timeStamp
const tarch::la::Vector< DIMENSIONS, double > cellCenter
const tarch::la::Vector< DIMENSIONS, double > cellSize
constexpr double timeStepSize
int main(int argc, char **argv)
tarch::logging::Log _log("::")
void runBenchmarks(int numberOfCells, double timeStamp, double timeStepSize, const tarch::la::Vector< DIMENSIONS, double > cellCenter, const tarch::la::Vector< DIMENSIONS, double > cellSize)
void runBenchmarks(int numberOfCells, double timeStamp, double timeStepSize, const tarch::la::Vector< DIMENSIONS, double > cellCenter, const tarch::la::Vector< DIMENSIONS, double > cellSize)
void runBenchmarks(int numberOfCells, double timeStamp, double timeStepSize, const tarch::la::Vector< DIMENSIONS, double > cellCenter, const tarch::la::Vector< DIMENSIONS, double > cellSize)
void runBenchmarks(int numberOfCells, double timeStamp, double timeStepSize, const tarch::la::Vector< DIMENSIONS, double > cellCenter, const tarch::la::Vector< DIMENSIONS, double > cellSize)
void runBenchmarks(int numberOfCells, double timeStamp, double timeStepSize, const tarch::la::Vector< DIMENSIONS, double > cellCenter, const tarch::la::Vector< DIMENSIONS, double > cellSize)
void runBenchmarks(int numberOfCells, double timeStamp, double timeStepSize, const tarch::la::Vector< DIMENSIONS, double > cellCenter, const tarch::la::Vector< DIMENSIONS, double > cellSize)