13 template <
typename TFinder>
14 void finderRun(Benchmark::Context& context, TFinder& finder,
const Size particleCnt) {
20 finder.build(pool, r);
21 while (context.running()) {
22 for (
Size i = 0; i < r.
size(); ++i) {
23 finder.findAll(i, 2._f * r[i][
H], neighs);
25 distSum += n.distanceSqr;
31 BENCHMARK(
"Finder run KdTree",
"[finders]", Benchmark::Context& context) {
36 BENCHMARK(
"Finder run UniformGrid",
"[finders]", Benchmark::Context& context) {
41 BENCHMARK(
"Finder run BruteForce",
"[finders]", Benchmark::Context& context) {
57 while (context.running()) {
58 finder.
build(scheduler, r);
63 BENCHMARK(
"Finder build KdTree Sequential",
"[finders]", Benchmark::Context& context) {
68 BENCHMARK(
"Finder build KdTree ThreadPool",
"[finders]", Benchmark::Context& context) {
74 BENCHMARK(
"Finder build KdTree Tbb",
"[finders]", Benchmark::Context& context) {
Object finding nearest neighbours by evaluating all partice pairs.
Filling spatial domain with SPH particles.
Object defining computational domain.
void finderRun(Benchmark::Context &context, TFinder &finder, const Size particleCnt)
BENCHMARK("Finder run KdTree", "[finders]", Benchmark::Context &context)
uint32_t Size
Integral type used to index arrays (by default).
K-d tree for efficient search of neighbouring particles.
Simple thread pool with fixed number of threads.
SequentialScheduler SEQUENTIAL
Global instance of the sequential scheduler.
INLINE void clobberMemory()
Implements IScheduler interface using TBB.
BasicVector< Float > Vector
Generic dynamically allocated resizable storage.
INLINE TCounter size() const noexcept
Searches for neighbours by 'brute force', comparing every pair of vectors.
virtual Array< Vector > generate(IScheduler &scheduler, const Size n, const IDomain &domain) const override
Generates the requested number of particles in the domain.
Interface of objects finding neighbouring particles.
void build(IScheduler &scheduler, ArrayView< const Vector > points)
Constructs the struct with an array of vectors.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
K-d tree, used for hierarchical clustering of particles and accelerated Kn queries.
Spherical domain, defined by the center of sphere and its radius.
static SharedPtr< Tbb > getGlobalInstance()
Thread pool capable of executing tasks concurrently.
static SharedPtr< ThreadPool > getGlobalInstance()
Returns the global instance of the thread pool.
Holds information about a neighbour particles.