![]() |
QMCPACK
|
Classes | |
struct | SOECPotentialMultiWalkerResource |
Public Member Functions | |
SOECPotential (ParticleSet &ions, ParticleSet &els, TrialWaveFunction &psi, bool use_exact_spin) | |
constructor More... | |
~SOECPotential () override | |
bool | dependsOnWaveFunction () const override |
return true if this operator depends on a wavefunction More... | |
std::string | getClassName () const override |
return class name More... | |
void | resetTargetParticleSet (ParticleSet &P) override |
Reset the data with the target ParticleSet. More... | |
Return_t | evaluate (ParticleSet &P) override |
Evaluate the local energy contribution of this component. More... | |
Return_t | evaluateDeterministic (ParticleSet &P) override |
Evaluate the local energy contribution of this component, deterministically based on current state. More... | |
Return_t | evaluateValueAndDerivatives (ParticleSet &P, const opt_variables_type &optvars, const Vector< ValueType > &dlogpsi, Vector< ValueType > &dhpsioverpsi) override |
Evaluate value and derivatives wrt the optimizables. More... | |
void | mw_evaluate (const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list) const override |
Evaluate the contribution of this component of multiple walkers. More... | |
void | mw_evaluatePerParticle (const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< Real >> &listeners, const std::vector< ListenerVector< Real >> &listeners_ions) const override |
bool | put (xmlNodePtr cur) override |
Read the input parameter. More... | |
bool | get (std::ostream &os) const override |
write about the class More... | |
std::unique_ptr< OperatorBase > | makeClone (ParticleSet &qp, TrialWaveFunction &psi) final |
void | addComponent (int groupID, std::unique_ptr< SOECPComponent > &&pp) |
void | setRandomGenerator (RandomBase< FullPrecRealType > *rng) override |
Set the Random Generator object TODO: add docs. More... | |
void | createResource (ResourceCollection &collection) const override |
Initialize a shared resource and hand it to a collection. More... | |
void | acquireResource (ResourceCollection &collection, const RefVectorWithLeader< OperatorBase > &o_list) const override |
Acquire a shared resource from a collection. More... | |
void | releaseResource (ResourceCollection &collection, const RefVectorWithLeader< OperatorBase > &o_list) const override |
Return a shared resource to a collection. More... | |
![]() | |
OperatorBase () | |
Construct a new Operator Base object Default and unique empty constructor. More... | |
virtual | ~OperatorBase ()=default |
std::bitset< 8 > & | getUpdateMode () noexcept |
get update_mode_ reference More... | |
Return_t | getValue () const noexcept |
get a copy of value_ More... | |
std::string | getName () const noexcept |
getter a copy of my_name_, rvalue small string optimization More... | |
void | setName (const std::string name) noexcept |
Set my_name member, uses small string optimization (pass by value) More... | |
TraceRequest & | getRequest () noexcept |
Get request_ member. More... | |
virtual void | addObservables (PropertySetType &plist, BufferType &collectables) |
named values to the property list Default implementaton uses addValue(plist_) More... | |
virtual void | registerObservables (std::vector< ObservableHelper > &h5desc, hdf_archive &file) const |
add to observable descriptor for hdf5 The default implementation is to register a scalar for this->value_ More... | |
virtual void | registerCollectables (std::vector< ObservableHelper > &h5desc, hdf_archive &file) const |
virtual void | setObservables (PropertySetType &plist) |
Set the values evaluated by this object to plist Default implementation is to assign Value which is updated by evaluate function using my_index_. More... | |
virtual void | setParticlePropertyList (PropertySetType &plist, int offset) |
virtual void | setHistories (Walker_t &ThisWalker) |
virtual void | mw_evaluatePerParticle (const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< RealType >> &listeners, const std::vector< ListenerVector< RealType >> &listeners_ions) const |
Evaluate the contribution of this component of multiple walkers per particle and report to registerd listeners from objects in Estimators. More... | |
virtual void | mw_evaluateWithParameterDerivatives (const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< ParticleSet > &p_list, const opt_variables_type &optvars, const RecordArray< ValueType > &dlogpsi, RecordArray< ValueType > &dhpsioverpsi) const |
TODO: add docs. More... | |
virtual Return_t | rejectedMove (ParticleSet &P) |
TODO: add docs. More... | |
virtual Return_t | evaluateWithToperator (ParticleSet &P) |
Evaluate the local energy contribution of this component with Toperators updated if requested. More... | |
virtual void | mw_evaluateWithToperator (const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list) const |
Evaluate the contribution of this component of multiple walkers. More... | |
virtual void | mw_evaluatePerParticleWithToperator (const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< RealType >> &listeners, const std::vector< ListenerVector< RealType >> &listeners_ions) const |
Evaluate the contribution of this component of multiple walkers per particle and report to registerd listeners from objects in Estimators. More... | |
virtual Return_t | evaluateWithIonDerivs (ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_term, ParticleSet::ParticlePos &pulay_term) |
Evaluate contribution to local energy and derivatives w.r.t ionic coordinates from OperatorBase. More... | |
virtual Return_t | evaluateWithIonDerivsDeterministic (ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_term, ParticleSet::ParticlePos &pulay_term) |
Evaluate contribution to local energy and derivatives w.r.t ionic coordinates from OperatorBase. More... | |
virtual void | evaluateOneBodyOpMatrix (ParticleSet &P, const TWFFastDerivWrapper &psi, std::vector< ValueMatrix > &B) |
Evaluate "B" matrix for observable. More... | |
virtual void | evaluateOneBodyOpMatrixForceDeriv (ParticleSet &P, ParticleSet &source, const TWFFastDerivWrapper &psi, const int iat, std::vector< std::vector< ValueMatrix >> &Bforce) |
Evaluate "dB/dR" matrices for observable. More... | |
virtual void | updateSource (ParticleSet &s) |
Update data associated with a particleset. More... | |
virtual Return_t | getEnsembleAverage () |
Return an average value by collective operation. More... | |
virtual void | add2Hamiltonian (ParticleSet &qp, TrialWaveFunction &psi, QMCHamiltonian &targetH) |
TODO: add docs. More... | |
virtual void | getRequiredTraces (TraceManager &tm) |
TODO: add docs. More... | |
virtual void | informOfPerParticleListener () |
bool | isClassical () const noexcept |
bool | isQuantum () const noexcept |
bool | isClassicalClassical () const noexcept |
bool | isQuantumClassical () const noexcept |
bool | isQuantumQuantum () const noexcept |
bool | getMode (const int i) const noexcept |
Return the mode i. More... | |
bool | isNonLocal () const noexcept |
TODO: add docs. More... | |
bool | hasListener () const noexcept |
void | contributeTraceQuantities () |
Make trace quantities available. More... | |
void | checkoutTraceQuantities (TraceManager &tm) |
Checkout trace arrays Derived classes must guard individual checkouts using request info. More... | |
void | collectScalarTraces () |
Collect scalar trace data. More... | |
void | deleteTraceQuantities () |
delete trace arrays More... | |
Static Protected Member Functions | |
static void | mw_evaluateImpl (const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, std::optional< ListenerOption< Real >> listeners, bool keep_grid=false) |
Protected Attributes | |
RandomBase< FullPrecRealType > * | my_rng_ |
std::vector< SOECPComponent * > | pp_ |
std::vector< std::unique_ptr< SOECPComponent > > | ppset_ |
ParticleSet & | ion_config_ |
TrialWaveFunction & | psi_ |
![]() | |
std::bitset< 8 > | update_mode_ |
set the current update mode More... | |
Return_t | value_ |
current value More... | |
std::string | name_ |
name of this object More... | |
TraceRequest | request_ |
whether traces are being collected More... | |
int | my_index_ |
starting index of this object More... | |
Return_t | new_value_ |
a new value for a proposed move More... | |
Walker_t * | t_walker_ |
reference to the current walker More... | |
bool | streaming_particles_ |
bool | have_required_traces_ |
Private Types | |
using | Real = QMCTraits::RealType |
Private Member Functions | |
void | evaluateImpl (ParticleSet &elec, bool keep_grid=false) |
Private Attributes | |
int | num_ions_ |
number of ions More... | |
int | my_table_index_ |
index of distance table for ion-el pair More... | |
ParticleSet & | peln_ |
reference to the electrons More... | |
NeighborLists | elec_neighbor_ions_ |
neighborlist of electrons More... | |
NeighborLists | ion_neighbor_elecs_ |
neighborlist of ions More... | |
std::vector< std::vector< NLPPJob< RealType > > > | sopp_jobs_ |
ResourceHandle< SOECPotentialMultiWalkerResource > | mw_res_handle_ |
const bool | use_exact_spin_ |
Friends | |
class | testing::TestSOECPotential |
Definition at line 28 of file SOECPotential.h.
|
private |
Definition at line 31 of file SOECPotential.h.
SOECPotential | ( | ParticleSet & | ions, |
ParticleSet & | els, | ||
TrialWaveFunction & | psi, | ||
bool | use_exact_spin | ||
) |
constructor
ionic | positions |
els | electronic poitions |
psi | Trial wave function |
Definition at line 44 of file SOECPotential.cpp.
References ParticleSet::addTable(), ParticleSet::getSpeciesSet(), SpeciesSet::getTotalNum(), ParticleSet::getTotalNum(), ParticleSet::groups(), ParticleSet::groupsize(), SOECPotential::ion_config_, SOECPotential::my_table_index_, SOECPotential::num_ions_, OperatorBase::POTENTIAL, SOECPotential::pp_, SOECPotential::ppset_, OperatorBase::setEnergyDomain(), SOECPotential::sopp_jobs_, and OperatorBase::twoBodyQuantumDomain().
|
overridedefault |
|
overridevirtual |
Acquire a shared resource from a collection.
collection | |
o_list |
Reimplemented from OperatorBase.
Definition at line 331 of file SOECPotential.cpp.
References RefVectorWithLeader< T >::getCastedLeader(), ResourceCollection::lendResource(), and SOECPotential::mw_res_handle_.
void addComponent | ( | int | groupID, |
std::unique_ptr< SOECPComponent > && | pp | ||
) |
Definition at line 311 of file SOECPotential.cpp.
References ParticleSet::GroupID, SOECPotential::ion_config_, SOECPotential::pp_, and SOECPotential::ppset_.
Referenced by qmcplusplus::doSOECPotentialTest().
|
overridevirtual |
Initialize a shared resource and hand it to a collection.
collection |
Reimplemented from OperatorBase.
Definition at line 319 of file SOECPotential.cpp.
References ResourceCollection::addResource(), and SOECPotential::ppset_.
Referenced by qmcplusplus::doSOECPotentialTest().
|
inlineoverridevirtual |
return true if this operator depends on a wavefunction
Reimplemented from OperatorBase.
Definition at line 37 of file SOECPotential.h.
|
overridevirtual |
Evaluate the local energy contribution of this component.
P | input configuration containing N particles |
Implements OperatorBase.
Definition at line 68 of file SOECPotential.cpp.
References SOECPotential::evaluateImpl(), and OperatorBase::value_.
|
overridevirtual |
Evaluate the local energy contribution of this component, deterministically based on current state.
The correct behavior of this routine requires estimators with non-deterministic components in their evaluate() function to override this function.
P | input configuration containing N particles |
Reimplemented from OperatorBase.
Definition at line 74 of file SOECPotential.cpp.
References SOECPotential::evaluateImpl(), and OperatorBase::value_.
|
private |
Definition at line 80 of file SOECPotential.cpp.
References SOECPotential::elec_neighbor_ions_, qmcplusplus::generateRandomRotationMatrix(), ParticleSet::getDistTableAB(), NeighborLists::getNeighborList(), ParticleSet::getTotalNum(), SOECPotential::ion_neighbor_elecs_, SOECPotential::my_rng_, SOECPotential::my_table_index_, SOECPotential::num_ions_, SOECPotential::pp_, SOECPotential::ppset_, SOECPotential::psi_, SOECPotential::use_exact_spin_, and OperatorBase::value_.
Referenced by TestSOECPotential::evalFast(), SOECPotential::evaluate(), and SOECPotential::evaluateDeterministic().
|
overridevirtual |
Evaluate value and derivatives wrt the optimizables.
Default uses evaluate.
P | |
optvars | |
dlogpsi | |
dhpsioverpsi |
Reimplemented from OperatorBase.
Definition at line 114 of file SOECPotential.cpp.
References qmcplusplus::generateRandomRotationMatrix(), DistanceTableAB::getDistRow(), ParticleSet::getDistTableAB(), ParticleSet::getTotalNum(), SOECPotential::my_rng_, SOECPotential::my_table_index_, SOECPotential::num_ions_, SOECPotential::pp_, SOECPotential::ppset_, SOECPotential::psi_, and OperatorBase::value_.
|
inlineoverridevirtual |
write about the class
Implements OperatorBase.
Definition at line 61 of file SOECPotential.h.
References OhmmsElementBase::getName(), and SOECPotential::ion_config_.
|
inlineoverridevirtual |
|
finalvirtual |
Implements OperatorBase.
Definition at line 302 of file SOECPotential.cpp.
References SOECPotential::ion_config_, SOECPotential::ppset_, and SOECPotential::use_exact_spin_.
Referenced by qmcplusplus::doSOECPotentialTest().
|
overridevirtual |
Evaluate the contribution of this component of multiple walkers.
Take o_list and p_list update evaluation result variables in o_list? really should reduce vector of local_energies. matching the ordering and size of o list the this can be call for 1 or more QMCHamiltonians
o_list | |
wf_list | |
p_list |
Temporary raw omp pragma for simple thread parallelism ignoring the driver level concurrency
TODO: replace this with a proper abstraction. It should adequately describe the behavior and strictly limit the activation of this level concurrency to when it is intended. It is unlikely to belong in this function.
This implicitly depends on openmp work division logic. Essentially adhoc runtime crowds over which we have given up control of thread/global scope. How many walkers per thread? How to handle their data movement if any of these hamiltonians should be accelerated? We can neither reason about or describe it in C++
As I understand it it should only be required for as long as the AMD openmp offload compliler is incapable of running multiple threads. They should/must fix their compiler before delivery of frontier and it should be removed at that point at latest
If you want 16 threads of 1 walker that should be 16 crowds of 1 not one crowd of 16 with openmp thrown in at hamiltonian level. If this must be different from the other crowd batching. Make this a reasoned about and controlled level of concurency blocking at the driver level.
This is only thread safe only if each walker has a complete set of anything involved in an Operator.evaluate.
Reimplemented from OperatorBase.
Definition at line 137 of file SOECPotential.cpp.
References SOECPotential::mw_evaluateImpl().
|
staticprotected |
Definition at line 154 of file SOECPotential.cpp.
References qmcplusplus::generateRandomRotationMatrix(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), SOECPComponent::mw_evaluateOne(), TrialWaveFunction::mw_prepareGroup(), SOECPotential::psi_, ListenerVector< T >::report, and SOECPotential::sopp_jobs_.
Referenced by SOECPotential::mw_evaluate(), TestSOECPotential::mw_evaluateImpl(), and SOECPotential::mw_evaluatePerParticle().
|
override |
Definition at line 144 of file SOECPotential.cpp.
References SOECPotential::mw_evaluateImpl().
|
inlineoverridevirtual |
Read the input parameter.
cur | xml node for a OperatorBase object |
Implements OperatorBase.
Definition at line 59 of file SOECPotential.h.
|
overridevirtual |
Return a shared resource to a collection.
collection | |
o_list |
Reimplemented from OperatorBase.
Definition at line 338 of file SOECPotential.cpp.
References RefVectorWithLeader< T >::getCastedLeader(), and ResourceCollection::takebackResource().
|
overridevirtual |
Reset the data with the target ParticleSet.
P | new target ParticleSet |
Implements OperatorBase.
Definition at line 66 of file SOECPotential.cpp.
|
inlineoverridevirtual |
Set the Random Generator object TODO: add docs.
rng |
Reimplemented from OperatorBase.
Definition at line 71 of file SOECPotential.h.
References SOECPotential::my_rng_.
Referenced by qmcplusplus::doSOECPotentialTest().
|
friend |
Definition at line 116 of file SOECPotential.h.
|
private |
neighborlist of electrons
Definition at line 102 of file SOECPotential.h.
Referenced by SOECPotential::evaluateImpl().
|
protected |
Definition at line 86 of file SOECPotential.h.
Referenced by SOECPotential::addComponent(), SOECPotential::get(), SOECPotential::makeClone(), and SOECPotential::SOECPotential().
|
private |
neighborlist of ions
Definition at line 104 of file SOECPotential.h.
Referenced by SOECPotential::evaluateImpl().
|
private |
Definition at line 108 of file SOECPotential.h.
Referenced by SOECPotential::acquireResource().
|
protected |
Definition at line 83 of file SOECPotential.h.
Referenced by SOECPotential::evaluateImpl(), SOECPotential::evaluateValueAndDerivatives(), and SOECPotential::setRandomGenerator().
|
private |
index of distance table for ion-el pair
Definition at line 98 of file SOECPotential.h.
Referenced by SOECPotential::evaluateImpl(), SOECPotential::evaluateValueAndDerivatives(), and SOECPotential::SOECPotential().
|
private |
number of ions
Definition at line 96 of file SOECPotential.h.
Referenced by SOECPotential::evaluateImpl(), SOECPotential::evaluateValueAndDerivatives(), and SOECPotential::SOECPotential().
|
private |
reference to the electrons
Definition at line 100 of file SOECPotential.h.
|
protected |
Definition at line 84 of file SOECPotential.h.
Referenced by SOECPotential::addComponent(), SOECPotential::evaluateImpl(), SOECPotential::evaluateValueAndDerivatives(), and SOECPotential::SOECPotential().
|
protected |
Definition at line 85 of file SOECPotential.h.
Referenced by SOECPotential::addComponent(), TestSOECPotential::copyGridUnrotatedForTest(), SOECPotential::createResource(), TestSOECPotential::didGridChange(), TestSOECPotential::evalFast(), SOECPotential::evaluateImpl(), SOECPotential::evaluateValueAndDerivatives(), SOECPotential::makeClone(), and SOECPotential::SOECPotential().
|
protected |
Definition at line 87 of file SOECPotential.h.
Referenced by SOECPotential::evaluateImpl(), SOECPotential::evaluateValueAndDerivatives(), and SOECPotential::mw_evaluateImpl().
Definition at line 106 of file SOECPotential.h.
Referenced by SOECPotential::mw_evaluateImpl(), and SOECPotential::SOECPotential().
|
private |
Definition at line 111 of file SOECPotential.h.
Referenced by SOECPotential::evaluateImpl(), and SOECPotential::makeClone().