|
votca 2026-dev
|
Adds per-grid-box blocks into a set of AO matrices from inside an OpenMP loop over grid boxes. More...
#include <gridboxaccumulator.h>

Public Member Functions | |
| GridBoxAccumulator (std::vector< Eigen::MatrixXd * > targets, double budget_bytes=2.0e9) | |
| ~GridBoxAccumulator () | |
| GridBoxAccumulator (const GridBoxAccumulator &)=delete | |
| GridBoxAccumulator & | operator= (const GridBoxAccumulator &)=delete |
| bool | UsesThreadLocalCopies () const |
| void | Add (const GridBox &box, const std::vector< const Eigen::MatrixXd * > &small) |
| void | Finish () |
| sums the thread-local copies into the targets (call outside the loop) | |
Private Attributes | |
| std::vector< Eigen::MatrixXd * > | targets_ |
| bool | thread_local_ = false |
| std::vector< std::vector< Eigen::MatrixXd > > | copies_ |
Adds per-grid-box blocks into a set of AO matrices from inside an OpenMP loop over grid boxes.
A single critical section around all matrices serializes the loop when there are many of them (one per response density or per atom). Two strategies instead:
Usage: construct before the parallel loop, call Add() inside it (any thread), call Finish() after it.
Definition at line 56 of file gridboxaccumulator.h.
|
inlineexplicit |
targets: zero-initialized matrices of equal size; budget in bytes for the thread-local copies (all threads together)
Definition at line 60 of file gridboxaccumulator.h.
|
inline |
Definition at line 87 of file gridboxaccumulator.h.
|
delete |
|
inline |
adds the box blocks small[k] into target k, for all k (same order as the targets); entries with size 0 are skipped
Definition at line 101 of file gridboxaccumulator.h.
|
inline |
sums the thread-local copies into the targets (call outside the loop)
Definition at line 163 of file gridboxaccumulator.h.
|
delete |
|
inline |
Definition at line 97 of file gridboxaccumulator.h.
|
private |
Definition at line 182 of file gridboxaccumulator.h.
|
private |
Definition at line 180 of file gridboxaccumulator.h.
|
private |
Definition at line 181 of file gridboxaccumulator.h.