Project

General

Profile

Feature #842217

particle arrays: support optional double buffering

Added by Felix Höfling 2 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The approach of a "data-driven dependency resolution" sometimes results in logical dead-locks, for example if multiple integrators act on subsets of the same particle container. A generic way to resolve such situations could be the use of double buffering right in the particle array, see
https://en.wikipedia.org/wiki/Multiple_buffering

Idea: enable_buffering() must be called for a certain property (e.g., position) stored in mdsim::particle. Then, writing to the property will fill a fresh array, while reading always returns the same previous data. The cycle closes by calling a "sync()" function, which simply swaps the read and write buffers. (Without buffering, both are identical.)

Also available in: Atom PDF