Table of Contents
Fetching ...

Tree codes and sort-and-sweep algorithms for neighborhood computation: A cache-conscious comparison

Dominik Krengel, Yuki Watanabe, Ko Kandori, Jian Chen, Hans-Georg Matuttis

TL;DR

This work compares sort-and-sweep and tree-code neighborhood algorithms for two-dimensional DEM simulations of polygonal particles in a rotating drum with up to 12000 particles and discusses the effects of system size and inlining on the performance with respect to the cache memory.

Abstract

Neighborhood algorithms may take a considerable percentage of computer time in discrete element methods (DEM). While the sort-and-sweep algorithm is ideal in some ways, as it only deal with particles whose relative positions change in one coordinate direction, the other directions must be processed too, for all particles. In contrast, tree-codes deal only with adjacent particles. We compare sort-and-sweep and tree-code neighborhood algorithms for two-dimensional DEM simulations of polygonal particles in a rotating drum with up to 12000 particles. We discuss the effects of system size and inlining on the performance with respect to the cache memory. For the tree code, the performance is slightly better, at the cost of significantly increased cyclomatic complexity. In particular, one benefit is improved possibilities for shared memory parallelization.

Tree codes and sort-and-sweep algorithms for neighborhood computation: A cache-conscious comparison

TL;DR

This work compares sort-and-sweep and tree-code neighborhood algorithms for two-dimensional DEM simulations of polygonal particles in a rotating drum with up to 12000 particles and discusses the effects of system size and inlining on the performance with respect to the cache memory.

Abstract

Neighborhood algorithms may take a considerable percentage of computer time in discrete element methods (DEM). While the sort-and-sweep algorithm is ideal in some ways, as it only deal with particles whose relative positions change in one coordinate direction, the other directions must be processed too, for all particles. In contrast, tree-codes deal only with adjacent particles. We compare sort-and-sweep and tree-code neighborhood algorithms for two-dimensional DEM simulations of polygonal particles in a rotating drum with up to 12000 particles. We discuss the effects of system size and inlining on the performance with respect to the cache memory. For the tree code, the performance is slightly better, at the cost of significantly increased cyclomatic complexity. In particular, one benefit is improved possibilities for shared memory parallelization.
Paper Structure (14 sections, 13 figures, 3 tables)

This paper contains 14 sections, 13 figures, 3 tables.

Figures (13)

  • Figure 1: A downscaled drum with fewer particles (top) with (only) upper bounding box coordinates in x- and y-direction for the sort-and-sweep algorithm, which exceed the number of possible particle contacts (middle), compared to the bounding boxes in the tree code which are based partitionings of the system (bottom).
  • Figure 2: Effective step of the sort-and-sweep algorithm where from timestep $n$ to timestep $n+1,$ the bounding box coordinates $b_2$ and $t_1$ changing their order along the x-axis, so that the particle pair 1 and 2 has to be registered in the neighborhood list.
  • Figure 3: Directions in the quadtree (upper left), an example of cells numbering with occupied cells (upper right) and, for the same occupation, our "minimal tree" (lower left) , in contrast to the "pruned tree" of Vemuri et al. Vemuri1998aVemuri1998b (lower right), where only the black branches are used while the gray ones may become activated when the particles move.
  • Figure 4: Example for the tree code in one dimension, with the original tree structure on top, followed by the occupation and size of the cells before and after the movement of particle $i5$. The following three trees show the rising of the particles to the highest node (Step 1), followed by the descent (Step 2) until an occupied node is met, and the creation of two leaf nodes on the lower level (Step 3).
  • Figure 5: Simplified flowchart for the quadtree neighborhood algorithm in two dimensions.
  • ...and 8 more figures