Loading...
Searching...
No Matches
JobResultProvenance.cpp
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#include "eon/JobResult.h"
13
14#include "eon/Parameters.h"
15#include "version.h"
16
17#include <algorithm>
18#include <cctype>
19#include <string>
20
21#ifdef WITH_RGMIN
22#include "eon/Optimizer.h"
23#include <rgmin.h>
24#endif
25
26namespace eonc {
27namespace {
28
29std::string lower_name(std::string name) {
30 std::ranges::transform(name, name.begin(), [](unsigned char c) {
31 return static_cast<char>(std::tolower(c));
32 });
33 return name;
34}
35
36} // namespace
37
39 JobResultProvenance provenance;
40 provenance.backend = lower_name(
41 std::string(magic_enum::enum_name(params.optimizer_options().method)));
42 provenance.engine_version = VERSION;
43 provenance.engine_build_identity = GIT_HASH;
44 provenance.rgpot_name = lower_name(
45 std::string(magic_enum::enum_name(params.potential_options().potential)));
46#ifdef WITH_RGPOT
47 provenance.rgpot_version = std::string(JobResultProvenance::rgpot_pin);
48#endif
49#ifdef WITH_RGMIN
50 if (params.optimizer_options().method == OptType::XTSCI ||
52 params)) {
53 provenance.xtsci = true;
54 const auto stamp = rgmin_abi_stamp();
55 provenance.xts_abi_major = stamp.abi_major;
56 provenance.xts_abi_minor = stamp.abi_minor;
57 provenance.xts_abi_layout = stamp.layout_revision;
58 }
59#endif
60 return provenance;
61}
62
63} // namespace eonc
The optimizer class is used to serve as an abstract class for all optimizers, as well as to call an o...
const potential_options_t & potential_options() const
const optimizer_options_t & optimizer_options() const
std::optional< std::string > rgminBackendMethod(OptType a_otype, const Parameters &a_params)
rgminMethodFor without the objective test: what a minimization of a potential energy runs under opt_b...
Definition Optimizer.cpp:34
RAII resource manager for the ARTn C library with global synchronization.
JobResultProvenance provenanceForJob(const Parameters &params)
Optimizer backend, engine identity, rgpot pin, and xts ABI from a job.
Optimizer, xtsci, eindir, and rgpot identity carried on a JobResult.
Definition JobResult.h:35
static constexpr std::string_view rgpot_pin
Definition JobResult.h:60