QMCPACK
HDFWalkerInput_0_4.h
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 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
9 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
10 //
11 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
12 //////////////////////////////////////////////////////////////////////////////////////
13 
14 
15 #ifndef QMCPLUSPLUS_WALKER_INPUT_V0_4_H
16 #define QMCPLUSPLUS_WALKER_INPUT_V0_4_H
17 
18 #include "hdf/HDFVersion.h"
19 #include "OhmmsData/AttributeSet.h"
20 #include "WalkerConfigurations.h"
21 #include <filesystem>
22 #include <stack>
23 
24 class Communicate;
25 
26 namespace qmcplusplus
27 {
29 {
30  struct IOInfo
31  {
32  bool parallel;
33  bool collected;
34  int rank;
35  int nprocs;
36  hid_t h_plist;
38  inline IOInfo() { reset(); }
39  inline void reset()
40  {
41  parallel = false;
42  collected = false;
43  rank = 0;
44  nprocs = 1;
45  }
46  };
47 
48  /// reference to the list of walker configurations to be read from file
50  /// number of particles
51  const size_t num_ptcls_;
52  //pointer to the communicator
54  //current version this class supports
56  //information of the input files
58  //propoery list to handle parallel io
59  hid_t h_plist;
60  //the last file which was processed, extension removed
61  std::filesystem::path FileName_noext;
62  //list of files to process, extensions removed
63  std::stack<std::filesystem::path> FileStack;
64 
65  /** constructor
66  * @param wc_list target walker configurations
67  * @param num_ptcls the number of particles in each walker
68  * @param c communicator
69  * @param v version
70  */
71  HDFWalkerInput_0_4(WalkerConfigurations& wc_list, size_t num_ptcls, Communicate* c, const HDFVersion& v);
73 
74  /** read walkers
75  * @param W walker set to which new walkers will be added
76  * @param rollback number of blocks to read
77  * @return true if successful
78  */
79  bool put(xmlNodePtr cur);
80 
81  /** check options from xml */
82  void checkOptions(xmlNodePtr cur);
83 
84  /** read walkers for small number of MPI tasks */
85  bool read_hdf5(const std::filesystem::path& h5name);
86  /** read walkers. Master reads and scatter the walkers */
87  bool read_hdf5_scatter(const std::filesystem::path& h5name);
88  /** read walkers using PHDF5 */
89  bool read_phdf5(const std::filesystem::path& h5name);
90 };
91 
92 } // namespace qmcplusplus
93 #endif
void checkOptions(xmlNodePtr cur)
check options from xml
bool put(xmlNodePtr cur)
read walkers
bool read_hdf5_scatter(const std::filesystem::path &h5name)
read walkers.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Declaration of a WalkerConfigurations.
std::filesystem::path FileName_noext
std::stack< std::filesystem::path > FileStack
A set of light weight walkers that are carried between driver sections and restart.
WalkerConfigurations & wc_list_
reference to the list of walker configurations to be read from file
Wrapping information on parallelism.
Definition: Communicate.h:68
const size_t num_ptcls_
number of particles
HDFWalkerInput_0_4(WalkerConfigurations &wc_list, size_t num_ptcls, Communicate *c, const HDFVersion &v)
constructor
bool read_hdf5(const std::filesystem::path &h5name)
read walkers for small number of MPI tasks
bool read_phdf5(const std::filesystem::path &h5name)
read walkers using PHDF5