Wraps one rgpot kernel as an eOn Potential. More...
#include <RgpotAdapter.h>
Public Member Functions | |
| template<class Cfg> | |
| RgpotAdapter (PotType ptype, const Parameters ¶ms, const Cfg &cfg) | |
| Kernels construct in place from their config: several hold mutexes or other immovable state, so the adapter never copies or moves them. | |
| RgpotAdapter (PotType ptype, const Parameters ¶ms) | |
| Kernels with no configuration surface default-construct in place. | |
| void | force (long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) override |
| bool | supportsBatchEvaluation () const noexcept override |
| Reports whether the kernel serves a batch natively. | |
| void | forceBatch (long nSystems, long nAtoms, const double *const *positions, const int *const *atomicNrs, double *const *forces, double *energies, double *variances, const double *const *boxes) override |
| Hands eOn's batch straight to the kernel. | |
| bool | isThreadSafe () const noexcept override |
| Whether this potential's force() can be called from multiple threads on the SAME instance. | |
| bool | needsPerImageInstance () const noexcept override |
| Whether NEB should create separate Potential instances per image for true parallel force evaluation. | |
| const RPot & | kernel () const noexcept |
| Public Member Functions inherited from eonc::Potential | |
| Potential (PotType a_ptype) | |
| Potential (PotType a_ptype, const Parameters &) | |
| Potential (const Parameters &a_params) | |
| virtual | ~Potential () |
| std::tuple< double, AtomMatrix > | get_ef (const AtomMatrix &pos, const VectorXi &atmnrs, const Matrix3d &box) |
| PotType | getType () const |
| virtual bool | isSurrogate () const noexcept |
| Whether this is a surrogate (GP) potential. | |
| virtual bool | requiresIsolatedMoleculeLayout () const noexcept |
| True for molecular QM / non-PBC backends (NWChem socket, ASE ORCA/NWChem, …). | |
| virtual bool | isSharedInstanceThreadSafe () const noexcept |
| Conservative gate for sharing one Potential instance across threads. | |
Private Attributes | |
| RPot | pot_ |
Additional Inherited Members | |
| Public Attributes inherited from eonc::Potential | |
| std::atomic< size_t > | forceCallCounter |
| Protected Attributes inherited from eonc::Potential | |
| PotType | ptype |
Wraps one rgpot kernel as an eOn Potential.
force() passes eOn's flat arrays straight into the kernel's forceImpl — the layouts match field for field, including the row-major 3x3 box — bypassing rgpot's AtomMatrix wrapper and its optional result cache. Thread-sharing policy derives from the kernel's capability descriptor instead of per-type lists.
Definition at line 27 of file RgpotAdapter.h.
|
inline |
Kernels construct in place from their config: several hold mutexes or other immovable state, so the adapter never copies or moves them.
Definition at line 32 of file RgpotAdapter.h.
|
inline |
|
inlineoverridevirtual |
Implements eonc::Potential.
Definition at line 41 of file RgpotAdapter.h.
|
inlineoverridevirtual |
Hands eOn's batch straight to the kernel.
eOn batches images of one system, so every system shares an atom count; rgpot allows them to differ, and filling nAtoms per system costs nothing and keeps the two contracts independent.
Calls forceBatchImpl rather than forceBatch for the same reason force() calls forceImpl: eOn owns caching, and routing through rgpot's cache would key the same geometry twice.
Reimplemented from eonc::Potential.
Definition at line 68 of file RgpotAdapter.h.
|
inlinenodiscardoverridevirtualnoexcept |
Whether this potential's force() can be called from multiple threads on the SAME instance.
Python-based potentials return false. Potentials with internal mutex (MetatomicPotential) return true but serialize internally – use needsPerImageInstance() to check if separate instances would enable true parallelism.
Reimplemented from eonc::Potential.
Definition at line 96 of file RgpotAdapter.h.
|
inlinenodiscardnoexcept |
Definition at line 106 of file RgpotAdapter.h.
|
inlinenodiscardoverridevirtualnoexcept |
Whether NEB should create separate Potential instances per image for true parallel force evaluation.
When true, NEB calls makePotential() once per image instead of sharing one instance. Override in potentials that use internal mutexes (e.g. MetatomicPotential).
Reimplemented from eonc::Potential.
Definition at line 100 of file RgpotAdapter.h.
|
inlinenodiscardoverridevirtualnoexcept |
Reports whether the kernel serves a batch natively.
rgpot answers every batch call, falling back to a per-system loop, so this asks the narrower question the eOn callers care about: is one batched call cheaper than N single ones? Only a native kernel makes it so.
Reimplemented from eonc::Potential.
Definition at line 56 of file RgpotAdapter.h.
|
private |
Definition at line 109 of file RgpotAdapter.h.