Virtual run; used solely for dynamic dispatch.
28 {
29 std::string posInFilename("pos.con");
30 std::string posOutFilename("out.con");
31
32 if (
params.main_options().checkpoint) {
33 if (std::filesystem::exists("pos_cp.con")) {
34 posInFilename = "pos_cp.con";
35 QUILL_LOG_DEBUG(
log,
"Resuming from checkpoint\n");
36 } else {
37 QUILL_LOG_DEBUG(
log,
"No checkpoint files found\n");
38 }
39 }
40
41 std::vector<std::string> returnFiles;
42
43 auto matter = std::make_shared<Matter>(
pot,
params);
45 QUILL_LOG_CRITICAL(
log,
"Failed to load {}", posInFilename);
46 throw std::runtime_error("failed to load " + posInFilename);
47 }
48
49 MonteCarlo mc = MonteCarlo(matter,
params);
50 mc.run(
params.monte_carlo_options().steps,
params.main_options().temperature,
51 params.monte_carlo_options().step_size);
52
53 QUILL_LOG_DEBUG(
log,
"Saving result to {}", posOutFilename);
55 returnFiles.push_back(posOutFilename);
56 } else {
57 QUILL_LOG_ERROR(
log,
"Failed to write {}", posOutFilename);
58 }
59
60 std::string resultsFilename("results.dat");
64 matter->getPotentialEnergy());
65 env.job_type = "monte_carlo";
66 env.writeResultsDat(resultsFilename);
67 returnFiles.push_back(resultsFilename);
68
69 return returnFiles;
70}
std::shared_ptr< Potential > pot
static PotRegistry & get() noexcept
Process-lifetime singleton.
size_t total_force_calls() const noexcept
constexpr bool io_ok(IoStatus s) noexcept
static JobResultEnvelope fromMinimization(RunStatus status, PotType pot, std::uint64_t fcalls, bool hasE, double energy)