QMCPACK
HDFWalkerInputManager Class Reference
+ Collaboration diagram for HDFWalkerInputManager:

Public Member Functions

 HDFWalkerInputManager (WalkerConfigurations &w, size_t num_ptcls, Communicate *c)
 
 ~HDFWalkerInputManager ()
 
bool put (xmlNodePtr cur)
 
std::string getFileRoot ()
 

Private Attributes

WalkerConfigurationswc_list_
 reference to the list of walker configurations to be read from file More...
 
const size_t num_ptcls_
 number of particles More...
 
CommunicatemyComm
 
std::string CurrentFileRoot
 

Detailed Description

Definition at line 24 of file HDFWalkerInputManager.h.

Constructor & Destructor Documentation

◆ HDFWalkerInputManager()

HDFWalkerInputManager ( WalkerConfigurations w,
size_t  num_ptcls,
Communicate c 
)

Definition at line 25 of file HDFWalkerInputManager.cpp.

25 : wc_list_(wc_list), num_ptcls_(num_ptcls), myComm(c) {}
WalkerConfigurations & wc_list_
reference to the list of walker configurations to be read from file
const size_t num_ptcls_
number of particles

◆ ~HDFWalkerInputManager()

Definition at line 27 of file HDFWalkerInputManager.cpp.

27 {}

Member Function Documentation

◆ getFileRoot()

std::string getFileRoot ( )
inline

◆ put()

bool put ( xmlNodePtr  cur)

Definition at line 29 of file HDFWalkerInputManager.cpp.

References OhmmsAttributeSet::add(), Communicate::barrier_and_abort(), HDFWalkerInputManager::CurrentFileRoot, HDFWalkerInput_0_4::FileName_noext, HDFWalkerInputManager::myComm, HDFWalkerInputManager::num_ptcls_, OhmmsAttributeSet::put(), HDFWalkerInput_0_4::put(), Communicate::rank(), and HDFWalkerInputManager::wc_list_.

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 }
int rank() const
return the rank
Definition: Communicate.h:116
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
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
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

Member Data Documentation

◆ CurrentFileRoot

std::string CurrentFileRoot
private

◆ myComm

Communicate* myComm
private

Definition at line 30 of file HDFWalkerInputManager.h.

Referenced by HDFWalkerInputManager::put().

◆ num_ptcls_

const size_t num_ptcls_
private

number of particles

Definition at line 29 of file HDFWalkerInputManager.h.

Referenced by HDFWalkerInputManager::put().

◆ wc_list_

WalkerConfigurations& wc_list_
private

reference to the list of walker configurations to be read from file

Definition at line 27 of file HDFWalkerInputManager.h.

Referenced by HDFWalkerInputManager::put().


The documentation for this class was generated from the following files: