Loading...
Searching...
No Matches
Job.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/Job.h"
13#include "eon/BasinHoppingJob.h"
14#include "eon/DynamicsJob.h"
17#include "eon/HessianJob.h"
18#include "eon/InstantonJob.h"
19#include "eon/JobRegistry.h"
20#include "eon/MinimizationJob.h"
21#include "eon/MonteCarloJob.h"
23#include "eon/OHTSTJob.h"
25#include "eon/Parameters.h"
26#include "eon/PointJob.h"
27#include "eon/PotRegistry.h"
28#include "eon/PrefactorJob.h"
31#include "eon/SaddleSearchJob.h"
32#include "eon/SafeHyperJob.h"
34#include "eon/TADJob.h"
35#include "eon/TestJob.h"
36
37#include <memory>
38
39namespace eonc {
40// Referenced from makeJob so MSVC does not drop this TU from a static
41// eonclib (anonymous-namespace registrars would never run).
43
44size_t Job::potRegistryForceCalls() const noexcept {
45 if (const auto *registry =
46 dynamic_cast<const PotRegistry *>(&pot->registry())) {
47 return registry->total_force_calls();
48 }
49 return pot->forceCallCounter;
50}
51} // namespace eonc
52
53#ifdef WITH_GP_SURROGATE
54#include "eon/GPSurrogateJob.h"
55#endif
56
57namespace {
58
59#define EON_REG_JOB(TYPE, CLS) \
60 const bool eon_reg_##CLS = [] { \
61 eonc::registerJob( \
62 eonc::JobType::TYPE, \
63 [](std::unique_ptr<eonc::Parameters> p, eonc::Runtime &rt) { \
64 return std::make_unique<eonc::CLS>(std::move(p), rt); \
65 }); \
66 return true; \
67 }()
68
69EON_REG_JOB(Process_Search, ProcessSearchJob);
70EON_REG_JOB(Saddle_Search, SaddleSearchJob);
71EON_REG_JOB(Minimization, MinimizationJob);
72EON_REG_JOB(Point, PointJob);
73EON_REG_JOB(Parallel_Replica, ParallelReplicaJob);
74EON_REG_JOB(Safe_Hyperdynamics, SafeHyperJob);
75EON_REG_JOB(TAD, TADJob);
76EON_REG_JOB(Replica_Exchange, ReplicaExchangeJob);
77EON_REG_JOB(Basin_Hopping, BasinHoppingJob);
78EON_REG_JOB(Hessian, HessianJob);
79EON_REG_JOB(Finite_Difference, FiniteDifferenceJob);
80EON_REG_JOB(Nudged_Elastic_Band, NudgedElasticBandJob);
81EON_REG_JOB(Dynamics, DynamicsJob);
82EON_REG_JOB(Prefactor, PrefactorJob);
83EON_REG_JOB(Global_Optimization, GlobalOptimizationJob);
84EON_REG_JOB(Structure_Comparison, StructureComparisonJob);
85EON_REG_JOB(Monte_Carlo, MonteCarloJob);
86#ifdef WITH_GP_SURROGATE
87EON_REG_JOB(GP_Surrogate, GPSurrogateJob);
88#endif
89EON_REG_JOB(OH_TST, OHTSTJob);
90EON_REG_JOB(Instanton, InstantonJob);
91EON_REG_JOB(Test, TestJob);
92
93#undef EON_REG_JOB
94
95} // namespace
#define EON_REG_JOB(TYPE, CLS)
Definition Job.cpp:59
The job class is used to serve as an abstract class for all jobs, as well as to call a job at runtime...
Finds possible escape mecahnisms from a state.
Finds transition states by finding saddle points on the potential energy surface.
size_t potRegistryForceCalls() const noexcept
Force calls charged to pot's registry.
Definition Job.cpp:44
std::shared_ptr< Potential > pot
Set when one Potential is shared across Matters, images, or a caller.
Definition Job.h:66
RAII resource manager for the ARTn C library with global synchronization.
void forceJobRegistration()
Definition Job.cpp:42