ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include "config/config.hpp"
Go to the source code of this file.
Classes | |
struct | BHData |
Macros | |
#define | WARPSIZE 32 |
Barnes-Hut warp size. | |
#define | MAXDEPTH 32 |
Maximal depth of the Barnes-Hut tree branching. | |
Barnes-Hut thread count for different kernels. | |
#define | THREADS1 512 |
#define | THREADS2 1024 |
#define | THREADS3 1024 |
#define | THREADS4 1024 |
#define | THREADS5 256 |
Barnes-Hut block factor for different kernels. | |
block count = factor * number of blocks | |
#define | FACTOR1 2 |
#define | FACTOR2 1 |
#define | FACTOR3 1 /* must all be resident at the same time */ |
#define | FACTOR4 1 /* must all be resident at the same time */ |
#define | FACTOR5 4 |
Functions | |
void | setBHPrecision (float epssq, float itolsq) |
Barnes-Hut parameters setter. | |
void | allocBHmemCopy (int nbodies, BHData *bh_data) |
An allocation of the GPU device memory and an initialization where it is needed. | |
void | deallocBH (BHData *bh_data) |
A deallocation of the GPU device memory. | |
void | fill_bh_data (float const *r, float const *dip, BHData const *bh_data) |
Copy Barnes-Hut data to bhpara and copy particle data. | |
void | initBHgpu (int blocks) |
Barnes-Hut CUDA initialization. | |
void | buildBoxBH (int blocks) |
Building Barnes-Hut spatial min/max position box. | |
void | buildTreeBH (int blocks) |
Building Barnes-Hut tree in a linear child array representation of octant cells and particles inside. | |
void | summarizeBH (int blocks) |
Calculate octant cells masses and cell index counts. Determine cells centers of mass and total dipole moments on all possible levels of the Barnes-Hut tree. | |
void | sortBH (int blocks) |
Sort particle indexes according to the Barnes-Hut tree representation. Crucial for the per-warp performance tuning of forceCalculationKernel and energyCalculationKernel . | |
void | forceBH (BHData *bh_data, float k, float *f, float *torque) |
Barnes-Hut force calculation. | |
void | energyBH (BHData *bh_data, float k, float *E) |
Barnes-Hut energy calculation. | |
#define FACTOR1 2 |
Definition at line 73 of file barnes_hut_gpu_cuda.cuh.
#define FACTOR2 1 |
Definition at line 74 of file barnes_hut_gpu_cuda.cuh.
#define FACTOR3 1 /* must all be resident at the same time */ |
Definition at line 75 of file barnes_hut_gpu_cuda.cuh.
#define FACTOR4 1 /* must all be resident at the same time */ |
Definition at line 76 of file barnes_hut_gpu_cuda.cuh.
#define FACTOR5 4 |
Definition at line 77 of file barnes_hut_gpu_cuda.cuh.
#define MAXDEPTH 32 |
Maximal depth of the Barnes-Hut tree branching.
Definition at line 83 of file barnes_hut_gpu_cuda.cuh.
#define THREADS1 512 |
Definition at line 63 of file barnes_hut_gpu_cuda.cuh.
#define THREADS2 1024 |
Definition at line 64 of file barnes_hut_gpu_cuda.cuh.
#define THREADS3 1024 |
Definition at line 65 of file barnes_hut_gpu_cuda.cuh.
#define THREADS4 1024 |
Definition at line 66 of file barnes_hut_gpu_cuda.cuh.
#define THREADS5 256 |
Definition at line 67 of file barnes_hut_gpu_cuda.cuh.
#define WARPSIZE 32 |
Barnes-Hut warp size.
Definition at line 81 of file barnes_hut_gpu_cuda.cuh.
void allocBHmemCopy | ( | int | nbodies, |
BHData * | bh_data | ||
) |
An allocation of the GPU device memory and an initialization where it is needed.
Definition at line 1177 of file barnes_hut_gpu_cuda.cu.
References BHData::blocks, BHData::child, BHData::count, cuda_get_device(), cuda_get_device_props(), cuda_safe_mem, BHData::err, FACTOR1, BHData::mass, BHData::max_lps, BHData::maxp, BHData::minp, BHData::nbodies, BHData::nnodes, BHData::r, BHData::sort, BHData::start, and BHData::u.
void buildBoxBH | ( | int | blocks | ) |
Building Barnes-Hut spatial min/max position box.
Definition at line 1040 of file barnes_hut_gpu_cuda.cu.
References block(), cuda_safe_mem, FACTOR1, KERNELCALL, and THREADS1.
void buildTreeBH | ( | int | blocks | ) |
Building Barnes-Hut tree in a linear child array representation of octant cells and particles inside.
Definition at line 1054 of file barnes_hut_gpu_cuda.cu.
References block(), cuda_safe_mem, FACTOR2, KERNELCALL, and THREADS2.
void deallocBH | ( | BHData * | bh_data | ) |
A deallocation of the GPU device memory.
Definition at line 1152 of file barnes_hut_gpu_cuda.cu.
References BHData::child, BHData::count, cuda_safe_mem, BHData::err, BHData::mass, BHData::max_lps, BHData::maxp, BHData::minp, BHData::r, BHData::sort, BHData::start, and BHData::u.
Referenced by DipolarBarnesHutGpu::~DipolarBarnesHutGpu().
void energyBH | ( | BHData * | bh_data, |
float | k, | ||
float * | E | ||
) |
Barnes-Hut energy calculation.
Definition at line 1113 of file barnes_hut_gpu_cuda.cu.
References block(), BHData::blocks, cuda_safe_mem, energySum, BHData::err, FACTOR5, KERNELCALL_shared, and THREADS5.
Referenced by DipolarBarnesHutGpu::long_range_energy().
void fill_bh_data | ( | float const * | r, |
float const * | dip, | ||
BHData const * | bh_data | ||
) |
Copy Barnes-Hut data to bhpara and copy particle data.
r | device particle positions to copy |
dip | device particle dipoles to copy |
bh_data | Barnes-Hut container |
Definition at line 1258 of file barnes_hut_gpu_cuda.cu.
References bhpara, cuda_safe_mem, BHData::nbodies, BHData::r, and BHData::u.
void forceBH | ( | BHData * | bh_data, |
float | k, | ||
float * | f, | ||
float * | torque | ||
) |
Barnes-Hut force calculation.
Definition at line 1094 of file barnes_hut_gpu_cuda.cu.
References block(), BHData::blocks, cuda_safe_mem, BHData::err, f, FACTOR5, KERNELCALL, THREADS5, and torque.
Referenced by DipolarBarnesHutGpu::add_long_range_forces().
void initBHgpu | ( | int | blocks | ) |
Barnes-Hut CUDA initialization.
Definition at line 1019 of file barnes_hut_gpu_cuda.cu.
References block(), FACTOR5, initializationKernel(), KERNELCALL, and THREADS5.
void setBHPrecision | ( | float | epssq, |
float | itolsq | ||
) |
Barnes-Hut parameters setter.
Definition at line 1145 of file barnes_hut_gpu_cuda.cu.
References cuda_safe_mem, epssqd, and itolsqd.
Referenced by DipolarBarnesHutGpu::on_activation().
void sortBH | ( | int | blocks | ) |
Sort particle indexes according to the Barnes-Hut tree representation. Crucial for the per-warp performance tuning of forceCalculationKernel
and energyCalculationKernel
.
Definition at line 1082 of file barnes_hut_gpu_cuda.cu.
References block(), cuda_safe_mem, FACTOR4, KERNELCALL, and THREADS4.
void summarizeBH | ( | int | blocks | ) |
Calculate octant cells masses and cell index counts. Determine cells centers of mass and total dipole moments on all possible levels of the Barnes-Hut tree.
Definition at line 1068 of file barnes_hut_gpu_cuda.cu.
References block(), cuda_safe_mem, FACTOR3, KERNELCALL, and THREADS3.