![]() |
Peano
|
#include "Benchmarks-main.h"
#include "Constants.h"
#include "tarch/NonCriticalAssertions.h"
#include "tarch/logging/Log.h"
#include "tarch/multicore/multicore.h"
#include "tarch/multicore/Core.h"
#include "peano4/peano.h"
#include "peano4/grid/Spacetree.h"
#include "peano4/parallel/SpacetreeSet.h"
#include "repositories/DataRepository.h"
#include "repositories/StepRepository.h"
#include "repositories/GlobalState.h"
#include "swift2/UserInterface.h"
#include "swift2/kernels/ParticleSetIterators.h"
#include "swift2/kernels/legacy/Density.h"
#include "swift2/kernels/legacy/HydroForce.h"
#include "swift2/kernels/legacy/Leapfrog.h"
#include "swift2/kernels/legacy/SmoothingLength.h"
#include "swift2/timestepping/Leapfrog.h"
#include "swift2/timestepping/TimeStepping.h"
#include "NohProblem.h"
#include "tarch/timing/Measurement.h"
#include "tarch/multicore/otter.h"
#include "globaldata/HydroPart.h"
#include "vertexdata/HydroPartSet.h"
Go to the source code of this file.
Functions | |
void | initParticle (globaldata::HydroPart &particle, int numberOfParticles, int index) |
Initialise the particles with some meaningful information. | |
void | initParticles (int numberOfParticles) |
void | prepareForceBenchmark (int numberOfParticles) |
Prepare the force benchmark. | |
std::vector< int > | createCoalescedMemoryIndices () |
Create coalesced particle indicator. | |
void | allocateParticles (int numberOfParticles) |
void | assessKernel (std::function< void(int) > kernelCallInLoop, const std::string &name, int numberOfParticles) |
void | runBenchmark (int numberOfParticles) |
void | initGridTraversalEvent () |
Initialise the global variable gridTraversalEvent. | |
int | main (int argc, char **argv) |
Main routine of the SPH code. | |
Variables | |
tarch::logging::Log | _log ("::") |
peano4::grid::GridTraversalEvent | gridTraversalEvent |
See initGridTraversalEvent() | |
vertexdata::HydroPartSet * | workItemParticleSet |
Definition at line 153 of file BenchmarkDriver.cpp.
References assertionEquals, tarch::Heap, and workItemParticleSet.
Referenced by runBenchmark().
void assessKernel | ( | std::function< void(int) > | kernelCallInLoop, |
const std::string & | name, | ||
int | numberOfParticles ) |
Definition at line 171 of file BenchmarkDriver.cpp.
References tarch::timing::Watch::getCalendarTime(), tarch::timing::Measurement::getValue(), logInfo, tarch::timing::Measurement::setValue(), tarch::timing::Watch::stop(), and tarch::timing::Measurement::toString().
Referenced by runBenchmark(), runBenchmarks(), and runBenchmarks().
std::vector< int > createCoalescedMemoryIndices | ( | ) |
Create coalesced particle indicator.
Whenever we enter a cell, we are given all the particles associated to the \( 2^d \) vertices of the cell as one big container. If we work with coalesced storage schemes, these particles will technically be stored as \( 2^d \) continuous sequences. In the benchmark, all particles of one work item are held in one continuous sequence, which is a special case of this. Nevertheless, we create a vector of integeres, which pretends that they were split up further.
So if chunk has 18 entries, it might, in 2d, holds the entries 5,5,5,3.
Definition at line 137 of file BenchmarkDriver.cpp.
References TwoPowerD.
Referenced by runBenchmark().
void initGridTraversalEvent | ( | ) |
Initialise the global variable gridTraversalEvent.
We work with one big traversal event which represents the unit square/cube. It is not refined, and none of the adjacent vertices are hanging. The traversal event is not used directly, but the markers are derived from it later throughout the benchmark run.
Definition at line 446 of file BenchmarkDriver.cpp.
References gridTraversalEvent.
Referenced by main().
Initialise the particles with some meaningful information.
We basically spread them out evenly (so there's no division by zero if we compute distances) and then use the Noh2d setup to give each particle a meaningful value.
Definition at line 65 of file BenchmarkDriver.cpp.
References benchmarks::swift2::hydro::kernel_throughput::initNohProblemIC().
Referenced by initParticles().
Definition at line 85 of file BenchmarkDriver.cpp.
References initParticle(), and workItemParticleSet.
Referenced by prepareForceBenchmark(), and runBenchmark().
Main routine of the SPH code.
Definition at line 475 of file BenchmarkDriver.cpp.
References peano4::fillLookupTables(), tarch::multicore::Core::getInstance(), tarch::multicore::Core::getNumberOfThreads(), initGridTraversalEvent(), tarch::initNonCriticalAssertionEnvironment(), peano4::initParallelEnvironment(), peano4::initSingletons(), tarch::multicore::initSmartMPI(), logError, logInfo, swift2::parseCommandLineArguments(), runBenchmark(), peano4::shutdownParallelEnvironment(), and peano4::shutdownSingletons().
Prepare the force benchmark.
To prepare for the force benchmark, we run through the following steps:
Definition at line 110 of file BenchmarkDriver.cpp.
References swift2::kernels::forAllParticles(), gridTraversalEvent, initParticles(), and workItemParticleSet.
Referenced by runBenchmark().
Definition at line 194 of file BenchmarkDriver.cpp.
References allocateParticles(), assessKernel(), createCoalescedMemoryIndices(), swift2::kernels::coalesced::forAllParticlePairs(), swift2::kernels::coalesced::prefixcheck::forAllParticlePairs(), swift2::kernels::ompoffloading::forAllParticlePairs(), swift2::kernels::forAllParticlePairs(), swift2::kernels::coalesced::forAllParticles(), swift2::kernels::coalesced::prefixcheck::forAllParticles(), swift2::kernels::ompoffloading::forAllParticles(), swift2::kernels::forAllParticles(), tarch::freeMemory(), gridTraversalEvent, tarch::Heap, initParticles(), logInfo, prepareForceBenchmark(), and workItemParticleSet.
Referenced by main().
tarch::logging::Log _log("::") | ( | "::" | ) |
peano4::grid::GridTraversalEvent gridTraversalEvent |
Definition at line 53 of file BenchmarkDriver.cpp.
Referenced by initGridTraversalEvent(), prepareForceBenchmark(), and runBenchmark().
vertexdata::HydroPartSet* workItemParticleSet |
Definition at line 55 of file BenchmarkDriver.cpp.
Referenced by allocateParticles(), initParticles(), prepareForceBenchmark(), and runBenchmark().