QMCPACK
EstimatorManagerBase Class Reference

Class to manage a set of ScalarEstimators. More...

+ Collaboration diagram for EstimatorManagerBase:

Public Types

using RealType = QMCTraits::FullPrecRealType
 
using FullPrecRealType = QMCTraits::FullPrecRealType
 
using EstimatorType = ScalarEstimatorBase
 
using BufferType = std::vector< RealType >
 
using MCPWalker = Walker< QMCTraits, PtclOnLatticeTraits >
 

Public Member Functions

 EstimatorManagerBase (Communicate *c=0)
 default constructor More...
 
 EstimatorManagerBase (EstimatorManagerBase &em)
 copy constructor More...
 
virtual ~EstimatorManagerBase ()
 destructor More...
 
void setCommunicator (Communicate *c)
 set the communicator More...
 
CommunicategetCommunicator ()
 return the communicator More...
 
bool is_manager () const
 return true if the rank == 0 More...
 
int size () const
 return the number of ScalarEstimators More...
 
int addProperty (const char *aname)
 add a property with a name More...
 
void setProperty (int i, RealType v)
 set the value of the i-th column with a value v More...
 
RealType getProperty (int i) const
 
int addObservable (const char *aname)
 
RealType getObservable (int i) const
 
void getData (int i, std::vector< RealType > &values)
 
int add (std::unique_ptr< EstimatorType > newestimator, const std::string &aname)
 add an Estimator More...
 
int add (std::unique_ptr< EstimatorType > newestimator)
 add a main estimator More...
 
EstimatorTypegetEstimator (const std::string &a)
 return a pointer to the estimator aname More...
 
EstimatorTypegetMainEstimator ()
 return a pointer to the estimator More...
 
void setCollectionMode (bool collect)
 set CollectSum More...
 
bool put (QMCHamiltonian &H, xmlNodePtr cur)
 process xml tag associated with estimators More...
 
void resetTargetParticleSet (ParticleSet &p)
 
void reset ()
 reset the estimator More...
 
void start (int blocks, bool record=true)
 start a run More...
 
void stop ()
 stop a qmc run More...
 
void stop (const std::vector< EstimatorManagerBase *> m)
 stop a qmc run More...
 
void startBlock (int steps)
 start a block More...
 
void stopBlock (RealType accept, bool collectall=true)
 stop a block More...
 
void stopBlock (const std::vector< EstimatorManagerBase *> &m)
 stop a block More...
 
void accumulate (MCWalkerConfiguration &W)
 accumulate the measurements More...
 
void accumulate (MCWalkerConfiguration &W, MCWalkerConfiguration::iterator it, MCWalkerConfiguration::iterator it_end)
 accumulate the measurements for a subset of walkers [it,it_end) More...
 
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. More...
 
template<class CT >
void write (CT &anything, bool doappend)
 
auto & get_AverageCache ()
 
auto & get_SquaredAverageCache ()
 

Protected Attributes

std::bitset< 8 > Options
 
int BufferSize
 size of the message buffer More...
 
int RecordCount
 number of records in a block More...
 
int weightInd
 index for the block weight PropertyCache(weightInd) More...
 
int cpuInd
 index for the block cpu PropertyCache(cpuInd) More...
 
int acceptInd
 index for the acceptance rate PropertyCache(acceptInd) More...
 
hdf_archive h_file
 hdf5 handler More...
 
RealType BlockWeight
 total weight accumulated in a block More...
 
std::unique_ptr< std::ofstream > Archive
 file handler to write data More...
 
CommunicatemyComm
 communicator to handle communication More...
 
ScalarEstimatorBaseMainEstimator
 pointer to the primary ScalarEstimatorBase More...
 
std::unique_ptr< CollectablesEstimatorCollectables
 pointer to the CollectablesEstimator More...
 
ScalarEstimatorBase::accumulator_type energyAccumulator
 accumulator for the energy More...
 
ScalarEstimatorBase::accumulator_type varAccumulator
 accumulator for the variance More...
 
Vector< RealTypeAverageCache
 cached block averages of the values More...
 
Vector< RealTypeSquaredAverageCache
 cached block averages of the squared values More...
 
Vector< RealTypePropertyCache
 cached block averages of properties, e.g. BlockCPU More...
 
RecordNamedProperty< RealTypeBlockAverages
 manager of scalar data More...
 
RecordNamedProperty< RealTypeBlockProperties
 manager of property data More...
 
RecordNamedProperty< RealTypeTotalAverages
 block averages: name to value More...
 
Matrix< RealTypeTotalAveragesData
 data accumulated over the blocks More...
 
std::vector< int > Block2Total
 index mapping between BlockAverages and TotalAverages More...
 
std::map< std::string, int > EstimatorMap
 column map More...
 
UPtrVector< EstimatorTypeEstimators
 estimators of simple scalars More...
 
std::vector< ObservableHelperh5desc
 convenient descriptors for hdf5 More...
 
Timer MyTimer
 Timer. More...
 

Private Member Functions

void collectBlockAverages ()
 collect data and write More...
 
void addHeader (std::ostream &o)
 add header to an std::ostream More...
 

Private Attributes

std::string main_estimator_name_
 name of the primary estimator name More...
 
int max_output_scalar_dat_
 number of maximum data for a scalar.dat More...
 
std::vector< std::unique_ptr< BufferType > > RemoteData
 
size_t max_block_avg_name_
 largest name in BlockAverages adding 2 characters More...
 

Friends

class qmcplusplus::testing::EstimatorManagerBaseTest
 

Detailed Description

Class to manage a set of ScalarEstimators.

Definition at line 47 of file EstimatorManagerBase.h.

Member Typedef Documentation

◆ BufferType

using BufferType = std::vector<RealType>

Definition at line 54 of file EstimatorManagerBase.h.

◆ EstimatorType

Definition at line 53 of file EstimatorManagerBase.h.

◆ FullPrecRealType

◆ MCPWalker

Definition at line 55 of file EstimatorManagerBase.h.

◆ RealType

Definition at line 50 of file EstimatorManagerBase.h.

