Potential backed by rgpot NWChemPot / CPMDPot (in-process dlopen of libnwchemc / libcpmdc). More...
#include <RgpotPot.h>
Public Member Functions | |
| RgpotPot (const eonc::Parameters &p) | |
| ~RgpotPot () override | |
| RgpotPot (const RgpotPot &)=delete | |
| RgpotPot & | operator= (const RgpotPot &)=delete |
| void | force (long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) override |
| bool | isThreadSafe () const noexcept override |
| Whether this potential's force() can be called from multiple threads on the SAME instance. | |
| bool | supportsBatchEvaluation () const noexcept override |
| With cpmdc calculator groups ([RgpotPot] ranks_per_image), a batch is spread over the groups by eonc::GroupSchedule: a system stays on the group that holds its orbitals, at most ceil(M / G) systems per group, then every rank receives every result, so all ranks keep the same band. | |
| 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 |
| void | forceBatchOwned (long nSystems, long nAtoms, const double *const *positions, const int *const *atomicNrs, double *const *forces, double *energies, double *variances, const double *const *boxes, const long *owners) override |
| owners[j] is system j's identity (a NEB image, a ring bead): it names the orbitals the engine starts from and keeps the system on one group across steps. | |
| bool | requiresIsolatedMoleculeLayout () const noexcept override |
| Molecular tasks retain Cartesian coordinates across storage-cell faces. | |
| const std::string & | backend () const noexcept |
| bool | engineAvailable () const |
| const eonc::CalculatorGroupUse & | groupUse () const noexcept |
| Calculator-group accounting on the driver. | |
| Public Member Functions inherited from eonc::Potential | |
| void | recordForceCall () noexcept |
| Charge one evaluated geometry to this potential and its owning registry. | |
| IPotRegistry & | registry () const noexcept |
| The registry this potential charges its force calls to. | |
| Potential (PotType a_ptype) | |
| Production default: construction-scope registry, else PotRegistry::get(). | |
| Potential (PotType a_ptype, IPotRegistry ®istry) | |
| Test seam: injected registry, no process-default get() counters. | |
| Potential (PotType a_ptype, const Parameters &p) | |
| Potential (const Parameters &a_params) | |
| virtual | ~Potential () |
| void | force (std::span< const double > positions, std::span< const int > atomicNrs, std::span< double > forces, double *energy, double *variance, std::span< const double > box) |
| C++ call site: size-checked view over the raw FFI force(). | |
| virtual void | setFixedMask (long nAtoms, const double *isFixed) |
| Optional frozen-atom mask (nAtoms*3, 1.0 = fixed). | |
| std::tuple< double, AtomMatrix > | get_ef (const AtomMatrix &pos, const VectorXi &atmnrs, const Matrix3d &box) |
| PotType | getType () const |
| virtual unsigned long long | surfaceEpoch () const noexcept |
| Host-visible surface generation. | |
| virtual double | finiteCutoff () const noexcept |
| Finite interaction range in position length units. | |
| virtual bool | isSurrogate () const noexcept |
| Whether this is a surrogate (GP) potential. | |
| virtual unsigned | layoutFlags () const noexcept |
| virtual bool | isSharedInstanceThreadSafe () const noexcept |
| Conservative gate for sharing one Potential instance across threads. | |
| virtual bool | needsPerImageInstance () const noexcept |
| Whether NEB should create separate Potential instances per image for true parallel force evaluation. | |
| virtual std::shared_ptr< Potential > | clonePotential () const |
| Independent instance that does not reload from disk. | |
| virtual void | bindBand (const std::vector< std::shared_ptr< Matter > > &) |
| NEB calls this with the finished band before the first force evaluation, so a host surface can name each image. | |
| virtual bool | forwardsStoredCell () const noexcept |
| A host that owns the cell reads the stored matrix. | |
| virtual bool | computesStress () const noexcept |
| True when force() leaves a Cauchy stress that cauchyStress() can read until the next force() on this instance. | |
| virtual Matrix3d | cauchyStress () const |
| Cauchy stress in eV/Angstrom^3. | |
| virtual double | hessianRange () const noexcept |
| Distance beyond which every Hessian block between two atoms is exactly zero, in position length units. | |
Private Member Functions | |
| void | serveWorker () |
| void | computeSingle (long N, const double *R, const int *atomicNrs, double *F, double *U, const double *box, int group) |
| void | computeBatch (long nSystems, long nAtoms, const double *const *positions, const int *const *atomicNrs, double *const *forces, double *energies, const double *const *boxes, const std::int64_t *owners, const std::int64_t *route) |
| void | sendStop () |
| void | stopAndDrop () |
| void | releaseWorkersAtExit () |
| void | exchangeGroupUse () |
| bool | evaluate (long N, const double *R, const int *atomicNrs, double *F, double *U, const double *box, std::string &error) |
Private Attributes | |
| std::unique_ptr< RGPotEngine > | impl_ |
| std::string | backend_ |
| bool | isolatedMolecule_ {false} |
| bool | driver_ {true} |
| bool | stopped_ {false} |
| bool | dropped_ {false} |
| bool | acked_ {false} |
| double | busy_ {0.0} |
| double | systemsDone_ {0.0} |
| eonc::CalculatorGroupUse | use_ |
| std::unique_ptr< eonc::GroupSchedule > | schedule_ |
Additional Inherited Members | |
| Public Types inherited from eonc::Potential | |
| enum class | PotLayout : unsigned { InProcess = 1u << 0 , NeedsWorkingDirectory = 1u << 1 , Subprocess = 1u << 2 } |
| How the pot is executed. Combine with bitwise or. More... | |
| Public Attributes inherited from eonc::Potential | |
| std::atomic< size_t > | forceCallCounter |
| Protected Attributes inherited from eonc::Potential | |
| PotType | ptype |
Potential backed by rgpot NWChemPot / CPMDPot (in-process dlopen of libnwchemc / libcpmdc).
Not potserv RPC. Configure via [RgpotPot] INI; energy eV, forces eV/Angstrom.
Definition at line 28 of file RgpotPot.h.
|
explicit |
Definition at line 19 of file RgpotPot.cpp.
|
override |
Definition at line 129 of file RgpotPot.cpp.
|
delete |
|
inlinenodiscardnoexcept |
Definition at line 63 of file RgpotPot.h.
|
private |
Definition at line 282 of file RgpotPot.cpp.
|
private |
Definition at line 266 of file RgpotPot.cpp.
|
nodiscard |
Definition at line 139 of file RgpotPot.cpp.
|
private |
Definition at line 255 of file RgpotPot.cpp.
|
private |
Definition at line 163 of file RgpotPot.cpp.
|
overridevirtual |
Implements eonc::Potential.
Definition at line 385 of file RgpotPot.cpp.
|
overridevirtual |
Reimplemented from eonc::Potential.
Definition at line 427 of file RgpotPot.cpp.
|
overridevirtual |
owners[j] is system j's identity (a NEB image, a ring bead): it names the orbitals the engine starts from and keeps the system on one group across steps.
Without it, or below zero, the batch position stands in.
Reimplemented from eonc::Potential.
Definition at line 436 of file RgpotPot.cpp.
|
inlinenodiscardnoexcept |
Calculator-group accounting on the driver.
The per-group columns are filled when the driver stops the workers; the driver prints them then.
Definition at line 67 of file RgpotPot.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 39 of file RgpotPot.h.
|
private |
Definition at line 204 of file RgpotPot.cpp.
|
inlinenodiscardoverridevirtualnoexcept |
Molecular tasks retain Cartesian coordinates across storage-cell faces.
Reimplemented from eonc::Potential.
Definition at line 60 of file RgpotPot.h.
|
private |
Definition at line 153 of file RgpotPot.cpp.
|
private |
Definition at line 322 of file RgpotPot.cpp.
|
private |
Definition at line 177 of file RgpotPot.cpp.
|
nodiscardoverridevirtualnoexcept |
With cpmdc calculator groups ([RgpotPot] ranks_per_image), a batch is spread over the groups by eonc::GroupSchedule: a system stays on the group that holds its orbitals, at most ceil(M / G) systems per group, then every rank receives every result, so all ranks keep the same band.
Reimplemented from eonc::Potential.
Definition at line 419 of file RgpotPot.cpp.
|
private |
Definition at line 97 of file RgpotPot.h.
|
private |
Definition at line 92 of file RgpotPot.h.
|
private |
Definition at line 99 of file RgpotPot.h.
|
private |
Definition at line 94 of file RgpotPot.h.
|
private |
Definition at line 96 of file RgpotPot.h.
|
private |
Definition at line 91 of file RgpotPot.h.
|
private |
Definition at line 93 of file RgpotPot.h.
|
private |
Definition at line 103 of file RgpotPot.h.
|
private |
Definition at line 95 of file RgpotPot.h.
|
private |
Definition at line 100 of file RgpotPot.h.
|
private |
Definition at line 101 of file RgpotPot.h.