Loading...
Searching...
No Matches
RgpotPot.cpp
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3*/
5#include "eon/Parameters.h"
6#include "eon/PotRegistry.h"
8
9#include <algorithm>
10#include <cctype>
11#include <chrono>
12#include <cstdint>
13#include <cstdlib>
14#include <iostream>
15#include <ranges>
16#include <string>
17#include <vector>
18
20 : eonc::Potential(eonc::PotType::RGPOT, p) {
22 const auto &o = p.rgpot_options();
23 opt.backend = o.backend;
24 opt.basis = o.basis;
25 opt.theory = o.theory;
26 opt.scf_type = o.scf_type;
27 opt.functional = o.functional;
28 opt.cutoff_ry = o.cutoff_ry;
29 opt.charge = o.charge;
30 opt.multiplicity = o.multiplicity;
31 opt.engine_path = o.engine_path;
32 opt.engine_library = o.engine_library;
33 opt.engine_root = o.engine_root;
34 opt.title = o.title;
35 opt.memory_mb = o.memory_mb;
36 opt.scratch_dir = o.scratch_dir;
37 opt.input_block = o.input_block;
38 opt.permanent_dir = o.permanent_dir;
39 opt.params_path = o.params_path;
40 opt.ranks_per_image = o.ranks_per_image;
41 opt.model_path = o.model_path;
42 opt.device = o.device;
43 opt.length_unit = o.length_unit;
44 opt.extensions_directory = o.extensions_directory;
45 opt.check_consistency = o.check_consistency;
46 opt.uncertainty_threshold = o.uncertainty_threshold;
47 opt.torch_determinism_strict = o.torch_determinism_strict;
48 opt.xtb_paramset = o.xtb_paramset;
49 opt.xtb_accuracy = o.xtb_accuracy;
50 opt.xtb_electronic_temperature = o.xtb_electronic_temperature;
51 opt.xtb_max_iterations = o.xtb_max_iterations;
52 opt.xtb_charge = o.xtb_charge;
53 opt.xtb_uhf = o.xtb_uhf;
54 opt.task_name = o.task_name;
55
56 // Env overrides (CI / benchmarks)
57 if (const char *e = std::getenv("RGPOT_BACKEND"))
58 opt.backend = e;
59 if (const char *e = std::getenv("RGPOT_NWCHEM_BASIS"))
60 opt.basis = e;
61 if (const char *e = std::getenv("RGPOT_NWCHEM_THEORY"))
62 opt.theory = e;
63 if (const char *e = std::getenv("RGPOT_NWCHEM_SCF_TYPE"))
64 opt.scf_type = e;
65 if (const char *e = std::getenv("RGPOT_PARAMS_PATH"))
66 opt.params_path = e;
67 // Engine-path env overrides are backend-scoped: NWCHEMC_LIBRARY must not
68 // leak into a cpmdc configure (CPMDPot resolves CPMDC_LIBRARY itself).
69 std::string backend_lc = opt.backend;
70 std::ranges::transform(backend_lc, backend_lc.begin(),
71 [](unsigned char c) { return std::tolower(c); });
72 if (backend_lc.rfind("nwchem", 0) == 0) {
73 if (const char *e = std::getenv("NWCHEMC_LIBRARY"))
74 opt.engine_path = e;
75 else if (const char *e = std::getenv("RGPOT_NWCHEMC_ENGINE"))
76 opt.engine_path = e;
77 else if (const char *e = std::getenv("RGPOT_NWCHEM_ENGINE"))
78 opt.engine_path = e;
79 } else if (backend_lc.rfind("cpmd", 0) == 0) {
80 if (const char *e = std::getenv("CPMDC_LIBRARY"))
81 opt.engine_path = e;
82 else if (const char *e = std::getenv("RGPOT_CPMDC_ENGINE"))
83 opt.engine_path = e;
84 } else if (backend_lc.rfind("meta", 0) == 0 || backend_lc == "mta") {
85 if (const char *e = std::getenv("RGPOT_METATOMIC_ENGINE"))
86 opt.engine_path = e;
87 else if (const char *e = std::getenv("METATOMIC_ENGINE"))
88 opt.engine_path = e;
89 if (const char *e = std::getenv("RGPOT_METATOMIC_MODEL"))
90 opt.model_path = e;
91 } else if (backend_lc == "xtb" || backend_lc == "xtbpot" ||
92 backend_lc == "gfn" || backend_lc == "gfnxtb") {
93 if (const char *e = std::getenv("RGPOT_XTB_ENGINE"))
94 opt.engine_path = e;
95 else if (const char *e = std::getenv("XTB_ENGINE"))
96 opt.engine_path = e;
97 if (opt.xtb_paramset.empty() || opt.xtb_paramset == "GFN2xTB") {
98 if (!p.xtb_options().paramset.empty())
100 }
101 }
102
103 // Dual-read [Metatomic] when RGPOT backend is metatomic
104 if ((backend_lc.rfind("meta", 0) == 0 || backend_lc == "mta") &&
105 opt.model_path.empty())
107 if ((backend_lc.rfind("meta", 0) == 0 || backend_lc == "mta") &&
108 opt.device == "cpu" && !p.metatomic_options().device.empty())
110
111 impl_ = std::make_unique<RGPotEngine>(opt);
112 backend_ = impl_->backend();
113 isolatedMolecule_ = backend_ == "uma" && opt.task_name == "omol";
114 driver_ = impl_->worldRank() == 0;
115 std::cout
116 << "RgpotPot: in-process rgpot backend=" << backend_
117 << " (dlopen: "
118 "libnwchemc/libcpmdc/librgpot_metatomic_engine/librgpot_xtb_engine)"
119 << '\n';
120 // Finalize is registered first. The grouped-exit handler is next, and
121 // the stop handler is last, so exit runs stop, then Finalize, then _Exit.
122 impl_->finalizeMpiAtExit();
123 impl_->armGroupedExit();
125 if (!driver_)
126 serveWorker();
127}
128
130 const bool grouped = impl_ && impl_->calculatorWorld() > 1;
131 stopAndDrop();
132 // ~CPMDPot dlcloses libcpmdc. On several ranks that runs Fortran
133 // destructors while another rank may already be in MPI_Finalize.
134 // The process reclaims the engine at _Exit.
135 if (grouped)
136 static_cast<void>(impl_.release());
137}
138
139bool RgpotPot::engineAvailable() const { return impl_ && impl_->available(); }
140
141namespace {
142// Request header broadcast from the driver: kind, atoms, systems, and the
143// group a single request runs on.
144// kDown is the second broadcast: every rank has dropped CPMD, and
145// workers may enter MPI_Finalize.
146enum : std::int64_t { kStop = 0, kSingle = 1, kBatch = 2, kDown = 3 };
147
148// The driver's live potential, so an exit that skips the destructor still
149// releases the workers before MPI_Finalize.
150RgpotPot *g_driver = nullptr;
151} // namespace
152
154 if (!impl_ || !driver_ || stopped_ || impl_->calculatorWorld() <= 1)
155 return;
156 std::int64_t hdr[4] = {kStop, 0, 0, 0};
157 impl_->broadcastFromDriver(hdr, sizeof(hdr));
158 stopped_ = true;
159 if (g_driver == this)
160 g_driver = nullptr;
161}
162
164 const int groups = impl_->calculatorGroups();
165 use_.busy.assign(static_cast<size_t>(groups), 0.0);
166 use_.systems.assign(static_cast<size_t>(groups), 0.0);
167 for (int g = 0; g < groups; g++) {
168 double tally[3] = {busy_, systemsDone_, 0.0};
169 double unused = 0.0;
170 std::string error;
171 static_cast<void>(impl_->shareResult(g, 1, tally, &unused, true, error));
172 use_.busy[static_cast<size_t>(g)] = tally[0];
173 use_.systems[static_cast<size_t>(g)] = tally[1];
174 }
175}
176
178 if (!impl_)
179 return;
180 const bool grouped = driver_ && impl_->calculatorWorld() > 1;
181 if (grouped && !stopped_) {
182 sendStop();
183 try {
185 std::cout << "RgpotPot: " << use_.table() << std::flush;
186 } catch (const std::exception &ex) {
187 std::cerr << "RgpotPot: no calculator-group summary: " << ex.what()
188 << '\n';
189 }
190 }
191 if (!dropped_) {
192 impl_->shutdownModule();
193 dropped_ = true;
194 }
195 if (impl_->calculatorWorld() > 1)
196 impl_->armGroupedExit();
197 if (grouped && !acked_) {
198 std::int64_t hdr[4] = {kDown, 0, 0, 0};
199 impl_->broadcastFromDriver(hdr, sizeof(hdr));
200 acked_ = true;
201 }
202}
203
205 if (g_driver || !impl_ || impl_->calculatorWorld() <= 1)
206 return;
207 // Runs before the MPI_Finalize handler registered in the constructor.
208 // After a failed engine call the workers can sit in a collective that
209 // the stop broadcast never meets; the grouped exit handler aborts the
210 // world instead.
211 g_driver = this;
212 std::atexit([] {
213 if (g_driver && !RGPotEngine::mpiAbortRequested())
214 g_driver->stopAndDrop();
215 });
216}
217
218namespace {
219// Runs one evaluation and keeps its error instead of throwing, so the
220// rank still joins every broadcast that follows.
221bool try_force(const RGPotEngine &engine, long N, const double *R,
222 const int *atomicNrs, double *F, double *U, const double *box,
223 std::string &error) {
224 try {
225 engine.force(N, R, atomicNrs, F, U, box);
226 return true;
227 } catch (const std::exception &ex) {
228 error = ex.what();
229 return false;
230 }
231}
232
233// The orbital key of system j of a batch: its owner hint (a NEB image, a
234// ring bead) when it has one, else its batch position, kept apart from
235// the hints. A single evaluation has its own key. cpmdc keeps converged
236// orbitals per key, so a calculator that evaluates several systems in
237// turn starts each SCF from that system's own previous orbitals.
238constexpr std::int64_t kSingleKey = -1;
239std::int64_t orbital_key(const std::int64_t *owners, long j) {
240 if (owners && owners[j] >= 0)
241 return owners[j];
242 return -2 - static_cast<std::int64_t>(j);
243}
244
245[[noreturn]] void raise_failure(long system, int owner,
246 const std::string &error) {
247 std::string msg = "RGPOT: calculator " + std::to_string(owner) +
248 " failed on system " + std::to_string(system);
249 if (!error.empty())
250 msg += ": " + error;
251 throw std::runtime_error(msg);
252}
253} // namespace
254
255bool RgpotPot::evaluate(long N, const double *R, const int *atomicNrs,
256 double *F, double *U, const double *box,
257 std::string &error) {
258 const auto t0 = std::chrono::steady_clock::now();
259 const bool ok = try_force(*impl_, N, R, atomicNrs, F, U, box, error);
260 busy_ += std::chrono::duration<double>(std::chrono::steady_clock::now() - t0)
261 .count();
262 systemsDone_ += 1.0;
263 return ok;
264}
265
266void RgpotPot::computeSingle(long N, const double *R, const int *atomicNrs,
267 double *F, double *U, const double *box,
268 int group) {
269 // `group`, the one whose stored orbitals are nearest, computes; its
270 // first rank's result reaches every rank. rgpot keeps the engine's error
271 // agreement inside a calculator, so the other groups stay out of it.
272 std::string error;
273 bool ok = true;
274 if (impl_->calculatorIndex() == group) {
275 impl_->selectOrbitals(kSingleKey);
276 ok = evaluate(N, R, atomicNrs, F, U, box, error);
277 }
278 if (!impl_->shareResult(group, N, F, U, ok, error))
279 raise_failure(0, group, error);
280}
281
282void RgpotPot::computeBatch(long nSystems, long nAtoms,
283 const double *const *positions,
284 const int *const *atomicNrs, double *const *forces,
285 double *energies, const double *const *boxes,
286 const std::int64_t *owners,
287 const std::int64_t *route) {
288 const int mine = impl_->calculatorIndex();
289 auto ownerOf = [&](long j) { return static_cast<int>(route[j]); };
290 if (impl_->calculatorWorld() <= 1) {
291 for (long j = 0; j < nSystems; j++) {
292 impl_->selectOrbitals(orbital_key(owners, j));
293 impl_->force(nAtoms, positions[j], atomicNrs[j], forces[j], &energies[j],
294 boxes[j]);
295 }
296 return;
297 }
298 std::vector<char> ok(static_cast<size_t>(nSystems), 1);
299 std::vector<std::string> errors(static_cast<size_t>(nSystems));
300 for (long j = 0; j < nSystems; j++) {
301 if (ownerOf(j) == mine) {
302 impl_->selectOrbitals(orbital_key(owners, j));
303 ok[static_cast<size_t>(j)] =
304 evaluate(nAtoms, positions[j], atomicNrs[j], forces[j], &energies[j],
305 boxes[j], errors[static_cast<size_t>(j)]);
306 }
307 }
308 // Every share runs before any rank raises, so all ranks leave together.
309 long failed = -1;
310 for (long j = 0; j < nSystems; j++) {
311 const int owner = ownerOf(j);
312 if (!impl_->shareResult(owner, nAtoms, forces[j], &energies[j],
313 ok[static_cast<size_t>(j)] != 0,
314 errors[static_cast<size_t>(j)]) &&
315 failed < 0)
316 failed = j;
317 }
318 if (failed >= 0)
319 raise_failure(failed, ownerOf(failed), errors[static_cast<size_t>(failed)]);
320}
321
323 for (;;) {
324 std::int64_t hdr[4] = {kStop, 0, 0, 0};
325 impl_->broadcastFromDriver(hdr, sizeof(hdr));
326 if (hdr[0] == kStop) {
327 // Drop CPMD, wait until the driver has dropped it too, then exit 0.
328 // MPI_Finalize is collective and runs from the exit handler.
329 try {
331 } catch (const std::exception &) {
332 }
333 if (!dropped_) {
334 impl_->shutdownModule();
335 dropped_ = true;
336 }
337 std::int64_t ack[4] = {kDown, 0, 0, 0};
338 impl_->broadcastFromDriver(ack, sizeof(ack));
339 impl_->armGroupedExit();
340 std::exit(0);
341 }
342 const long n = static_cast<long>(hdr[1]);
343 const long m = hdr[0] == kBatch ? static_cast<long>(hdr[2]) : 1;
344 std::vector<double> R(static_cast<size_t>(3 * n * m));
345 std::vector<int> Z(static_cast<size_t>(n * m));
346 std::vector<double> box(static_cast<size_t>(9 * m));
347 impl_->broadcastFromDriver(R.data(), R.size() * sizeof(double));
348 impl_->broadcastFromDriver(Z.data(), Z.size() * sizeof(int));
349 impl_->broadcastFromDriver(box.data(), box.size() * sizeof(double));
350 std::vector<std::int64_t> ids(static_cast<size_t>(m), -1);
351 std::vector<std::int64_t> route(static_cast<size_t>(m), 0);
352 if (hdr[0] == kBatch) {
353 impl_->broadcastFromDriver(ids.data(), ids.size() * sizeof(std::int64_t));
354 impl_->broadcastFromDriver(route.data(),
355 route.size() * sizeof(std::int64_t));
356 }
357 std::vector<double> F(R.size()), U(static_cast<size_t>(m));
358 // A failed request raised on the driver too; the driver decides
359 // whether the job goes on, so a worker keeps serving.
360 if (hdr[0] == kSingle) {
361 try {
362 computeSingle(n, R.data(), Z.data(), F.data(), U.data(), box.data(),
363 static_cast<int>(hdr[3]));
364 } catch (const std::runtime_error &) {
365 }
366 continue;
367 }
368 std::vector<const double *> pos(static_cast<size_t>(m)), bx(pos.size());
369 std::vector<const int *> nrs(pos.size());
370 std::vector<double *> frc(pos.size());
371 for (long j = 0; j < m; j++) {
372 pos[static_cast<size_t>(j)] = R.data() + 3 * n * j;
373 nrs[static_cast<size_t>(j)] = Z.data() + n * j;
374 frc[static_cast<size_t>(j)] = F.data() + 3 * n * j;
375 bx[static_cast<size_t>(j)] = box.data() + 9 * j;
376 }
377 try {
378 computeBatch(m, n, pos.data(), nrs.data(), frc.data(), U.data(),
379 bx.data(), ids.data(), route.data());
380 } catch (const std::runtime_error &) {
381 }
382 }
383}
384
385void RgpotPot::force(long N, const double *R, const int *atomicNrs, double *F,
386 double *U, double *variance, const double *box) {
387 if (variance)
388 *variance = 0.0;
389 if (impl_->calculatorWorld() <= 1) {
390 impl_->selectOrbitals(kSingleKey);
391 impl_->force(N, R, atomicNrs, F, U, box);
392 return;
393 }
394 const auto t0 = std::chrono::steady_clock::now();
395 if (!schedule_)
396 schedule_ =
397 std::make_unique<eonc::GroupSchedule>(impl_->calculatorGroups());
398 // The group whose last geometry is nearest holds the warmest orbitals.
399 const int group = schedule_->nearest(R, 3 * N, box);
400 schedule_->settle(kSingleKey, group);
401 schedule_->record(kSingleKey, R, 3 * N, box);
402 std::int64_t hdr[4] = {kSingle, N, 1, group};
403 impl_->broadcastFromDriver(hdr, sizeof(hdr));
404 impl_->broadcastFromDriver(const_cast<double *>(R), 3 * N * sizeof(double));
405 impl_->broadcastFromDriver(const_cast<int *>(atomicNrs), N * sizeof(int));
406 impl_->broadcastFromDriver(const_cast<double *>(box), 9 * sizeof(double));
407 // Before the evaluation, so a failure that ends the job still stops
408 // the workers.
410 computeSingle(N, R, atomicNrs, F, U, box, group);
411 const double dt =
412 std::chrono::duration<double>(std::chrono::steady_clock::now() - t0)
413 .count();
414 use_.wall += dt;
415 use_.singleWall += dt;
416 use_.singles++;
417}
418
420 // One calculator gains from a batch too when the engine keeps orbitals
421 // per key: the batch carries each image's or bead's identity, a single
422 // force() does not.
423 return impl_ &&
424 (impl_->calculatorGroups() > 1 || impl_->keepsOrbitalsPerKey());
425}
426
427void RgpotPot::forceBatch(long nSystems, long nAtoms,
428 const double *const *positions,
429 const int *const *atomicNrs, double *const *forces,
430 double *energies, double *variances,
431 const double *const *boxes) {
432 forceBatchOwned(nSystems, nAtoms, positions, atomicNrs, forces, energies,
433 variances, boxes, nullptr);
434}
435
436void RgpotPot::forceBatchOwned(long nSystems, long nAtoms,
437 const double *const *positions,
438 const int *const *atomicNrs,
439 double *const *forces, double *energies,
440 double *variances, const double *const *boxes,
441 const long *owners) {
442 std::vector<std::int64_t> ids(static_cast<size_t>(nSystems), -1);
443 if (owners) {
444 for (long j = 0; j < nSystems; j++)
445 ids[static_cast<size_t>(j)] = owners[j];
446 }
447 const bool grouped = impl_->calculatorWorld() > 1;
448 const auto t0 = std::chrono::steady_clock::now();
449 std::vector<std::int64_t> route(static_cast<size_t>(nSystems), 0);
450 if (grouped) {
451 if (!schedule_)
452 schedule_ =
453 std::make_unique<eonc::GroupSchedule>(impl_->calculatorGroups());
454 std::vector<std::int64_t> keys(static_cast<size_t>(nSystems));
455 for (long j = 0; j < nSystems; j++)
456 keys[static_cast<size_t>(j)] = orbital_key(ids.data(), j);
457 const std::vector<int> groupOf = schedule_->assign(keys);
458 for (long j = 0; j < nSystems; j++) {
459 route[static_cast<size_t>(j)] = groupOf[static_cast<size_t>(j)];
460 schedule_->record(keys[static_cast<size_t>(j)], positions[j], 3 * nAtoms,
461 boxes[j]);
462 }
463 std::int64_t hdr[4] = {kBatch, nAtoms, nSystems, 0};
464 impl_->broadcastFromDriver(hdr, sizeof(hdr));
465 std::vector<double> R(static_cast<size_t>(3 * nAtoms * nSystems));
466 std::vector<int> Z(static_cast<size_t>(nAtoms * nSystems));
467 std::vector<double> box(static_cast<size_t>(9 * nSystems));
468 for (long j = 0; j < nSystems; j++) {
469 std::copy(positions[j], positions[j] + 3 * nAtoms,
470 R.begin() + 3 * nAtoms * j);
471 std::copy(atomicNrs[j], atomicNrs[j] + nAtoms, Z.begin() + nAtoms * j);
472 std::copy(boxes[j], boxes[j] + 9, box.begin() + 9 * j);
473 }
474 impl_->broadcastFromDriver(R.data(), R.size() * sizeof(double));
475 impl_->broadcastFromDriver(Z.data(), Z.size() * sizeof(int));
476 impl_->broadcastFromDriver(box.data(), box.size() * sizeof(double));
477 impl_->broadcastFromDriver(ids.data(), ids.size() * sizeof(std::int64_t));
478 impl_->broadcastFromDriver(route.data(),
479 route.size() * sizeof(std::int64_t));
480 }
482 computeBatch(nSystems, nAtoms, positions, atomicNrs, forces, energies, boxes,
483 ids.data(), route.data());
484 if (grouped) {
485 use_.wall +=
486 std::chrono::duration<double>(std::chrono::steady_clock::now() - t0)
487 .count();
488 use_.batches++;
489 }
490 for (long j = 0; j < nSystems; j++) {
491 if (variances)
492 variances[j] = 0.0;
494 }
495}
Opaque rgpot-backed engine (nwchemc / cpmdc / metatomic / uma / xtb).
Definition RGPotEngine.h:57
static bool mpiAbortRequested() noexcept
True once rgpot asked for MPI_Abort at exit in this process.
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, const double *box) const
Potential backed by rgpot NWChemPot / CPMDPot (in-process dlopen of libnwchemc / libcpmdc).
Definition RgpotPot.h:28
RgpotPot(const eonc::Parameters &p)
Definition RgpotPot.cpp:19
bool engineAvailable() const
Definition RgpotPot.cpp:139
std::string backend_
Definition RgpotPot.h:92
std::unique_ptr< eonc::GroupSchedule > schedule_
Definition RgpotPot.h:103
std::unique_ptr< RGPotEngine > impl_
Definition RgpotPot.h:91
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 ...
Definition RgpotPot.cpp:436
double busy_
Definition RgpotPot.h:99
bool isolatedMolecule_
Definition RgpotPot.h:93
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
Definition RgpotPot.cpp:427
bool stopped_
Definition RgpotPot.h:95
bool dropped_
Definition RgpotPot.h:96
void exchangeGroupUse()
Definition RgpotPot.cpp:163
bool acked_
Definition RgpotPot.h:97
double systemsDone_
Definition RgpotPot.h:100
bool driver_
Definition RgpotPot.h:94
~RgpotPot() override
Definition RgpotPot.cpp:129
void stopAndDrop()
Definition RgpotPot.cpp:177
void force(long N, const double *R, const int *atomicNrs, double *F, double *U, double *variance, const double *box) override
Definition RgpotPot.cpp:385
bool evaluate(long N, const double *R, const int *atomicNrs, double *F, double *U, const double *box, std::string &error)
Definition RgpotPot.cpp:255
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)
Definition RgpotPot.cpp:282
void serveWorker()
Definition RgpotPot.cpp:322
bool supportsBatchEvaluation() const noexcept override
With cpmdc calculator groups ([RgpotPot] ranks_per_image), a batch is spread over the groups by eonc:...
Definition RgpotPot.cpp:419
eonc::CalculatorGroupUse use_
Definition RgpotPot.h:101
void sendStop()
Definition RgpotPot.cpp:153
void releaseWorkersAtExit()
Definition RgpotPot.cpp:204
void computeSingle(long N, const double *R, const int *atomicNrs, double *F, double *U, const double *box, int group)
Definition RgpotPot.cpp:266
const metatomic_options_t & metatomic_options() const
const xtb_options_t & xtb_options() const
const rgpot_options_t & rgpot_options() const
void recordForceCall() noexcept
Charge one evaluated geometry to this potential and its owning registry.
Potential(PotType a_ptype)
Production default: construction-scope registry, else PotRegistry::get().
std::string error()
Definition DynLib.h:82
RAII resource manager for the ARTn C library with global synchronization.
std::string scf_type
Definition RGPotEngine.h:12
std::string title
Definition RGPotEngine.h:20
std::string xtb_paramset
Definition RGPotEngine.h:38
std::string basis
Definition RGPotEngine.h:10
std::string scratch_dir
Definition RGPotEngine.h:22
std::string engine_path
Definition RGPotEngine.h:17
std::string params_path
Definition RGPotEngine.h:27
std::string backend
Definition RGPotEngine.h:9
std::string extensions_directory
Definition RGPotEngine.h:33
std::string engine_library
Definition RGPotEngine.h:18
double xtb_electronic_temperature
Definition RGPotEngine.h:40
std::string permanent_dir
Definition RGPotEngine.h:25
std::string functional
Definition RGPotEngine.h:13
std::string length_unit
Definition RGPotEngine.h:32
bool torch_determinism_strict
Definition RGPotEngine.h:36
std::string device
Definition RGPotEngine.h:31
std::string model_path
Definition RGPotEngine.h:30
std::string task_name
Definition RGPotEngine.h:47
std::string engine_root
Definition RGPotEngine.h:19
double uncertainty_threshold
Definition RGPotEngine.h:35
std::string theory
Definition RGPotEngine.h:11
std::string input_block
Definition RGPotEngine.h:24