QMCPACK
HDFWalkerInputManager.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) 2016 Jeongnim Kim and QMCPACK developers.
6 //
7 // File developed by: Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign
8 // Cynthia Gu, zg1@ornl.gov, Oak Ridge National Laboratory
9 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
10 // Raymond Clay III, j.k.rofling@gmail.com, Lawrence Livermore National Laboratory
11 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
12 //
13 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
14 //////////////////////////////////////////////////////////////////////////////////////
15 
16 
17 #include "HDFWalkerInputManager.h"
18 #include "OhmmsData/AttributeSet.h"
20 #include "Message/Communicate.h"
21 #include "hdf/HDFVersion.h"
22 
23 namespace qmcplusplus
24 {
25 HDFWalkerInputManager::HDFWalkerInputManager(WalkerConfigurations& wc_list, size_t num_ptcls, Communicate* c) : wc_list_(wc_list), num_ptcls_(num_ptcls), myComm(c) {}
26 
28 
29 bool HDFWalkerInputManager::put(xmlNodePtr cur)
30 {
31  //reference revision number
32  HDFVersion start_version(0, 4);
33  //current node
34  int pid = myComm->rank();
35  std::string froot("0"), cfile("0");
36  //string target("e"), collect("no");
37  int anode = -1, nprocs = 1;
38  HDFVersion in_version(0, 4); //set to be old version
39  OhmmsAttributeSet pAttrib;
40  pAttrib.add(cfile, "href");
41  pAttrib.add(cfile, "file");
42  pAttrib.add(froot, "fileroot");
43  pAttrib.add(anode, "node");
44  pAttrib.add(nprocs, "nprocs");
45  //pAttrib.add(collect,"collected");
46  pAttrib.add(in_version, "version");
47  pAttrib.put(cur);
48  bool success = false;
49  if (in_version >= start_version)
50  {
51  HDFWalkerInput_0_4 win(wc_list_, num_ptcls_, myComm, in_version);
52  success = win.put(cur);
53  cfile = win.FileName_noext;
54  }
55  else
56  myComm->barrier_and_abort("Outdated restart file!");
57  if (success)
58  CurrentFileRoot = cfile;
59  return success;
60 }
61 } // namespace qmcplusplus
bool put(xmlNodePtr cur)
read walkers
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
std::filesystem::path FileName_noext
int rank() const
return the rank
Definition: Communicate.h:116
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
A set of light weight walkers that are carried between driver sections and restart.
Wrapping information on parallelism.
Definition: Communicate.h:68
WalkerConfigurations & wc_list_
reference to the list of walker configurations to be read from file
class to handle a set of attributes of an xmlNode
Definition: AttributeSet.h:24
const size_t num_ptcls_
number of particles
HDFWalkerInputManager(WalkerConfigurations &w, size_t num_ptcls, Communicate *c)
void barrier_and_abort(const std::string &msg) const
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
Definition: AttributeSet.h:42