QMCPACK
VMCFactoryNew.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2022 QMCPACK developers.
6 //
7 // File developed by: Peter Doak, doakpw@ornl.gov, Oak Ridge National Laboratory
8 // Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign
9 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
10 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
11 // Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
12 //
13 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
14 //////////////////////////////////////////////////////////////////////////////////////
15 
16 #include "VMCFactoryNew.h"
19 #include "Concurrency/Info.hpp"
20 
21 namespace qmcplusplus
22 {
23 std::unique_ptr<QMCDriverInterface> VMCFactoryNew::create(const ProjectData& project_data,
24  const std::optional<EstimatorManagerInput>& global_emi,
26  MCPopulation&& pop,
27  SampleStack& samples,
29 {
30  app_summary() << "\n========================================"
31  "\n Reading VMC driver XML input section"
32  "\n========================================"
33  << std::endl;
34 
35  QMCDriverInput qmcdriver_input;
36  VMCDriverInput vmcdriver_input;
37  try
38  {
39  qmcdriver_input.readXML(input_node_);
40  vmcdriver_input.readXML(input_node_);
41  }
42  catch (const std::exception& e)
43  {
44  throw UniformCommunicateError(e.what());
45  }
46 
47  std::unique_ptr<QMCDriverInterface> qmc;
48 
49  if (vmc_mode_ == 0 || vmc_mode_ == 1) //(0,0,0) (0,0,1)
50  {
51  qmc = std::make_unique<VMCBatched>(project_data, std::move(qmcdriver_input), global_emi, std::move(vmcdriver_input),
52  wc, std::move(pop), samples, comm);
53  }
54  else
55  {
56  throw std::runtime_error("VMCFactoryNew does not support VMC_MODE");
57  }
58 
59  // TODO: I believe this is redundant and could become a bug.
60  qmc->setUpdateMode(vmc_mode_ & 1);
61  return qmc;
62 }
63 } // namespace qmcplusplus
Abstraction of information on executor environments.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Input representation for VMC driver class runtime parameters.
std::unique_ptr< QMCDriverInterface > create(const ProjectData &project_data, const std::optional< EstimatorManagerInput > &global_emi, WalkerConfigurations &wc, MCPopulation &&pop, SampleStack &samples, Communicate *comm)
create a VMCBatched driver.
class ProjectData
Definition: ProjectData.h:36
std::ostream & app_summary()
Definition: OutputManager.h:63
A set of light weight walkers that are carried between driver sections and restart.
Wrapping information on parallelism.
Definition: Communicate.h:68
void readXML(xmlNodePtr xml_input)
Compilation units that construct QMCDriverInput need visibility to the actual input classes types in ...
This a subclass for runtime errors that will occur on all ranks.
void readXML(xmlNodePtr cur)
Reads qmc section xml node parameters.
Input representation for Driver base class runtime parameters.