QMCPACK
HDFWalkerOutput.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 // Cynthia Gu, zg1@ornl.gov, Oak Ridge National Laboratory
9 // Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
10 // Mark A. Berrill, berrillma@ornl.gov, Oak Ridge National Laboratory
11 //
12 // File created by: Jeongnim Kim, jeongnim.kim@gmail.com, University of Illinois at Urbana-Champaign
13 //////////////////////////////////////////////////////////////////////////////////////
14 
15 
16 #ifndef QMCPLUSPLUS_WALKER_OUTPUT_H
17 #define QMCPLUSPLUS_WALKER_OUTPUT_H
18 
20 #include <utility>
21 #include "hdf/hdf_archive.h"
22 
23 namespace qmcplusplus
24 {
25 /** Writes a set of walker configurations to an HDF5 file. */
27 {
28  ///if true, keep it in memory
30  ///number of blocks for append
32  /** number of walkers when a state is dumped
33  *
34  * When the number of walkers per state has changed, NumOfWalkers is used
35  * to reallocate the hdf5 group.
36  */
38  /** number of particles */
39  const size_t number_of_particles_;
40  ///communicator
43  ///rootname
44  std::string RootName;
45  std::string prevFile;
46 public:
47  ///constructor
48  HDFWalkerOutput(size_t num_ptcls, const std::string& fname, Communicate* c);
49  ///destructor
51 
52  /** dump configurations
53  * @param w walkers
54  */
55  bool dump(const WalkerConfigurations& w, int block);
56  // bool dump(ForwardWalkingHistoryObject& FWO);
57 
58 private:
59  ///PooledData<T> is used to define the shape of multi-dimensional array
61  std::vector<Communicate::request> myRequest;
62  std::array<BufferType, 2> RemoteData;
63  std::array<std::vector<QMCTraits::FullPrecRealType>, 2> RemoteDataW;
64  int block;
65  void write_configuration(const WalkerConfigurations& W, hdf_archive& hout, int block);
66 };
67 
68 } // namespace qmcplusplus
69 #endif
std::string RootName
rootname
std::vector< Communicate::request > myRequest
bool dump(const WalkerConfigurations &w, int block)
dump configurations
std::array< BufferType, 2 > RemoteData
bool DoNotAppend
if true, keep it in memory
const size_t number_of_particles_
number of particles
std::array< std::vector< QMCTraits::FullPrecRealType >, 2 > RemoteDataW
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Declaration of a WalkerConfigurations.
Communicate * myComm
communicator
Writes a set of walker configurations to an HDF5 file.
A set of light weight walkers that are carried between driver sections and restart.
class to handle hdf file
Definition: hdf_archive.h:51
Wrapping information on parallelism.
Definition: Communicate.h:68
HDFWalkerOutput(size_t num_ptcls, const std::string &fname, Communicate *c)
constructor
int appended_blocks
number of blocks for append
void write_configuration(const WalkerConfigurations &W, hdf_archive &hout, int block)
size_t number_of_walkers_
number of walkers when a state is dumped