Constructor & Destructor Documentation

◆ EstimatorManagerBase() [1/2]

default constructor

Definition at line 56 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::setCommunicator().

57  : RecordCount(0),
58  myComm(0),
59  MainEstimator(0),
60  main_estimator_name_("LocalEnergy"),
63 {
64  setCommunicator(c);
65 }
ScalarEstimatorBase * MainEstimator
pointer to the primary ScalarEstimatorBase
int max_output_scalar_dat_
number of maximum data for a scalar.dat
int RecordCount
number of records in a block
std::string main_estimator_name_
name of the primary estimator name
void setCommunicator(Communicate *c)
set the communicator
Communicate * myComm
communicator to handle communication
size_t max_block_avg_name_
largest name in BlockAverages adding 2 characters

◆ EstimatorManagerBase() [2/2]

copy constructor

Definition at line 67 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::Collectables, EstimatorManagerBase::EstimatorMap, EstimatorManagerBase::Estimators, EstimatorManagerBase::main_estimator_name_, EstimatorManagerBase::MainEstimator, EstimatorManagerBase::myComm, and EstimatorManagerBase::setCommunicator().

68  : Options(em.Options),
69  RecordCount(0),
70  myComm(0),
71  MainEstimator(0),
72  EstimatorMap(em.EstimatorMap),
73  main_estimator_name_(em.main_estimator_name_),
74  max_output_scalar_dat_(em.max_output_scalar_dat_),
76 {
77  //inherit communicator
78  setCommunicator(em.myComm);
79 
80  // Here Estimators are ScalarEstimatorBase
81  for (int i = 0; i < em.Estimators.size(); i++)
82  Estimators.emplace_back(em.Estimators[i]->clone());
84  if (em.Collectables)
85  Collectables.reset(em.Collectables->clone());
86 }
ScalarEstimatorBase * MainEstimator
pointer to the primary ScalarEstimatorBase
int max_output_scalar_dat_
number of maximum data for a scalar.dat
int RecordCount
number of records in a block
std::map< std::string, int > EstimatorMap
column map
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::string main_estimator_name_
name of the primary estimator name
void setCommunicator(Communicate *c)
set the communicator
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
Communicate * myComm
communicator to handle communication
size_t max_block_avg_name_
largest name in BlockAverages adding 2 characters

◆ ~EstimatorManagerBase()

~EstimatorManagerBase ( )
virtualdefault

destructor

Member Function Documentation

◆ accumulate() [1/2]

void accumulate ( MCWalkerConfiguration W)

accumulate the measurements

accumulate Local energies and collectables

Parameters
Wwalkers
Wensemble

Definition at line 349 of file EstimatorManagerBase.cpp.

References WalkerConfigurations::begin(), EstimatorManagerBase::BlockWeight, ParticleSet::Collectables, EstimatorManagerBase::Collectables, WalkerConfigurations::end(), EstimatorManagerBase::Estimators, WalkerConfigurations::getActiveWalkers(), WalkerConfigurations::getGlobalNumWalkers(), and norm().

Referenced by RMCUpdateAllWithDrift::accumulate(), RMCUpdatePbyPWithDrift::accumulate(), EstimatorManagerBase::accumulate(), and QMCUpdateBase::accumulate().

350 {
351  BlockWeight += W.getActiveWalkers();
352  RealType norm = 1.0 / W.getGlobalNumWalkers();
353  for (int i = 0; i < Estimators.size(); i++)
354  Estimators[i]->accumulate(W, W.begin(), W.end(), norm);
355  if (Collectables) //collectables are normalized by QMC drivers
356  Collectables->accumulate_all(W.Collectables, 1.0);
357 }
void accumulate(MCWalkerConfiguration &W)
accumulate the measurements
RealType BlockWeight
total weight accumulated in a block
double norm(const zVec &c)
Definition: VectorOps.h:118
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
QMCTraits::RealType RealType

◆ accumulate() [2/2]

accumulate the measurements for a subset of walkers [it,it_end)

Parameters
Wwalkers
itfirst walker
it_endlast walker

Definition at line 359 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::accumulate(), EstimatorManagerBase::BlockWeight, ParticleSet::Collectables, EstimatorManagerBase::Collectables, EstimatorManagerBase::Estimators, WalkerConfigurations::getGlobalNumWalkers(), and norm().

362 {
363  BlockWeight += it_end - it;
364  RealType norm = 1.0 / W.getGlobalNumWalkers();
365  for (int i = 0; i < Estimators.size(); i++)
366  Estimators[i]->accumulate(W, it, it_end, norm);
367  if (Collectables)
368  Collectables->accumulate_all(W.Collectables, 1.0);
369 }
void accumulate(MCWalkerConfiguration &W)
accumulate the measurements
RealType BlockWeight
total weight accumulated in a block
double norm(const zVec &c)
Definition: VectorOps.h:118
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
QMCTraits::RealType RealType

◆ add() [1/2]

int add ( std::unique_ptr< EstimatorType newestimator,
const std::string &  aname 
)

add an Estimator

Parameters
newestimatorNew Estimator
anamename of the estimator
Returns
locator of newestimator

Definition at line 465 of file EstimatorManagerBase.cpp.

References qmcplusplus::app_log(), EstimatorManagerBase::EstimatorMap, EstimatorManagerBase::Estimators, EstimatorManagerBase::main_estimator_name_, EstimatorManagerBase::MainEstimator, and qmcplusplus::n.

Referenced by EstimatorManagerBase::addObservable(), EstimatorManagerBase::getMainEstimator(), EstimatorManagerBase::put(), and qmcplusplus::TEST_CASE().

466 {
467  //check the name and set the MainEstimator
468  if (aname == main_estimator_name_)
469  {
470  MainEstimator = newestimator.get();
471  }
472  auto it = EstimatorMap.find(aname);
473  int n = Estimators.size();
474  if (it == EstimatorMap.end())
475  {
476  Estimators.push_back(std::move(newestimator));
477  EstimatorMap[aname] = n;
478  }
479  else
480  {
481  n = (*it).second;
482  app_log() << " EstimatorManagerBase::add replace " << aname << " estimator." << std::endl;
483  Estimators[n] = std::move(newestimator);
484  }
485  return n;
486 }
ScalarEstimatorBase * MainEstimator
pointer to the primary ScalarEstimatorBase
std::ostream & app_log()
Definition: OutputManager.h:65
std::map< std::string, int > EstimatorMap
column map
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::string main_estimator_name_
name of the primary estimator name

◆ add() [2/2]

int add ( std::unique_ptr< EstimatorType newestimator)
inline

add a main estimator

Parameters
newestimatorNew Estimator
Returns
locator of newestimator

Definition at line 113 of file EstimatorManagerBase.h.

References EstimatorManagerBase::add(), and EstimatorManagerBase::main_estimator_name_.

Referenced by EstimatorManagerBase::add().

113 { return add(std::move(newestimator), main_estimator_name_); }
int add(std::unique_ptr< EstimatorType > newestimator, const std::string &aname)
add an Estimator
std::string main_estimator_name_
name of the primary estimator name

◆ addHeader()

void addHeader ( std::ostream &  o)
private

add header to an std::ostream

Definition at line 141 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::BlockAverages, EstimatorManagerBase::BlockProperties, EstimatorManagerBase::max_block_avg_name_, EstimatorManagerBase::max_output_scalar_dat_, omptarget::min(), RecordNamedProperty< T >::Names, and RecordNamedProperty< T >::size().

Referenced by EstimatorManagerBase::start().

142 {
143  o.setf(std::ios::scientific, std::ios::floatfield);
144  o.setf(std::ios::left, std::ios::adjustfield);
145  o.precision(10);
146  for (int i = 0; i < BlockAverages.size(); i++)
147  max_block_avg_name_ = std::max(max_block_avg_name_, BlockAverages.Names[i].size() + 2);
148  for (int i = 0; i < BlockProperties.size(); i++)
151  o << "# index ";
152  for (int i = 0; i < maxobjs; i++)
153  o << std::setw(max_block_avg_name_) << BlockAverages.Names[i];
154  for (int i = 0; i < BlockProperties.size(); i++)
155  o << std::setw(max_block_avg_name_) << BlockProperties.Names[i];
156  o << std::endl;
157  o.setf(std::ios::right, std::ios::adjustfield);
158 }
RecordNamedProperty< RealType > BlockProperties
manager of property data
int max_output_scalar_dat_
number of maximum data for a scalar.dat
T min(T a, T b)
std::vector< std::string > Names
RecordNamedProperty< RealType > BlockAverages
manager of scalar data
size_t max_block_avg_name_
largest name in BlockAverages adding 2 characters

◆ addObservable()

int addObservable ( const char *  aname)

Definition at line 488 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::add(), RecordNamedProperty< T >::add(), EstimatorManagerBase::Block2Total, EstimatorManagerBase::BlockAverages, and EstimatorManagerBase::TotalAverages.

Referenced by QMCDriver::addObservable().

489 {
490  int mine = BlockAverages.add(aname);
491  int add = TotalAverages.add(aname);
492  if (mine < Block2Total.size())
493  Block2Total[mine] = add;
494  else
495  Block2Total.push_back(add);
496  return mine;
497 }
int add(std::unique_ptr< EstimatorType > newestimator, const std::string &aname)
add an Estimator
int add(const std::string &aname)
RecordNamedProperty< RealType > TotalAverages
block averages: name to value
RecordNamedProperty< RealType > BlockAverages
manager of scalar data
std::vector< int > Block2Total
index mapping between BlockAverages and TotalAverages

◆ addProperty()

int addProperty ( const char *  aname)
inline

add a property with a name

Parameters
anamename of the column
Returns
the property index so that its value can be set by setProperty(i)

Append a named column. BlockProperties do not contain any meaning data but manages the name to index map for PropertyCache.

Definition at line 85 of file EstimatorManagerBase.h.

References RecordNamedProperty< T >::add(), and EstimatorManagerBase::BlockProperties.

85 { return BlockProperties.add(aname); }
RecordNamedProperty< RealType > BlockProperties
manager of property data
int add(const std::string &aname)

◆ collectBlockAverages()

void collectBlockAverages ( )
private

collect data and write

Definition at line 298 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::Archive, EstimatorManagerBase::AverageCache, Vector< T, Alloc >::begin(), EstimatorManagerBase::BlockAverages, qmcplusplus::COLLECT, copy(), Vector< T, Alloc >::data(), Vector< T, Alloc >::end(), EstimatorManagerBase::energyAccumulator, hdf_archive::flush(), EstimatorManagerBase::h5desc, EstimatorManagerBase::h_file, qmcplusplus::MANAGE, EstimatorManagerBase::max_block_avg_name_, EstimatorManagerBase::max_output_scalar_dat_, omptarget::min(), EstimatorManagerBase::myComm, EstimatorManagerBase::Options, EstimatorManagerBase::PropertyCache, EstimatorManagerBase::RecordCount, Communicate::reduce(), EstimatorManagerBase::RemoteData, Communicate::size(), Vector< T, Alloc >::size(), RecordNamedProperty< T >::size(), EstimatorManagerBase::SquaredAverageCache, EstimatorManagerBase::varAccumulator, and EstimatorManagerBase::write().

Referenced by EstimatorManagerBase::stopBlock().

299 {
300  if (Options[COLLECT])
301  {
302  //copy cached data to RemoteData[0]
303  int n1 = AverageCache.size();
304  int n2 = n1 + AverageCache.size();
305  int n3 = n2 + PropertyCache.size();
306  {
307  BufferType::iterator cur(RemoteData[0]->begin());
310  copy(PropertyCache.begin(), PropertyCache.end(), cur + n2);
311  }
312  myComm->reduce(*RemoteData[0]);
313  if (Options[MANAGE])
314  {
315  BufferType::iterator cur(RemoteData[0]->begin());
316  copy(cur, cur + n1, AverageCache.begin());
317  copy(cur + n1, cur + n2, SquaredAverageCache.begin());
318  copy(cur + n2, cur + n3, PropertyCache.begin());
319  RealType nth = 1.0 / static_cast<RealType>(myComm->size());
320  AverageCache *= nth;
321  SquaredAverageCache *= nth;
322  //do not weight weightInd
323  for (int i = 1; i < PropertyCache.size(); i++)
324  PropertyCache[i] *= nth;
325  }
326  }
327  //add the block average to summarize
330  if (Archive)
331  {
332  *Archive << std::setw(10) << RecordCount;
334  for (int j = 0; j < maxobjs; j++)
335  *Archive << std::setw(max_block_avg_name_) << AverageCache[j];
336  for (int j = 0; j < PropertyCache.size(); j++)
337  *Archive << std::setw(max_block_avg_name_) << PropertyCache[j];
338  *Archive << std::endl;
339  for (int o = 0; o < h5desc.size(); ++o)
341  h_file.flush();
342  }
343  RecordCount++;
344 }
void reduce(T &)
ScalarEstimatorBase::accumulator_type energyAccumulator
accumulator for the energy
Vector< RealType > AverageCache
cached block averages of the values
int max_output_scalar_dat_
number of maximum data for a scalar.dat
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
int size() const
return the number of tasks
Definition: Communicate.h:118
T min(T a, T b)
void copy(const Array< T1, 3 > &src, Array< T2, 3 > &dest)
Definition: Blitz.h:639
void write(CT &anything, bool doappend)
size_type size() const
return the current size
Definition: OhmmsVector.h:162
QMCTraits::RealType RealType
std::vector< ObservableHelper > h5desc
convenient descriptors for hdf5
Communicate * myComm
communicator to handle communication
std::vector< std::unique_ptr< BufferType > > RemoteData
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU
RecordNamedProperty< RealType > BlockAverages
manager of scalar data
size_t max_block_avg_name_
largest name in BlockAverages adding 2 characters
Vector< RealType > SquaredAverageCache
cached block averages of the squared values
void flush()
flush a file
Definition: hdf_archive.h:146

◆ get_AverageCache()

auto& get_AverageCache ( )
inline

Definition at line 189 of file EstimatorManagerBase.h.

References EstimatorManagerBase::AverageCache.

Referenced by EstimatorManagerBaseTest::fakeSomeScalarSamples().

189 { return AverageCache; }
Vector< RealType > AverageCache
cached block averages of the values

◆ get_SquaredAverageCache()

auto& get_SquaredAverageCache ( )
inline

Definition at line 190 of file EstimatorManagerBase.h.

References EstimatorManagerBase::SquaredAverageCache.

Referenced by EstimatorManagerBaseTest::fakeSomeScalarSamples().

190 { return SquaredAverageCache; }
Vector< RealType > SquaredAverageCache
cached block averages of the squared values

◆ getApproximateEnergyVariance()

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.

It can be the same as weighted average only when block weights are identical.

Definition at line 371 of file EstimatorManagerBase.cpp.

References Communicate::bcast(), qmcplusplus::COLLECT, accumulator_set< T, typename >::count(), qmcplusplus::Units::charge::e, EstimatorManagerBase::energyAccumulator, accumulator_set< T, typename >::mean(), EstimatorManagerBase::myComm, EstimatorManagerBase::Options, accumulator_set< T, typename >::result(), and EstimatorManagerBase::varAccumulator.

372 {
373  if (Options[COLLECT]) //need to broadcast the value
374  {
375  RealType tmp[3];
376  tmp[0] = energyAccumulator.count();
377  tmp[1] = energyAccumulator.result();
378  tmp[2] = varAccumulator.result();
379  myComm->bcast(tmp, 3);
380  e = tmp[1] / tmp[0];
381  var = tmp[2] / tmp[0] - e * e;
382  }
383  else
384  {
386  var = varAccumulator.mean() - e * e;
387  }
388 }
ScalarEstimatorBase::accumulator_type energyAccumulator
accumulator for the energy
ScalarEstimatorBase::accumulator_type varAccumulator
accumulator for the variance
return_type mean() const
return the mean
Definition: accumulators.h:126
QMCTraits::RealType RealType
return_type result() const
return the sum
Definition: accumulators.h:108
Communicate * myComm
communicator to handle communication
return_type count() const
return the count
Definition: accumulators.h:116
void bcast(T &)

◆ getCommunicator()

Communicate* getCommunicator ( )
inline

return the communicator

Definition at line 69 of file EstimatorManagerBase.h.

References EstimatorManagerBase::myComm.

69 { return myComm; }
Communicate * myComm
communicator to handle communication

◆ getData()

void getData ( int  i,
std::vector< RealType > &  values 
)

Definition at line 499 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::Block2Total, Matrix< T, Alloc >::rows(), and EstimatorManagerBase::TotalAveragesData.

500 {
501  int entries = TotalAveragesData.rows();
502  values.resize(entries);
503  for (int a = 0; a < entries; a++)
504  values[a] = TotalAveragesData(a, Block2Total[i]);
505 }
size_type rows() const
Definition: OhmmsMatrix.h:77
Matrix< RealType > TotalAveragesData
data accumulated over the blocks
std::vector< int > Block2Total
index mapping between BlockAverages and TotalAverages

◆ getEstimator()

EstimatorManagerBase::EstimatorType * getEstimator ( const std::string &  a)

return a pointer to the estimator aname

Definition at line 397 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::EstimatorMap, and EstimatorManagerBase::Estimators.

Referenced by qmcplusplus::TEST_CASE().

398 {
399  std::map<std::string, int>::iterator it = EstimatorMap.find(a);
400  if (it == EstimatorMap.end())
401  return nullptr;
402  else
403  return Estimators[(*it).second].get();
404 }
std::map< std::string, int > EstimatorMap
column map
UPtrVector< EstimatorType > Estimators
estimators of simple scalars

◆ getMainEstimator()

EstimatorManagerBase::EstimatorType * getMainEstimator ( )

return a pointer to the estimator

