QMCPACK
FakeOperatorEstimator Class Reference
+ Inheritance diagram for FakeOperatorEstimator:
+ Collaboration diagram for FakeOperatorEstimator:

Public Types

using QMCT = QMCTraits
 
- Public Types inherited from OperatorEstBase
using QMCT = QMCTraits
 
using FullPrecRealType = QMCT::FullPrecRealType
 
using MCPWalker = Walker< QMCTraits, PtclOnLatticeTraits >
 
using Data = std::vector< QMCT::RealType >
 

Public Member Functions

 FakeOperatorEstimator (int num_ranks, DataLocality data_locality)
 
 FakeOperatorEstimator (const FakeOperatorEstimator &foe)
 
 ~FakeOperatorEstimator () override
 
void accumulate (const RefVector< MCPWalker > &walkers, const RefVector< ParticleSet > &psets, const RefVector< TrialWaveFunction > &wfns, const RefVector< QMCHamiltonian > &hams, RandomBase< FullPrecRealType > &rng) override
 Accumulate whatever it is you are accumulating with respect to walkers. More...
 
void registerOperatorEstimator (hdf_archive &file) override
 
void startBlock (int nsteps) override
 
std::unique_ptr< OperatorEstBasespawnCrowdClone () const override
 
void set_walker_weights (QMCT::RealType weight)
 
- Public Member Functions inherited from OperatorEstBase
 OperatorEstBase (DataLocality dl)
 constructor More...
 
 OperatorEstBase (const OperatorEstBase &oth)
 Shallow copy constructor! This alows us to keep the default copy constructors for derived classes which is quite useful to the spawnCrowdClone design. More...
 
virtual ~OperatorEstBase ()=default
 virtual destructor More...
 
virtual void collect (const RefVector< OperatorEstBase > &oebs)
 Reduce estimator result data from crowds to rank. More...
 
virtual void normalize (QMCT::RealType invToWgt)
 
std::vector< QMCT::RealType > & get_data ()
 
void write (hdf_archive &file)
 Write to previously registered observable_helper hdf5 wrapper. More...
 
void zero ()
 zero data appropriately for the DataLocality More...
 
QMCT::FullPrecRealType get_walkers_weight () const
 Return the total walker weight for this block. More...
 
const std::string & get_my_name () const
 
virtual void registerListeners (QMCHamiltonian &ham_leader)
 Register 0-many listeners with a leading QMCHamiltonian instance i.e. More...
 
bool isListenerRequired ()
 
DataLocality get_data_locality () const
 

Additional Inherited Members

- Protected Attributes inherited from OperatorEstBase
DataLocality data_locality_
 locality for accumulation of estimator data. More...
 
std::string my_name_
 name of this object – only used for debugging and h5 output More...
 
QMCT::FullPrecRealType walkers_weight_
 
std::vector< ObservableHelperh5desc_
 
Data data_
 
bool requires_listener_ = false
 

Detailed Description

Definition at line 21 of file FakeOperatorEstimator.h.

Member Typedef Documentation

◆ QMCT

using QMCT = QMCTraits

Definition at line 24 of file FakeOperatorEstimator.h.

Constructor & Destructor Documentation

◆ FakeOperatorEstimator() [1/2]

FakeOperatorEstimator ( int  num_ranks,
DataLocality  data_locality 
)

Definition at line 18 of file FakeOperatorEstimator.cpp.

References OperatorEstBase::data_, OperatorEstBase::data_locality_, and qmcplusplus::num_ranks.

18  : OperatorEstBase(data_locality)
19 {
20  data_locality_ = data_locality;
21  data_.resize(num_ranks * 10);
22 }
DataLocality data_locality_
locality for accumulation of estimator data.
OperatorEstBase(DataLocality dl)
constructor

◆ FakeOperatorEstimator() [2/2]

Definition at line 24 of file FakeOperatorEstimator.cpp.

References OperatorEstBase::data_.

24  : OperatorEstBase(foe)
25 {
26  data_.resize(foe.data_.size());
27 }
OperatorEstBase(DataLocality dl)
constructor

◆ ~FakeOperatorEstimator()

~FakeOperatorEstimator ( )
inlineoverride

Definition at line 30 of file FakeOperatorEstimator.h.

30 {};

Member Function Documentation

◆ accumulate()

void accumulate ( const RefVector< MCPWalker > &  walkers,
const RefVector< ParticleSet > &  psets,
const RefVector< TrialWaveFunction > &  wfns,
const RefVector< QMCHamiltonian > &  hams,
RandomBase< FullPrecRealType > &  rng 
)
inlineoverridevirtual

Accumulate whatever it is you are accumulating with respect to walkers.

This method is assumed to be called from the crowd context It provides parallelism with respect to computational effort of the estimator without causing a global sync. Depending on data locality the accumlation of the result may be different from the single thread write directly into the OperatorEstimator data.

Parameters
[in]walkers
[in,out]pset_targetcrowd scope target pset (should be returned to starting state after call)
[in]psetsper walker psets
[in]wnfsper walker TrialWaveFunction
[in,out]rngcrowd scope RandomGenerator

Implements OperatorEstBase.

Definition at line 32 of file FakeOperatorEstimator.h.

37  {}

◆ registerOperatorEstimator()

void registerOperatorEstimator ( hdf_archive file)
inlineoverridevirtual

Reimplemented from OperatorEstBase.

Definition at line 39 of file FakeOperatorEstimator.h.

39 {}

◆ set_walker_weights()

void set_walker_weights ( QMCT::RealType  weight)
inline

◆ spawnCrowdClone()

std::unique_ptr<OperatorEstBase> spawnCrowdClone ( ) const
inlineoverridevirtual

Implements OperatorEstBase.

Definition at line 43 of file FakeOperatorEstimator.h.

44  {
45  return std::make_unique<FakeOperatorEstimator>(*this);
46  }

◆ startBlock()

void startBlock ( int  nsteps)
inlineoverridevirtual

Implements OperatorEstBase.

Definition at line 41 of file FakeOperatorEstimator.h.

41 {}

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