Loading...
Searching...
No Matches
ProcessSearchJob.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*/
13#include "eon/PotCapabilities.h"
14#ifdef WITH_ARTN
16#endif
20#include "eon/EpiCenters.h"
21#include "eon/HelperFunctions.h"
23#include "eon/Optimizer.h"
24#include "eon/Prefactor.h"
25#include "eon/PrfoRefine.h"
26#include <exception>
27#include <filesystem>
28#include <thread>
29
30#include <fstream>
31#include <memory>
32#include <stdexcept>
33#include <string>
34
35#include "eon/ConFileIO.h"
36#include "eon/EonLogger.h"
37#include "eon/JobResult.h"
38
39namespace eonc {
40
41namespace {
42
43// known_saddles.dat: "<count> <free atoms>", then per saddle its energy and
44// one "x y z" line per free atom of pos.con, in order.
45void loadKnownSaddles(const std::string &path, const Matter &reference,
46 MinModeSaddleSearch &search) {
47 std::ifstream in(path);
48 if (!in) {
49 return;
50 }
51 long count = 0, nFree = 0;
52 if (!(in >> count >> nFree) || count < 0 ||
53 nFree != reference.numberOfFreeAtoms()) {
54 throw std::runtime_error(path + ": header does not match pos.con");
55 }
56 std::vector<long> freeIndex;
57 for (long i = 0; i < reference.numberOfAtoms(); ++i) {
58 if (!reference.getFixed(i)) {
59 freeIndex.push_back(i);
60 }
61 }
62 std::vector<AtomMatrix> positions;
63 std::vector<double> energies;
64 positions.reserve(static_cast<size_t>(count));
65 energies.reserve(static_cast<size_t>(count));
66 for (long k = 0; k < count; ++k) {
67 double energy = 0.0;
68 AtomMatrix pos = reference.getPositions();
69 bool ok = static_cast<bool>(in >> energy);
70 for (long j = 0; ok && j < nFree; ++j) {
71 const long i = freeIndex[static_cast<size_t>(j)];
72 ok = static_cast<bool>(in >> pos(i, 0) >> pos(i, 1) >> pos(i, 2));
73 }
74 if (!ok) {
75 throw std::runtime_error(path + ": truncated saddle record");
76 }
77 energies.push_back(energy);
78 positions.push_back(std::move(pos));
79 }
80 search.setKnownSaddles(std::move(positions), std::move(energies));
81}
82
83} // namespace
84
85std::vector<std::string> ProcessSearchJob::run() {
86 if (params.saddle_search_options().method == "min_mode") {
88 }
89 std::string reactantFilename = eonc::helpers::getRelevantFile("pos.con");
90 std::string displacementFilename("displacement.con");
91 std::string modeFilename("direction.dat");
92 size_t fctmp{0};
93 initial = std::make_shared<Matter>(pot, params);
94 if (params.saddle_search_options().method == "min_mode" ||
95 params.saddle_search_options().method == "basin_hopping" ||
96 params.saddle_search_options().method == "bgsd") {
97 displacement = std::make_shared<Matter>(pot, params);
98 } else if (params.saddle_search_options().method == "dynamics") {
99 displacement = nullptr;
100 }
101 saddle = std::make_shared<Matter>(pot, params);
102 // Give min2 its own potential for parallel endpoint minimization.
103 std::shared_ptr<Potential> min2Pot = pot;
104 if (pot->needsPerImageInstance() && params.main_options().parallel) {
106 }
107 min1 = std::make_shared<Matter>(pot, params);
108 min2 = std::make_shared<Matter>(min2Pot, params);
109
110 if (!eonc::io::io_ok(initial->con2matter(reactantFilename))) {
111 EONC_LOG_CRITICAL("Failed to load {}", reactantFilename);
112 throw std::runtime_error("failed to load " + reactantFilename);
113 }
114
115 if (params.process_search_options().minimize_first) {
116 QUILL_LOG_DEBUG(log, "Minimizing initial structure\n");
117 fctmp = initial->getPotentialCalls();
118 initial->relax();
119 fCallsMin += initial->getPotentialCalls() - fctmp;
120 QUILL_LOG_DEBUG(log, "Initial minimization took {} fcalls",
121 initial->getPotentialCalls() - fctmp);
122 }
123
124 barriersValues[0] = barriersValues[1] = 0;
126
127 AtomMatrix mode = AtomMatrix::Zero(initial->numberOfAtoms(), 3);
128 if (params.saddle_search_options().method == "min_mode" ||
129 params.saddle_search_options().method == "basin_hopping" ||
130 params.saddle_search_options().method == "bgsd") {
131 if (params.saddle_search_options().displace_type ==
133 // Load displacement.con, or synthesize from pos.con + direction.dat
134 // (#79).
136 *saddle, *initial, displacementFilename, modeFilename,
137 params.saddle_search_options().displace_magnitude)) {
138 EONC_LOG_CRITICAL("Failed to load {} (and no usable {})",
139 displacementFilename, modeFilename);
140 throw std::runtime_error("failed to load " + displacementFilename);
141 }
142 *min1 = *min2 = *initial;
144 &mode)) {
145 *min1 = *min2 = *initial;
146 } else {
147 *saddle = *min1 = *min2 = *initial;
148 }
149 if (displacement) {
151 }
152 } else {
153 // ARTn and dynamics start from the initial minimum
154 *saddle = *min1 = *min2 = *initial;
155 }
156 min2->setPotential(min2Pot);
157
158 const bool useARTnAsMinMode =
159 params.saddle_search_options().method == "min_mode" &&
160 params.saddle_search_options().minmode_method == "artn";
161
162 if (params.saddle_search_options().method == "min_mode") {
163 if (params.saddle_search_options().displace_type ==
165 std::filesystem::exists(modeFilename)) {
166 mode = eonc::helpers::loadMode(modeFilename, initial->numberOfAtoms());
167 }
168#ifdef WITH_ARTN
169 // ARTn as a min-mode drop-in: eOn displaces, seeds the mode, ARTn
170 // takes over from the displaced structure.
171 if (useARTnAsMinMode) {
173 std::make_unique<ARTnSaddleSearch>(saddle, pot, mode, params);
174 } else
175#endif
176 {
177 auto minMode = std::make_unique<MinModeSaddleSearch>(
178 saddle, mode, initial->getPotentialEnergy(), params, pot);
179 if (params.process_search_options().known_saddles) {
180 loadKnownSaddles("known_saddles.dat", *initial, *minMode);
181 }
182 saddleSearch = std::move(minMode);
183 }
184#ifdef WITH_ARTN
185 } else if (params.saddle_search_options().method == "artn") {
186 // ARTn handles its own push from the minimum, eigenmode estimation,
187 // and perpendicular relaxation internally.
188 AtomMatrix artnMode = AtomMatrix::Zero(initial->numberOfAtoms(), 3);
189 if (params.saddle_search_options().displace_type ==
191 std::filesystem::exists(modeFilename)) {
192 artnMode =
193 eonc::helpers::loadMode(modeFilename, initial->numberOfAtoms());
194 }
196 std::make_unique<ARTnSaddleSearch>(saddle, pot, artnMode, params);
197#endif
198 } else if (params.saddle_search_options().method == "basin_hopping") {
200 std::make_unique<BasinHoppingSaddleSearch>(min1, saddle, pot, params);
201 } else if (params.saddle_search_options().method == "dynamics") {
202 saddleSearch = std::make_unique<DynamicsSaddleSearch>(saddle, params);
203 } else if (params.saddle_search_options().method == "bgsd") {
204 saddleSearch = std::make_unique<BiasedGradientSquaredDescent>(
205 saddle, initial->getPotentialEnergy(), params);
206 }
207
208#ifndef WITH_ARTN
209 // Post-dispatch guard for both ARTn entry points so users without a
210 // WITH_ARTN build get a clean per-case error instead of a silent
211 // fall-through. Two distinct messages so downstream tooling and the
212 // integration tests can match on the specific entry point.
213 if (params.saddle_search_options().method == "artn") {
214 throw std::runtime_error(
215 "saddle_search.method=artn requires a build with ARTn support "
216 "(reconfigure with -Dwith_artn=true)");
217 }
218 if (useARTnAsMinMode) {
219 throw std::runtime_error(
220 "saddle_search.minmode_method=artn requires a build with ARTn "
221 "support (reconfigure with -Dwith_artn=true)");
222 }
223#endif
224
225 if (!saddleSearch) {
226 throw std::runtime_error("unknown saddle_search.method");
227 }
228
229 static_cast<void>(runPrepared());
230 return returnFiles;
231}
232
233std::shared_ptr<Matter>
234ProcessSearchJob::runFromMatter(std::shared_ptr<Matter> seed) {
235 if (!seed) {
236 throw std::runtime_error("ProcessSearchJob::runFromMatter: null Matter");
237 }
238 initial = seed;
239 initial->setPotential(pot);
240 std::shared_ptr<Potential> min2Pot = pot;
241 if (pot->needsPerImageInstance() && params.main_options().parallel) {
243 }
244 displacement = std::make_shared<Matter>(pot, params);
245 saddle = std::make_shared<Matter>(pot, params);
246 min1 = std::make_shared<Matter>(pot, params);
247 min2 = std::make_shared<Matter>(min2Pot, params);
248 AtomMatrix mode = AtomMatrix::Zero(initial->numberOfAtoms(), 3);
250 &mode)) {
251 *saddle = *initial;
252 }
254 *min1 = *min2 = *initial;
255 min2->setPotential(min2Pot);
256 if (params.saddle_search_options().method == "min_mode") {
257 saddleSearch = std::make_unique<MinModeSaddleSearch>(
258 saddle, mode, initial->getPotentialEnergy(), params, pot);
259 } else if (params.saddle_search_options().method == "basin_hopping") {
261 std::make_unique<BasinHoppingSaddleSearch>(min1, saddle, pot, params);
262 } else if (params.saddle_search_options().method == "dynamics") {
263 saddleSearch = std::make_unique<DynamicsSaddleSearch>(saddle, params);
264 } else if (params.saddle_search_options().method == "bgsd") {
265 saddleSearch = std::make_unique<BiasedGradientSquaredDescent>(
266 saddle, initial->getPotentialEnergy(), params);
267 } else {
268 throw std::runtime_error(
269 "ProcessSearchJob::runFromMatter: unsupported saddle_search.method");
270 }
271 return runPrepared();
272}
273
274std::shared_ptr<Matter> ProcessSearchJob::runPrepared() {
275 if (!saddleSearch) {
276 throw std::runtime_error("unknown saddle_search.method");
277 }
278
279 int status = doProcessSearch();
280
281 printEndState(status);
282 saveData(status);
283
284 return min2 ? min2 : saddle;
285}
286
288 Matter matterTemp(pot, params);
289 long status;
290 size_t fctmp{0};
291
292 fctmp = potRegistryForceCalls();
293 status = saddleSearch->run();
294 if (params.saddle_search_options().method == "min_mode" &&
295 params.saddle_search_options().minmode_method ==
297 fCallsSaddle += saddleSearch->getForceCalls();
298 } else if (params.saddle_search_options().method == "artn") {
299 fCallsSaddle += saddleSearch->getForceCalls();
300 } else {
302 }
303 EONC_LOG_DEBUG("Got {} calls in the saddle search, with previous {}",
304 fCallsSaddle, fctmp);
305
306 if (status != MinModeSaddleSearch::STATUS_GOOD) {
307 return status;
308 }
309
310 AtomMatrix posSaddle = saddle->getPositions();
311 AtomMatrix displacedPos;
312
313 // Matter's copy assignment copies the potential; keep each endpoint's
314 // own instance so the two minimizations can run at the same time.
315 const auto min1Pot = min1->getPotential();
316 const auto min2Pot = min2->getPotential();
317 *min1 = *saddle;
318 min1->setPotential(min1Pot);
319
320 displacedPos =
321 posSaddle - saddleSearch->getEigenvector() *
322 params.process_search_options().minimization_offset;
323 min1->setPositions(displacedPos);
324
325 *min2 = *saddle;
326 min2->setPotential(min2Pot);
327 displacedPos =
328 posSaddle + saddleSearch->getEigenvector() *
329 params.process_search_options().minimization_offset;
330 min2->setPositions(displacedPos);
331
332 // Minimize both endpoints concurrently when the shared potential instance is
333 // safe to call from multiple threads, or when each endpoint owns a separate
334 // potential instance.
335 QUILL_LOG_DEBUG(log, "Starting Minimization 1 & 2");
336 bool converged1{false}, converged2{false};
337 long fc1_before = min1->getPotentialCalls();
338 long fc2_before = min2->getPotentialCalls();
339
340 // Two threads may share an instance only when it is thread safe; a
341 // per-image potential needs the endpoints to hold distinct instances.
342 bool canParallel = eonc::potAllowsSharedInstance(*pot) ||
343 (pot->needsPerImageInstance() &&
344 min1->getPotential().get() != min2->getPotential().get());
345 if (params.main_options().parallel && canParallel) {
346 // An exception may not leave a thread function (std::terminate), and a
347 // joinable std::thread may not be destroyed: t1 hands its error back and
348 // the caller joins before rethrowing either side's.
349 std::exception_ptr t1Error;
350 std::thread t1([&] {
351 try {
352 converged1 = min1->relax(false, params.debug_options().write_movies,
353 false, "min1");
354 } catch (...) {
355 t1Error = std::current_exception();
356 }
357 });
358 try {
359 converged2 = min2->relax(false, params.debug_options().write_movies,
360 false, "min2");
361 } catch (...) {
362 t1.join();
363 throw;
364 }
365 t1.join();
366 if (t1Error)
367 std::rethrow_exception(t1Error);
368 } else {
369 converged1 =
370 min1->relax(false, params.debug_options().write_movies, false, "min1");
371 converged2 =
372 min2->relax(false, params.debug_options().write_movies, false, "min2");
373 }
374
375 if (min1->getPotential().get() == min2->getPotential().get()) {
376 fCallsMin += min1->getPotentialCalls() - fc1_before;
377 } else {
378 fCallsMin += (min1->getPotentialCalls() - fc1_before) +
379 (min2->getPotentialCalls() - fc2_before);
380 }
381 QUILL_LOG_DEBUG(log, "Min1: {} fcalls, Min2: {} fcalls",
382 min1->getPotentialCalls() - fc1_before,
383 min2->getPotentialCalls() - fc2_before);
384
385 if (!converged1 || !converged2) {
387 }
388
389 auto sameAs = [](const Matter &a, const Matter &b) {
390 Matter probe(a);
391 return probe.compare(b);
392 };
393
394 if (!sameAs(*initial, *min1) && sameAs(*initial, *min2)) {
395 matterTemp = *min1;
396 *min1 = *min2;
397 *min2 = matterTemp;
398 }
399
400 if (!sameAs(*initial, *min1)) {
401 // Report how far off the endpoint landed. Whether the minimisation
402 // stopped just outside the state-identity tolerance or relaxed into a
403 // different state entirely calls for opposite fixes, and the status
404 // alone does not distinguish them.
405 const double tol =
406 params.structure_comparison_options().distance_difference;
407 auto countMoved = [&](const Matter &m) {
408 long moved = 0;
409 for (long i = 0; i < initial->numberOfAtoms(); ++i) {
410 if (initial
411 ->pbc(initial->getPositions().row(i) - m.getPositions().row(i))
412 .norm() > tol) {
413 ++moved;
414 }
415 }
416 return moved;
417 };
418 QUILL_LOG_INFO(log,
419 "initial != min1: {} of {} atoms past the {} A tolerance "
420 "for min1 ({} for min2); largest separation {} A",
421 countMoved(*min1), initial->numberOfAtoms(), tol,
422 countMoved(*min2), initial->perAtomNorm(*min1));
424 }
425
426 if (sameAs(*initial, *min2)) {
427 QUILL_LOG_DEBUG(log, "both minima are the initial state");
429 }
430
431 if (!params.process_search_options().minimize_first) {
432 min1 = initial;
433 }
434
435 barriersValues[0] = saddle->getPotentialEnergy() - min1->getPotentialEnergy();
436 barriersValues[1] = saddle->getPotentialEnergy() - min2->getPotentialEnergy();
437
438 if ((params.saddle_search_options().max_energy < barriersValues[0]) ||
439 (params.saddle_search_options().max_energy < barriersValues[1])) {
441 }
442
443 if (barriersValues[0] < 0.0 || barriersValues[1] < 0.0) {
445 }
446
447 if (!params.prefactor_options().default_value) {
448 // With [Main] parallel the min2 Hessian runs on min2's own instance,
449 // so only the registry sees every prefactor call.
450 fctmp = potRegistryForceCalls();
451 int prefStatus;
452 double pref1, pref2;
454 params, min1.get(), saddle.get(), min2.get(), pref1, pref2);
456 if (prefStatus == -1) {
457 EONC_LOG_ERROR("Prefactor: bad calculation");
459 }
460
461 if ((pref1 > params.prefactor_options().max_value) ||
462 (pref1 < params.prefactor_options().min_value)) {
463 EONC_LOG_ERROR("Bad reactant-to-saddle prefactor: {}", pref1);
465 }
466 if ((pref2 > params.prefactor_options().max_value) ||
467 (pref2 < params.prefactor_options().min_value)) {
468 EONC_LOG_ERROR("Bad product-to-saddle prefactor: {}", pref2);
470 }
471 prefactorsValues[0] = pref1;
472 prefactorsValues[1] = pref2;
473
474 } else {
475 prefactorsValues[0] = params.prefactor_options().default_value;
476 prefactorsValues[1] = params.prefactor_options().default_value;
477 }
479}
480
482 std::string resultsFilename("results.dat");
483 returnFiles.push_back(resultsFilename);
484
485 const bool dynamics = params.saddle_search_options().method == "dynamics";
486 double simTime = 0.0;
487 double mdTemp = 0.0;
488 if (dynamics) {
489 auto ds = dynamic_cast<DynamicsSaddleSearch &>(*saddleSearch);
490 simTime = ds.time * params.constants().timeUnit;
491 mdTemp = params.saddle_search_options().dynamics.temperature;
492 }
493 const double disp = params.saddle_search_options().method == "min_mode"
494 ? displacement->perAtomNorm(*saddle)
495 : 0.0;
497 status, std::string(saddleSearch->describeStatus(status)),
498 params.potential_options().potential, params.main_options().randomSeed,
499 fCallsMin, fCallsSaddle, fCallsPrefactors, saddle->getPotentialEnergy(),
500 min1->getPotentialEnergy(), min2->getPotentialEnergy(), barriersValues[0],
502 dynamics, simTime, mdTemp);
503 env.provenance = provenanceForJob(params);
504 env.reactant_frame = eonc::io::matterToConFrame(*min1);
505 env.saddle_frame = eonc::io::matterToConFrame(*saddle);
506 env.product_frame = eonc::io::matterToConFrame(*min2);
507 env.writeResultsDat(resultsFilename);
508
509 std::string reactantFilename("reactant.con");
510 returnFiles.push_back(reactantFilename);
511 if (!eonc::io::io_ok(min1->matter2con(reactantFilename))) {
512 QUILL_LOG_ERROR(log, "Failed to write {}", reactantFilename);
513 }
514
515 std::string modeFilename("mode.dat");
516 returnFiles.push_back(modeFilename);
517 eonc::helpers::saveMode(modeFilename, saddle, saddleSearch->getEigenvector());
518
519 std::string saddleFilename("saddle.con");
520 returnFiles.push_back(saddleFilename);
521 if (!eonc::io::io_ok(saddle->matter2con(saddleFilename))) {
522 QUILL_LOG_ERROR(log, "Failed to write {}", saddleFilename);
523 }
524
525 std::string productFilename("product.con");
526 returnFiles.push_back(productFilename);
527 if (!eonc::io::io_ok(min2->matter2con(productFilename))) {
528 QUILL_LOG_ERROR(log, "Failed to write {}", productFilename);
529 }
530}
531
533 auto msg = saddleSearch->describeStatus(status);
534 if (status == MinModeSaddleSearch::STATUS_GOOD) {
535 QUILL_LOG_DEBUG(log, "[Saddle Search] {}", msg);
536 } else {
537 QUILL_LOG_ERROR(log, "[Saddle Search] {}", msg);
538 }
539}
540
541} // namespace eonc
Eigen::Matrix< double, Eigen::Dynamic, 3, eOnStorageOrder > AtomMatrix
Definition Eigen.h:37
#define EONC_LOG_DEBUG(...)
Definition EonLogger.h:310
#define EONC_LOG_ERROR(...)
Definition EonLogger.h:328
#define EONC_LOG_CRITICAL(...)
Definition EonLogger.h:334
The optimizer class is used to serve as an abstract class for all optimizers, as well as to call an o...
Finds possible escape mecahnisms from a state.
const AtomMatrix & getPositions() const
Definition Matter.cpp:378
long int numberOfAtoms() const
Definition Matter.cpp:343
long int numberOfFreeAtoms() const
Definition Matter.cpp:653
int getFixed(long int atom) const
1 if every Cartesian axis of the atom is fixed, else 0.
Definition Matter.cpp:575
void setKnownSaddles(std::vector< AtomMatrix > positions, std::vector< double > energies)
Saddles the server already holds for this state (positions, energies).
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
Parameters params
Definition Job.h:58
static const char MINMODE_GPRDIMER[]
bool compare(const Matter &matter, bool indistinguishable=false)
Definition Matter.cpp:254
std::shared_ptr< Matter > displacement
Configuration used during the saddle point search.
size_t fCallsPrefactors
Force calls to find the prefactors.
eonc::log::Scoped log
size_t fCallsMin
Force calls to minimize.
std::shared_ptr< Matter > min1
First minimum from the saddle.
std::vector< std::string > returnFiles
Container for the results of the run.
void printEndState(int status)
Logs the run status and makes sure the run was successful.
std::shared_ptr< Matter > min2
Second minimum from the saddle.
std::shared_ptr< Matter > saddle
Configuration used during the saddle point search.
std::vector< std::string > run(void) override
Kicks off the Process Search.
std::shared_ptr< Matter > initial
Initial configuration.
std::unique_ptr< SaddleSearchMethod > saddleSearch
Pulled from parameters.
size_t fCallsSaddle
Force calls to find the saddle.
void saveData(int status)
Writes the results from the run to file.
std::shared_ptr< Matter > runFromMatter(std::shared_ptr< Matter > seed)
In-process entry: seed reactant Matter, no pos.con.
std::shared_ptr< Matter > runPrepared()
int doProcessSearch(void)
Runs the correct saddle search; also checks if the run was successful.
const char DISP_LOAD[]
Definition EpiCenters.h:20
int getPrefactors(const Parameters &parameters, Matter *min1, Matter *saddle, Matter *min2, double &pref1, double &pref2)
Definition Prefactor.cpp:24
bool applyClientDisplacement(Matter &target, const Matter &initial, const Parameters &params, AtomMatrix *modeOut)
std::string getRelevantFile(std::string filename)
std::shared_ptr< Potential > makeImagePotential(const Potential &pot, const Parameters &params)
A separate instance of pot for one image of a band, dimer or pair of minimizations: a clone when the ...
bool loadOrSynthesizeDisplacement(Matter &target, const Matter &initial, const std::string &displacementPath, const std::string &modePath, double scale)
AtomMatrix loadMode(FILE *modeFile, int nAtoms)
void saveMode(FILE *modeFile, std::shared_ptr< Matter > matter, AtomMatrix mode)
Write a mode; constrained axes are emitted as 0.
readcon::ConFrame matterToConFrame(Matter &m, const ConFrameMetadata *metadata)
Build a single stamped ConFrame from Matter (same builder as matter2con).
constexpr bool io_ok(IoStatus s) noexcept
Definition ConFileIO.h:38
RAII resource manager for the ARTn C library with global synchronization.
bool potAllowsSharedInstance(const P &p) noexcept
JobResultProvenance provenanceForJob(const Parameters &params)
Optimizer backend, engine identity, rgpot pin, and xts ABI from a job.
void requirePrfoRefine(const Parameters &params)
Does nothing unless [Saddle Search] prfo_refine is on.
static JobResultEnvelope fromProcessSearch(int status, std::string statusText, PotType pot, std::int64_t seed, std::uint64_t fMin, std::uint64_t fSaddle, std::uint64_t fPref, double eSaddle, double eReactant, double eProduct, double barrierFwd, double barrierRev, double displacement, double prefFwd, double prefRev, bool dynamics, double simTime, double mdTemp)
Definition JobResult.h:265