Definition at line 390 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::add(), EstimatorManagerBase::main_estimator_name_, and EstimatorManagerBase::MainEstimator.

391 {
392  if (MainEstimator == nullptr)
393  add(std::make_unique<LocalEnergyOnlyEstimator>(), main_estimator_name_);
394  return MainEstimator;
395 }
int add(std::unique_ptr< EstimatorType > newestimator, const std::string &aname)
add an Estimator
ScalarEstimatorBase * MainEstimator
pointer to the primary ScalarEstimatorBase
std::string main_estimator_name_
name of the primary estimator name

◆ getObservable()

RealType getObservable ( int  i) const
inline

Definition at line 97 of file EstimatorManagerBase.h.

References EstimatorManagerBase::TotalAverages.

Referenced by QMCDriver::getObservable().

97 { return TotalAverages[i]; }
RecordNamedProperty< RealType > TotalAverages
block averages: name to value

◆ getProperty()

RealType getProperty ( int  i) const
inline

Definition at line 93 of file EstimatorManagerBase.h.

References EstimatorManagerBase::PropertyCache.

93 { return PropertyCache[i]; }
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU

◆ is_manager()

bool is_manager ( ) const
inline

return true if the rank == 0

Definition at line 73 of file EstimatorManagerBase.h.

References EstimatorManagerBase::myComm, and Communicate::rank().

73 { return !myComm->rank(); }
int rank() const
return the rank
Definition: Communicate.h:116
Communicate * myComm
communicator to handle communication

◆ put()

bool put ( QMCHamiltonian H,
xmlNodePtr  cur 
)

process xml tag associated with estimators

This should be moved to branch engine.

Definition at line 407 of file EstimatorManagerBase.cpp.

References OhmmsAttributeSet::add(), EstimatorManagerBase::add(), qmcplusplus::app_log(), EstimatorManagerBase::Collectables, EstimatorManagerBase::Estimators, EstimatorManagerBase::main_estimator_name_, EstimatorManagerBase::max_output_scalar_dat_, OhmmsAttributeSet::put(), QMCHamiltonian::sizeOfCollectables(), and QMCHamiltonian::sizeOfObservables().

Referenced by QMCDriver::process().

408 {
409  std::vector<std::string> extra;
410  cur = cur->children;
411  while (cur != NULL)
412  {
413  std::string cname((const char*)(cur->name));
414  if (cname == "estimator")
415  {
416  std::string est_name(main_estimator_name_);
417  std::string use_hdf5("yes");
418  OhmmsAttributeSet hAttrib;
419  hAttrib.add(est_name, "name");
420  hAttrib.add(use_hdf5, "hdf5");
421  hAttrib.put(cur);
422  if ((est_name == main_estimator_name_) || (est_name == "elocal"))
423  {
424  max_output_scalar_dat_ = H.sizeOfObservables() + 3;
425  add(std::make_unique<LocalEnergyEstimator>(H, use_hdf5 == "yes"), main_estimator_name_);
426  }
427  else if (est_name == "RMC")
428  {
429  int nobs(20);
430  OhmmsAttributeSet hAttrib;
431  hAttrib.add(nobs, "nobs");
432  hAttrib.put(cur);
433  max_output_scalar_dat_ = nobs * H.sizeOfObservables() + 3;
434  add(std::make_unique<RMCLocalEnergyEstimator>(H, nobs), main_estimator_name_);
435  }
436  else if (est_name == "CSLocalEnergy")
437  {
438  OhmmsAttributeSet hAttrib;
439  int nPsi = 1;
440  hAttrib.add(nPsi, "nPsi");
441  hAttrib.put(cur);
442  add(std::make_unique<CSEnergyEstimator>(H, nPsi), main_estimator_name_);
443  app_log() << " Adding a CSEnergyEstimator for the MainEstimator " << std::endl;
444  }
445  else
446  extra.push_back(est_name);
447  }
448  cur = cur->next;
449  }
450  if (Estimators.empty())
451  {
452  app_log() << " Adding a default LocalEnergyEstimator for the MainEstimator " << std::endl;
453  max_output_scalar_dat_ = H.sizeOfObservables() + 3;
454  add(std::make_unique<LocalEnergyEstimator>(H, true), main_estimator_name_);
455  }
456  //Collectables is special and should not be added to Estimators
457  if (Collectables == nullptr && H.sizeOfCollectables())
458  {
459  app_log() << " Using CollectablesEstimator for collectables, e.g. sk, gofr, density " << std::endl;
460  Collectables = std::make_unique<CollectablesEstimator>(H);
461  }
462  return true;
463 }
int add(std::unique_ptr< EstimatorType > newestimator, const std::string &aname)
add an Estimator
std::ostream & app_log()
Definition: OutputManager.h:65
bool put(xmlNodePtr cur)
assign attributes to the set
Definition: AttributeSet.h:55
int max_output_scalar_dat_
number of maximum data for a scalar.dat
class to handle a set of attributes of an xmlNode
Definition: AttributeSet.h:24
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::string main_estimator_name_
name of the primary estimator name
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
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

◆ reset()

void reset ( )

reset the estimator

reset names of the properties

The number of estimators and their order can vary from the previous state. reinitialized properties before setting up a new BlockAverage data list.

Definition at line 126 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::acceptInd, RecordNamedProperty< T >::add(), EstimatorManagerBase::BlockAverages, EstimatorManagerBase::BlockProperties, RecordNamedProperty< T >::clear(), EstimatorManagerBase::Collectables, EstimatorManagerBase::cpuInd, EstimatorManagerBase::Estimators, EstimatorManagerBase::max_output_scalar_dat_, RecordNamedProperty< T >::size(), and EstimatorManagerBase::weightInd.

Referenced by EstimatorManagerBase::start(), and qmcplusplus::TEST_CASE().

