#include <ExtPot.h>
Public Member Functions | |
| ExtPot (const Parameters &p) | |
| ~ExtPot () | |
| void | cleanMemory (void) |
| 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 |
| One instance owns one exchange directory, so two threads in force() on it write the same structure file and read the same result. | |
| bool | needsPerImageInstance () const noexcept override |
| The external program runs as a subprocess and each instance runs it in a directory of its own, so separate instances are independent. | |
| 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. | |
| virtual bool | supportsBatchEvaluation () const noexcept |
| Whether this potential supports batched evaluation of N systems in a single call. | |
| virtual 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) |
| Evaluate forces for N systems in a single call. | |
Private Member Functions | |
| void | passToSystem (long N, const double *R, const int *atomicNrs, const double *box) |
| void | recieveFromSystem (long N, double *F, double *U) |
| void | prepareExchangeDir () |
Private Attributes | |
| std::string | eon_extpot_path |
| std::filesystem::path | exchangeDir |
| bool | retainExchangeDir {false} |
Additional Inherited Members | |
| Public Attributes inherited from eonc::Potential | |
| std::atomic< size_t > | forceCallCounter |
| Protected Attributes inherited from eonc::Potential | |
| PotType | ptype |
| ExtPot::ExtPot | ( | const Parameters & | p | ) |
Definition at line 120 of file ExtPot.cpp.
| ExtPot::~ExtPot | ( | ) |
Definition at line 136 of file ExtPot.cpp.
| void ExtPot::cleanMemory | ( | void | ) |
Definition at line 124 of file ExtPot.cpp.
|
overridevirtual |
Implements eonc::Potential.
Definition at line 166 of file ExtPot.cpp.
|
inlinenodiscardoverridevirtualnoexcept |
One instance owns one exchange directory, so two threads in force() on it write the same structure file and read the same result.
Reimplemented from eonc::Potential.
Definition at line 29 of file ExtPot.h.
|
inlinenodiscardoverridevirtualnoexcept |
The external program runs as a subprocess and each instance runs it in a directory of its own, so separate instances are independent.
Reimplemented from eonc::Potential.
Definition at line 32 of file ExtPot.h.
|
private |
Definition at line 186 of file ExtPot.cpp.
|
private |
Definition at line 138 of file ExtPot.cpp.
|
private |
Create the directory the external command runs in and clear any exchange file left in it.
Definition at line 215 of file ExtPot.cpp.
|
private |
|
private |