Gromacs
2024.4
|
#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"
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.
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... | |