127 {
128  weightInd = BlockProperties.add("BlockWeight");
129  cpuInd = BlockProperties.add("BlockCPU");
130  acceptInd = BlockProperties.add("AcceptRatio");
131  BlockAverages.clear(); //cleaup the records
132  for (int i = 0; i < Estimators.size(); i++)
133  Estimators[i]->add2Record(BlockAverages);
135  if (Collectables)
136  Collectables->add2Record(BlockAverages);
137 }
int weightInd
index for the block weight PropertyCache(weightInd)
int acceptInd
index for the acceptance rate PropertyCache(acceptInd)
RecordNamedProperty< RealType > BlockProperties
manager of property data
int max_output_scalar_dat_
number of maximum data for a scalar.dat
int add(const std::string &aname)
int cpuInd
index for the block cpu PropertyCache(cpuInd)
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
RecordNamedProperty< RealType > BlockAverages
manager of scalar data

◆ resetTargetParticleSet()

void resetTargetParticleSet ( ParticleSet p)

Definition at line 139 of file EstimatorManagerBase.cpp.

139 {}

◆ setCollectionMode()

void setCollectionMode ( bool  collect)

set CollectSum

Parameters
collectif true, global sum is done over the values

Definition at line 111 of file EstimatorManagerBase.cpp.

References qmcplusplus::COLLECT, EstimatorManagerBase::myComm, EstimatorManagerBase::Options, EstimatorManagerBase::setCommunicator(), and Communicate::size().

Referenced by DMC::run().

112 {
113  if (!myComm)
114  setCommunicator(0);
115  Options.set(COLLECT, (myComm->size() == 1) ? false : collect);
116  //force to be false for serial runs
117  //CollectSum = (myComm->size() == 1)? false:collect;
118 }
int size() const
return the number of tasks
Definition: Communicate.h:118
void setCommunicator(Communicate *c)
set the communicator
Communicate * myComm
communicator to handle communication

◆ setCommunicator()

void setCommunicator ( Communicate c)

set the communicator

Definition at line 90 of file EstimatorManagerBase.cpp.

References qmcplusplus::COLLECT, OHMMS::Controller, qmcplusplus::MANAGE, EstimatorManagerBase::myComm, EstimatorManagerBase::Options, Communicate::rank(), EstimatorManagerBase::RemoteData, and Communicate::size().

Referenced by EstimatorManagerBase::EstimatorManagerBase(), and EstimatorManagerBase::setCollectionMode().

91 {
92  // I think this is actually checking if this is the "Main Estimator"
93  if (myComm && myComm == c)
94  return;
95  myComm = c ? c : OHMMS::Controller;
96  //set the default options
97  // This is a flag to tell manager if there is more than one rank
98  // running walkers, its discovered by smelly query of myComm.
99  Options.set(COLLECT, myComm->size() > 1);
100  Options.set(MANAGE, myComm->rank() == 0);
101  if (RemoteData.empty())
102  {
103  RemoteData.push_back(std::make_unique<BufferType>());
104  RemoteData.push_back(std::make_unique<BufferType>());
105  }
106 }
int rank() const
return the rank
Definition: Communicate.h:116
Communicate * Controller
Global Communicator for a process.
Definition: Communicate.cpp:35
int size() const
return the number of tasks
Definition: Communicate.h:118
Communicate * myComm
communicator to handle communication
std::vector< std::unique_ptr< BufferType > > RemoteData

◆ setProperty()

void setProperty ( int  i,
RealType  v 
)
inline

set the value of the i-th column with a value v

Parameters
icolumn index
vvalue

Definition at line 91 of file EstimatorManagerBase.h.

References EstimatorManagerBase::PropertyCache.

91 { PropertyCache[i] = v; }
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU

◆ size()

int size ( void  ) const
inline

return the number of ScalarEstimators

Definition at line 76 of file EstimatorManagerBase.h.

References EstimatorManagerBase::Estimators.

Referenced by qmcplusplus::TEST_CASE().

76 { return Estimators.size(); }
UPtrVector< EstimatorType > Estimators
estimators of simple scalars

◆ start()

void start ( int  blocks,
bool  record = true 
)

start a run

Parameters
blocksnumber of blocks
recordif true, will write to a file

Replace reportHeader and reset functon.

Definition at line 160 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::addHeader(), EstimatorManagerBase::Archive, EstimatorManagerBase::AverageCache, EstimatorManagerBase::BlockAverages, EstimatorManagerBase::BlockProperties, EstimatorManagerBase::BufferSize, accumulator_set< T, typename >::clear(), EstimatorManagerBase::Collectables, hdf_archive::create(), EstimatorManagerBase::energyAccumulator, EstimatorManagerBase::Estimators, Communicate::getName(), EstimatorManagerBase::h5desc, EstimatorManagerBase::h_file, qmcplusplus::MANAGE, EstimatorManagerBase::myComm, EstimatorManagerBase::Options, EstimatorManagerBase::PropertyCache, Communicate::rank(), qmcplusplus::RECORD, EstimatorManagerBase::RecordCount, EstimatorManagerBase::RemoteData, EstimatorManagerBase::reset(), Vector< T, Alloc >::resize(), RecordNamedProperty< T >::setValues(), Vector< T, Alloc >::size(), RecordNamedProperty< T >::size(), EstimatorManagerBase::SquaredAverageCache, and EstimatorManagerBase::varAccumulator.

Referenced by VMC::run(), RMC::run(), DMC::run(), CSVMC::run(), QMCUpdateBase::startRun(), and qmcplusplus::TEST_CASE().

