Gromacs  2022.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes
threaded_force_buffer.h File Reference
#include <memory>
#include "gromacs/math/arrayrefwithpadding.h"
#include "gromacs/math/vectypes.h"
#include "gromacs/mdtypes/enerdata.h"
#include "gromacs/mdtypes/simulation_workload.h"
#include "gromacs/topology/ifunc.h"
#include "gromacs/utility/alignedallocator.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/bitmask.h"
#include "gromacs/utility/classhelpers.h"
+ Include dependency graph for threaded_force_buffer.h:
+ This graph shows which files directly or indirectly include this file:

Description

This file contains the declaration of ThreadForceBuffer and ThreadedForceBuffer.

These classes provides thread-local force, shift force and energy buffers for kernels. These kernels can then run completely independently on multiple threads. Their output can be reduced thread-parallel afterwards.

Usage:

At domain decomposition time: Each thread calls: ThreadForceBuffer.resizeBufferAndClearMask() Each thread calls: ThreadForceBuffer.addAtomToMask() for all atoms used in the buffer Each thread calls: ThreadForceBuffer.processMask() After that ThreadedForceBuffer.setupReduction() is called

At force computation time: Each thread calls: ThreadForceBuffer.clearForcesAndEnergies(). Each thread can then accumulate forces and energies into the buffers in ThreadForceBuffer. After that ThreadedForceBuffer.reduce() is called for thread-parallel reduction.

Author
Berk Hess hess@.nosp@m.kth..nosp@m.se

Classes

class  gmx::ThreadForceBuffer< ForceBufferElementType >
 Object that holds force and energies buffers plus a mask for a thread. More...
 
class  gmx::ThreadedForceBuffer< ForceBufferElementType >
 Class for accumulating and reducing forces and energies on threads in parallel. More...