21 #ifndef QMCPLUSPLUS_ESTIMATORMANAGERBASE_H 22 #define QMCPLUSPLUS_ESTIMATORMANAGERBASE_H 36 class MCWalkerConfiguration;
38 class CollectablesEstimator;
42 class EstimatorManagerBaseTest;
99 void getData(
int i, std::vector<RealType>& values);
106 int add(std::unique_ptr<EstimatorType> newestimator,
const std::string& aname);
140 void start(
int blocks,
bool record =
true);
148 void stop(
const std::vector<EstimatorManagerBase*>
m);
164 void stopBlock(
const std::vector<EstimatorManagerBase*>&
m);
184 void write(CT& anything,
bool doappend)
186 anything.write(
h_file, doappend);
211 #if defined(DEBUG_ESTIMATOR_ARCHIVE) 213 std::unique_ptr<std::ofstream> DebugArchive;
bool is_manager() const
return true if the rank == 0
int add(std::unique_ptr< EstimatorType > newestimator, const std::string &aname)
add an Estimator
auto & get_AverageCache()
ScalarEstimatorBase * MainEstimator
pointer to the primary ScalarEstimatorBase
QMCTraits::FullPrecRealType FullPrecRealType
EstimatorType * getEstimator(const std::string &a)
return a pointer to the estimator aname
A set of walkers that are to be advanced by Metropolis Monte Carlo.
helper functions for EinsplineSetBuilder
void accumulate(MCWalkerConfiguration &W)
accumulate the measurements
int rank() const
return the rank
RealType BlockWeight
total weight accumulated in a block
int weightInd
index for the block weight PropertyCache(weightInd)
Testing class breaking EstimatorManagerBase encapsultation.
int acceptInd
index for the acceptance rate PropertyCache(acceptInd)
RealType getProperty(int i) const
RecordNamedProperty< RealType > BlockProperties
manager of property data
ScalarEstimatorBase::accumulator_type energyAccumulator
accumulator for the energy
QMCTraits::FullPrecRealType RealType
Collection of Local Energy Operators.
void getData(int i, std::vector< RealType > &values)
Vector< RealType > AverageCache
cached block averages of the values
Communicate * getCommunicator()
return the communicator
int max_output_scalar_dat_
number of maximum data for a scalar.dat
std::vector< std::unique_ptr< T > > UPtrVector
int RecordCount
number of records in a block
ScalarEstimatorBase::accumulator_type varAccumulator
accumulator for the variance
std::unique_ptr< std::ofstream > Archive
file handler to write data
void stop()
stop a qmc run
int size() const
return the number of ScalarEstimators
void addHeader(std::ostream &o)
add header to an std::ostream
void write(CT &anything, bool doappend)
Wrapping information on parallelism.
void resetTargetParticleSet(ParticleSet &p)
void startBlock(int steps)
start a block
Specialized paritlce class for atomistic simulations.
std::map< std::string, int > EstimatorMap
column map
WalkerList_t::iterator iterator
FIX: a type alias of iterator for an object should not be for just one of many objects it holds...
ScalarEstimatorBase EstimatorType
virtual ~EstimatorManagerBase()
destructor
void setCollectionMode(bool collect)
set CollectSum
int add(const std::string &aname)
int BufferSize
size of the message buffer
auto & get_SquaredAverageCache()
int cpuInd
index for the block cpu PropertyCache(cpuInd)
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
RecordNamedProperty< RealType > TotalAverages
block averages: name to value
bool put(QMCHamiltonian &H, xmlNodePtr cur)
process xml tag associated with estimators
std::string main_estimator_name_
name of the primary estimator name
Class to manage a set of ScalarEstimators.
void setCommunicator(Communicate *c)
set the communicator
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
void collectBlockAverages()
collect data and write
Matrix< RealType > TotalAveragesData
data accumulated over the blocks
Declaraton of Vector<T,Alloc> Manage memory through Alloc directly and allow referencing an existing ...
EstimatorType * getMainEstimator()
return a pointer to the estimator
EstimatorManagerBase(Communicate *c=0)
default constructor
std::vector< ObservableHelper > h5desc
convenient descriptors for hdf5
Communicate * myComm
communicator to handle communication
std::vector< RealType > BufferType
std::vector< std::unique_ptr< BufferType > > RemoteData
void stopBlock(RealType accept, bool collectall=true)
stop a block
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU
RecordNamedProperty< RealType > BlockAverages
manager of scalar data
void reset()
reset the estimator
int addProperty(const char *aname)
add a property with a name
std::vector< int > Block2Total
index mapping between BlockAverages and TotalAverages
size_t max_block_avg_name_
largest name in BlockAverages adding 2 characters
QTFull::RealType FullPrecRealType
Abstract class for an estimator of a scalar operator.
int addObservable(const char *aname)
hdf_archive h_file
hdf5 handler
void start(int blocks, bool record=true)
start a run
Vector< RealType > SquaredAverageCache
cached block averages of the squared values
RealType getObservable(int i) const
void getApproximateEnergyVariance(RealType &e, RealType &var)
get the average of per-block energy and variance of all the blocks Note: this is not weighted average...
A container class to represent a walker.
Define a serialized buffer to store anonymous data.
int add(std::unique_ptr< EstimatorType > newestimator)
add a main estimator
void setProperty(int i, RealType v)
set the value of the i-th column with a value v