161 {
162  reset();
163  RecordCount = 0;
166  int nc = (Collectables) ? Collectables->size() : 0;
168  // \todo Collectables should just have its own data structures not change the EMBS layout.
172  //count the buffer size for message
174  int sources = 2;
175  //allocate buffer for data collection
176  if (RemoteData.empty())
177  for (int i = 0; i < sources; ++i)
178  RemoteData.push_back(std::make_unique<BufferType>(BufferSize));
179  else
180  for (int i = 0; i < RemoteData.size(); ++i)
181  RemoteData[i]->resize(BufferSize);
182 #if defined(DEBUG_ESTIMATOR_ARCHIVE)
183  if (record && !DebugArchive)
184  {
185  std::array<char, 128> fname;
186  if (std::snprintf(fname.data(), fname.size(), "%s.p%03d.scalar.dat", myComm->getName().c_str(), myComm->rank()) < 0)
187  throw std::runtime_error("Error generating filename");
188  DebugArchive = std::make_unique<std::ofstream>(fname.data());
189  addHeader(*DebugArchive);
190  }
191 #endif
192  //set Options[RECORD] to enable/disable output
193  Options.set(RECORD, record && Options[MANAGE]);
194  if (Options[RECORD])
195  {
196  std::filesystem::path fname(myComm->getName());
197  fname.concat(".scalar.dat");
198  Archive = std::make_unique<std::ofstream>(fname);
199  addHeader(*Archive);
200  if (!h5desc.empty())
201  {
202  h5desc.clear();
203  }
204  fname = myComm->getName() + ".stat.h5";
205  h_file.create(fname);
206  for (int i = 0; i < Estimators.size(); i++)
207  Estimators[i]->registerObservables(h5desc, h_file);
208  if (Collectables)
209  Collectables->registerObservables(h5desc, h_file);
210  }
211 }
void resize(size_type n, Type_t val=Type_t())
Resize the container.
Definition: OhmmsVector.h:166
int rank() const
return the rank
Definition: Communicate.h:116
RecordNamedProperty< RealType > BlockProperties
manager of property data
ScalarEstimatorBase::accumulator_type energyAccumulator
accumulator for the energy
Vector< RealType > AverageCache
cached block averages of the values
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 addHeader(std::ostream &o)
add header to an std::ostream
const std::string & getName() const
Definition: Communicate.h:131
size_type size() const
return the current size
Definition: OhmmsVector.h:162
int BufferSize
size of the message buffer
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
bool create(const std::filesystem::path &fname, unsigned flags=H5F_ACC_TRUNC)
create a file
std::vector< ObservableHelper > h5desc
convenient descriptors for hdf5
Communicate * myComm
communicator to handle communication
std::vector< std::unique_ptr< BufferType > > RemoteData
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU
RecordNamedProperty< RealType > BlockAverages
manager of scalar data
Vector< RealType > SquaredAverageCache
cached block averages of the squared values

◆ startBlock()

void startBlock ( int  steps)

start a block

Parameters
stepsnumber of steps in a block

Definition at line 251 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::BlockWeight, EstimatorManagerBase::MyTimer, and Timer::restart().

Referenced by DMC::run(), and QMCUpdateBase::startBlock().

252 {
253  MyTimer.restart();
254  BlockWeight = 0.0;
255 }
void restart()
Definition: Timer.h:29
RealType BlockWeight
total weight accumulated in a block

◆ stop() [1/2]

void stop ( )

stop a qmc run

Stop a run.

Replace finalize();

Collect data in Cache and print out data into hdf5 and ascii file. This should not be called in a OpenMP parallel region or should be guarded by master/single. Keep the ascii output for now

Definition at line 243 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::Archive, hdf_archive::close(), and EstimatorManagerBase::h_file.

Referenced by VMC::run(), RMC::run(), DMC::run(), CSVMC::run(), EstimatorManagerBase::stop(), QMCUpdateBase::stopRun(), and qmcplusplus::TEST_CASE().

244 {
245  //close any open files
246  Archive.reset();
247  h_file.close();
248 }
void close()
close all the open groups and file
Definition: hdf_archive.cpp:38
std::unique_ptr< std::ofstream > Archive
file handler to write data

◆ stop() [2/2]

void stop ( const std::vector< EstimatorManagerBase *>  m)

stop a qmc run

Definition at line 213 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::AverageCache, EstimatorManagerBase::PropertyCache, Vector< T, Alloc >::size(), EstimatorManagerBase::SquaredAverageCache, and EstimatorManagerBase::stop().

214 {
215  int num_threads = est.size();
216  //normalize by the number of threads per node
217  RealType tnorm = 1.0 / static_cast<RealType>(num_threads);
218  //add averages and divide them by the number of threads
219  AverageCache = est[0]->AverageCache;
220  for (int i = 1; i < num_threads; i++)
221  AverageCache += est[i]->AverageCache;
222  AverageCache *= tnorm;
223  SquaredAverageCache = est[0]->SquaredAverageCache;
224  for (int i = 1; i < num_threads; i++)
226  SquaredAverageCache *= tnorm;
227  //add properties and divide them by the number of threads except for the weight
228  PropertyCache = est[0]->PropertyCache;
229  for (int i = 1; i < num_threads; i++)
230  PropertyCache += est[i]->PropertyCache;
231  for (int i = 1; i < PropertyCache.size(); i++)
232  PropertyCache[i] *= tnorm;
233  stop();
234 }
Vector< RealType > AverageCache
cached block averages of the values
size_type size() const
return the current size
Definition: OhmmsVector.h:162
QMCTraits::RealType RealType
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU
Vector< RealType > SquaredAverageCache
cached block averages of the squared values

◆ stopBlock() [1/2]

void stopBlock ( RealType  accept,
bool  collectall = true 
)

stop a block

take statistics of a block

Parameters
acceptacceptance rate of this block
acceptacceptance rate of this block
collectallif true, need to gather data over MPI tasks

Definition at line 261 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::acceptInd, EstimatorManagerBase::AverageCache, Vector< T, Alloc >::begin(), EstimatorManagerBase::BlockWeight, EstimatorManagerBase::Collectables, EstimatorManagerBase::collectBlockAverages(), EstimatorManagerBase::cpuInd, Timer::elapsed(), EstimatorManagerBase::Estimators, EstimatorManagerBase::MyTimer, EstimatorManagerBase::PropertyCache, EstimatorManagerBase::SquaredAverageCache, and EstimatorManagerBase::weightInd.

Referenced by VMC::run(), RMC::run(), DMC::run(), CSVMC::run(), and QMCUpdateBase::stopBlock().

