From: Rene Gassmoeller Date: Tue, 21 Jun 2022 19:42:44 +0000 (-0400) Subject: Add particle section X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8c18fd224a3690538ffa03ed8d866b1d9630c89;p=release-papers.git Add particle section --- diff --git a/9.4/paper.tex b/9.4/paper.tex index 5a37d7b..a9fa0ca 100644 --- a/9.4/paper.tex +++ b/9.4/paper.tex @@ -64,6 +64,7 @@ cross/.default={2pt}} Wolfgang Bangerth, Marco Feder, Marc Fehling, + Rene Gassm\"{o}ller, Timo Heister, Luca Heltai, Martin Kronbichler, @@ -102,6 +103,13 @@ cross/.default={2pt}} \author[2]{Marc~Fehling} +\author[13]{Rene~Gassm{\"o}ller} +\affil[13]{Department of Geological Sciences, + University of Florida, + 1843 Stadium Road, + Gainesville, FL, 32611, USA. + {\texttt{rene.gassmoeller@ufl.edu}}} + \author[5]{Timo~Heister} \affil[5]{School of Mathematical and Statistical Sciences, Clemson University, @@ -801,6 +809,25 @@ These utilities will be the building blocks for adding functions to the \texttt{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Performance improvement of particle infrastructure}\label{sec:particles} +We have improved upon the particle structure discussed in our previous release \citep{dealII93} by restructuring the storage of the particle identifiers. In our previous optimizations we stored all particle data as a separate continuous array for each particle property, but particle identifiers were still stored in a multimap tree-like structure. + +Our new particle storage is organized as follows: Particle IDs are stored in a list of dynamic arrays, each array contains the particle IDs of all particles in a unique cell. Each ID is a handle that determines the location of the data of this unique particle in the property arrays. +The list of ID arrays only contains entries for cells that contain particles. We keep a separate cache structure that contains pointers to the particular list entries for each cell that contains particles, and invalid entries for all cells that do not contain particles. + +This new structure allows for the following significant performance improvements: +All particle data (both their identifiers and their actual data) are now stored as separate and contiguous arrays in memory, which improves prefetching of data and makes iterating over particles extremely cache efficient. +The choice of a list container that only includes entries for cells that contain particles means iteration is efficient, even if many cells in the domain do not contain any particles (as can be the case for discrete-element models). +Creating separate arrays for each cell allows us to easily move particle IDs from one cell to another as a local operation, affecting only the two cell containers in question. We take care to reuse allocated memory to minimize the number of memory reallocations. +The separate cache structure that contains entries for each cell allows quick random-access to the particles of a particular cell, and also allows to quickly determine if a particular cell has particles at all. + +In addition to the new storage structure we have made the following algorithmic improvements: +Determining if a particle is inside a cell after changing its position involves inverting the mapping of this cell. We have reorganized our algorithms to perform these inversions on a batch of particles of a cell instead of particle-by-particle, which allows us to make use of vectorized instructions during the inversion. +In addition, after sorting all particles into their new cells, the arrays that store particle properties are now sorted in the same order as the particle IDs in the list of arrays, which allows for cache efficient iteration over particle properties. To avoid a costly sorting operation this operation is executed as a copy of the existing data into a new data container while iterating over particle IDs. + + + + + \todo[inline]{ * describe the new data structure