Peano
Loading...
Searching...
No Matches
BenchmarkDriver.cpp File Reference
#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"
Include dependency graph for BenchmarkDriver.cpp:

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< intcreateCoalescedMemoryIndices ()
 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
 

Function Documentation

◆ allocateParticles()

void allocateParticles ( int numberOfParticles)

Definition at line 153 of file BenchmarkDriver.cpp.

References assertionEquals, tarch::Heap, and workItemParticleSet.

Referenced by runBenchmark().

Here is the caller graph for this function:

◆ assessKernel()

void assessKernel ( std::function< void(int) > kernelCallInLoop,
const std::string & name,
int numberOfParticles )

◆ createCoalescedMemoryIndices()

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().

Here is the caller graph for this function:

◆ initGridTraversalEvent()

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().

Here is the caller graph for this function:

◆ initParticle()

void initParticle ( globaldata::HydroPart & particle,
int numberOfParticles,
int index )

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initParticles()

void initParticles ( int numberOfParticles)

Definition at line 85 of file BenchmarkDriver.cpp.

References initParticle(), and workItemParticleSet.

Referenced by prepareForceBenchmark(), and runBenchmark().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

◆ prepareForceBenchmark()

void prepareForceBenchmark ( int numberOfParticles)

Prepare the force benchmark.

To prepare for the force benchmark, we run through the following steps:

  • Initialise the particles through an initParticles() call. This initialises the workItemParticleSet sequence.
  • invoke resetSmoothingLengthIterationCounter() and resetAcceleration() on the particles. For this, we run over all the workItemParticleSets and, within each set, use the forAllParticles function to initialise the particles.

Definition at line 110 of file BenchmarkDriver.cpp.

References swift2::kernels::forAllParticles(), gridTraversalEvent, initParticles(), and workItemParticleSet.

Referenced by runBenchmark().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ runBenchmark()

Variable Documentation

◆ _log

tarch::logging::Log _log("::") ( "::" )

◆ gridTraversalEvent

◆ workItemParticleSet

vertexdata::HydroPartSet* workItemParticleSet