262 {
263  //take block averages and update properties per block
266  PropertyCache[acceptInd] = accept;
267  for (int i = 0; i < Estimators.size(); i++)
268  Estimators[i]->takeBlockAverage(AverageCache.begin(), SquaredAverageCache.begin());
269  if (Collectables)
270  {
271  Collectables->takeBlockAverage(AverageCache.begin(), SquaredAverageCache.begin());
272  }
273  if (collectall)
275 }
double elapsed() const
Definition: Timer.h:30
RealType BlockWeight
total weight accumulated in a block
int weightInd
index for the block weight PropertyCache(weightInd)
int acceptInd
index for the acceptance rate PropertyCache(acceptInd)
Vector< RealType > AverageCache
cached block averages of the values
int cpuInd
index for the block cpu PropertyCache(cpuInd)
UPtrVector< EstimatorType > Estimators
estimators of simple scalars
std::unique_ptr< CollectablesEstimator > Collectables
pointer to the CollectablesEstimator
void collectBlockAverages()
collect data and write
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU
Vector< RealType > SquaredAverageCache
cached block averages of the squared values

◆ stopBlock() [2/2]

void stopBlock ( const std::vector< EstimatorManagerBase *> &  m)

stop a block

Parameters
mlist of estimator which has been collecting data independently

Definition at line 277 of file EstimatorManagerBase.cpp.

References EstimatorManagerBase::AverageCache, EstimatorManagerBase::collectBlockAverages(), EstimatorManagerBase::PropertyCache, Vector< T, Alloc >::size(), and EstimatorManagerBase::SquaredAverageCache.

278 {
279  //normalized it by the thread
280  int num_threads = est.size();
281  RealType tnorm = 1.0 / num_threads;
282  AverageCache = est[0]->AverageCache;
283  for (int i = 1; i < num_threads; i++)
284  AverageCache += est[i]->AverageCache;
285  AverageCache *= tnorm;
286  SquaredAverageCache = est[0]->SquaredAverageCache;
287  for (int i = 1; i < num_threads; i++)
289  SquaredAverageCache *= tnorm;
290  PropertyCache = est[0]->PropertyCache;
291  for (int i = 1; i < num_threads; i++)
292  PropertyCache += est[i]->PropertyCache;
293  for (int i = 1; i < PropertyCache.size(); i++)
294  PropertyCache[i] *= tnorm;
296 }
Vector< RealType > AverageCache
cached block averages of the values
size_type size() const
return the current size
Definition: OhmmsVector.h:162
void collectBlockAverages()
collect data and write
QMCTraits::RealType RealType
Vector< RealType > PropertyCache
cached block averages of properties, e.g. BlockCPU
Vector< RealType > SquaredAverageCache
cached block averages of the squared values

◆ write()

void write ( CT &  anything,
bool  doappend 
)
inline

Definition at line 184 of file EstimatorManagerBase.h.

References EstimatorManagerBase::h_file.

Referenced by EstimatorManagerBase::collectBlockAverages().

185  {
186  anything.write(h_file, doappend);
187  }

Friends And Related Function Documentation

◆ qmcplusplus::testing::EstimatorManagerBaseTest

Definition at line 278 of file EstimatorManagerBase.h.

Member Data Documentation

◆ acceptInd

int acceptInd
protected

index for the acceptance rate PropertyCache(acceptInd)

Definition at line 204 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::reset(), and EstimatorManagerBase::stopBlock().

◆ Archive

std::unique_ptr<std::ofstream> Archive
protected

◆ AverageCache

◆ Block2Total

std::vector<int> Block2Total
protected

index mapping between BlockAverages and TotalAverages

Definition at line 247 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::addObservable(), and EstimatorManagerBase::getData().

◆ BlockAverages

◆ BlockProperties

◆ BlockWeight

RealType BlockWeight
protected

total weight accumulated in a block

Definition at line 208 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::accumulate(), EstimatorManagerBase::startBlock(), and EstimatorManagerBase::stopBlock().

◆ BufferSize

int BufferSize
protected

size of the message buffer

Definition at line 196 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::start().

◆ Collectables

◆ cpuInd

int cpuInd
protected

index for the block cpu PropertyCache(cpuInd)

Definition at line 202 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::reset(), and EstimatorManagerBase::stopBlock().

◆ energyAccumulator

ScalarEstimatorBase::accumulator_type energyAccumulator
protected

accumulator for the energy

Todo:
expand it for all the scalar observables to report the final results

Definition at line 229 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::collectBlockAverages(), EstimatorManagerBase::getApproximateEnergyVariance(), and EstimatorManagerBase::start().

◆ EstimatorMap

std::map<std::string, int> EstimatorMap
protected

◆ Estimators

◆ h5desc

std::vector<ObservableHelper> h5desc
protected

convenient descriptors for hdf5

Definition at line 253 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::collectBlockAverages(), and EstimatorManagerBase::start().

◆ h_file

◆ main_estimator_name_

std::string main_estimator_name_
private

◆ MainEstimator

◆ max_block_avg_name_

size_t max_block_avg_name_
private

largest name in BlockAverages adding 2 characters

Definition at line 276 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::addHeader(), and EstimatorManagerBase::collectBlockAverages().

◆ max_output_scalar_dat_

int max_output_scalar_dat_
private

◆ myComm

◆ MyTimer

Timer MyTimer
protected

◆ Options

◆ PropertyCache

◆ RecordCount

int RecordCount
protected

number of records in a block

Definition at line 198 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::collectBlockAverages(), and EstimatorManagerBase::start().

◆ RemoteData

std::vector<std::unique_ptr<BufferType> > RemoteData
private

◆ SquaredAverageCache

◆ TotalAverages

RecordNamedProperty<RealType> TotalAverages
protected

block averages: name to value

Definition at line 243 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::addObservable(), and EstimatorManagerBase::getObservable().

◆ TotalAveragesData

Matrix<RealType> TotalAveragesData
protected

data accumulated over the blocks

Definition at line 245 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::getData().

◆ varAccumulator

◆ weightInd

int weightInd
protected

index for the block weight PropertyCache(weightInd)

Definition at line 200 of file EstimatorManagerBase.h.

Referenced by EstimatorManagerBase::reset(), and EstimatorManagerBase::stopBlock().


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