QMCPACK
SampleStack.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) 2020 QMCPACK developers.
6 //
7 // File developed by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Mark Dewing, mdewing@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 /** @file SampleStack.h
13  * @brief Stores particle configurations for later use in DMC and wavefunction optimization
14  *
15  * Stores less temporary data than the buffer object.
16  */
17 
18 #ifndef QMCPLUSPLUS_SAMPLE_STACK_H
19 #define QMCPLUSPLUS_SAMPLE_STACK_H
20 
21 #include <vector>
22 #include "Particle/ParticleSet.h"
23 #include "Particle/MCSample.h"
24 #include "Particle/Walker.h"
26 
27 namespace qmcplusplus
28 {
30 {
31 public:
33 
34  size_t getMaxSamples() const { return max_samples_; }
35 
36  bool empty() const { return sample_vector_.empty(); }
37 
38  const MCSample& getSample(size_t i) const;
39 
40  //@{save/load/clear function for optimization
41  inline size_t getNumSamples() const { return current_sample_count_; }
42  ///set the number of max samples per rank.
43  void setMaxSamples(size_t n, size_t number_of_ranks = 1);
44  /// Global number of samples is number of samples per rank * number of ranks
45  size_t getGlobalNumSamples() const { return global_num_samples_; }
46  /// load a single sample from SampleStack
47  void loadSample(ParticleSet& pset, size_t iw) const;
48 
49  void appendSample(MCSample&& sample);
50 
51  ///clear the ensemble
52  void clearEnsemble();
53  //@}
54  /// Set the sample count to zero but preserve the storage
55  void resetSampleCount();
56 
57 private:
58  size_t max_samples_{10};
61 
62  std::vector<MCSample> sample_vector_;
63 };
64 
65 
66 } // namespace qmcplusplus
67 #endif
Stores particle configurations for later use in DMC and wavefunction optimization.
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
Declaration of a WalkerConfigurations.
size_t getMaxSamples() const
Definition: SampleStack.h:34
void resetSampleCount()
Set the sample count to zero but preserve the storage.
Definition: SampleStack.cpp:57
std::vector< MCSample > sample_vector_
Definition: SampleStack.h:62
size_t getNumSamples() const
Definition: SampleStack.h:41
Vectorized record engine for scalar properties.
void clearEnsemble()
clear the ensemble
Definition: SampleStack.cpp:51
store minimum Walker data
Definition: MCSample.h:28
void loadSample(ParticleSet &pset, size_t iw) const
load a single sample from SampleStack
Definition: SampleStack.cpp:45
Specialized paritlce class for atomistic simulations.
Definition: ParticleSet.h:55
const MCSample & getSample(size_t i) const
Definition: SampleStack.cpp:31
void setMaxSamples(size_t n, size_t number_of_ranks=1)
set the number of max samples per rank.
Definition: SampleStack.cpp:23
void appendSample(MCSample &&sample)
Definition: SampleStack.cpp:33
size_t getGlobalNumSamples() const
Global number of samples is number of samples per rank * number of ranks.
Definition: SampleStack.h:45
RecordNamedProperty< FullPrecRealType > PropertySetType
define PropertyList_t
Definition: Configuration.h:69