![]() |
QMCPACK
|
Abstract class to manage operations on pair data between two ParticleSets. More...
Public Types | |
using | IndexType = QMCTraits::IndexType |
using | RealType = QMCTraits::RealType |
using | PosType = QMCTraits::PosType |
using | DistRow = Vector< RealType, aligned_allocator< RealType > > |
using | DisplRow = VectorSoaContainer< RealType, DIM > |
Public Member Functions | |
DistanceTable (const ParticleSet &source, const ParticleSet &target, DTModes modes) | |
constructor using source and target ParticleSet More... | |
DistanceTable (const DistanceTable &)=delete | |
copy constructor. deleted More... | |
virtual | ~DistanceTable ()=default |
virutal destructor More... | |
DTModes | getModes () const |
get modes More... | |
void | setModes (DTModes modes) |
set modes More... | |
const std::string & | getName () const |
return the name of table More... | |
const ParticleSet & | get_origin () const |
returns the reference the origin particleset More... | |
size_t | centers () const |
returns the number of centers More... | |
size_t | targets () const |
returns the number of centers More... | |
size_t | sources () const |
returns the number of source particles More... | |
virtual void | evaluate (ParticleSet &P)=0 |
evaluate the full Distance Table More... | |
virtual void | mw_evaluate (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list) const |
virtual void | mw_recompute (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< bool > &recompute) const |
recompute multi walker internal data, recompute More... | |
virtual void | move (const ParticleSet &P, const PosType &rnew, const IndexType iat, bool prepare_old=true)=0 |
evaluate the temporary pair relations when a move is proposed More... | |
virtual void | mw_move (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< PosType > &rnew_list, const IndexType iat, bool prepare_old=true) const |
walker batched version of move. More... | |
virtual void | update (IndexType jat)=0 |
update the distance table by the pair relations from the temporal position. More... | |
virtual void | updatePartial (IndexType jat, bool from_temp) |
fill partially the distance table by the pair relations from the temporary or old particle position. More... | |
virtual void | mw_updatePartial (const RefVectorWithLeader< DistanceTable > &dt_list, IndexType jat, const std::vector< bool > &from_temp) |
walker batched version of updatePartial. More... | |
virtual void | finalizePbyP (const ParticleSet &P) |
finalize distance table calculation after particle-by-particle moves if update() doesn't make the table up-to-date during p-by-p moves finalizePbyP takes action to bring the table up-to-date More... | |
virtual void | mw_finalizePbyP (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list) const |
walker batched version of finalizePbyP If not DTModes::NEED_TEMP_DATA_ON_HOST, host distance table data is not updated at all during p-by-p Thus, a recompute is necessary to update the whole host distance table for consumers like the Coulomb potential. More... | |
virtual int | get_first_neighbor (IndexType iat, RealType &r, PosType &dr, bool newpos) const =0 |
find the first nearest neighbor More... | |
void | print (std::ostream &os) |
virtual void | createResource (ResourceCollection &collection) const |
initialize a shared resource and hand it to a collection More... | |
virtual void | acquireResource (ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const |
acquire a shared resource from a collection More... | |
virtual void | releaseResource (ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const |
return a shared resource to a collection More... | |
Static Public Attributes | |
static constexpr unsigned | DIM = OHMMS_DIM |
Protected Attributes | |
const ParticleSet & | origin_ |
const size_t | num_sources_ |
const size_t | num_targets_ |
const std::string | name_ |
name of the table More... | |
DTModes | modes_ |
operation modes defined by DTModes More... | |
Abstract class to manage operations on pair data between two ParticleSets.
Each DistanceTable object is defined by Source and Target of ParticleSet types. This base class doesn't contain storage. It is intended for update/compute invoked by ParticleSet. Derived AA/AB classes handle the actual storage and data access.
Definition at line 38 of file DistanceTable.h.
using DisplRow = VectorSoaContainer<RealType, DIM> |
Definition at line 47 of file DistanceTable.h.
using DistRow = Vector<RealType, aligned_allocator<RealType> > |
Definition at line 46 of file DistanceTable.h.
using IndexType = QMCTraits::IndexType |
Definition at line 43 of file DistanceTable.h.
using PosType = QMCTraits::PosType |
Definition at line 45 of file DistanceTable.h.
using RealType = QMCTraits::RealType |
Definition at line 44 of file DistanceTable.h.
|
inline |
constructor using source and target ParticleSet
Definition at line 64 of file DistanceTable.h.
|
delete |
copy constructor. deleted
|
virtualdefault |
virutal destructor
|
inlinevirtual |
acquire a shared resource from a collection
Reimplemented in SoaDistanceTableABOMPTarget< T, D, SC >, and SoaDistanceTableAAOMPTarget< T, D, SC >.
Definition at line 214 of file DistanceTable.h.
|
inline |
returns the number of centers
Definition at line 91 of file DistanceTable.h.
References ParticleSet::getTotalNum(), and DistanceTable::origin_.
|
inlinevirtual |
initialize a shared resource and hand it to a collection
Reimplemented in SoaDistanceTableABOMPTarget< T, D, SC >, and SoaDistanceTableAAOMPTarget< T, D, SC >.
Definition at line 211 of file DistanceTable.h.
|
pure virtual |
evaluate the full Distance Table
P | the target particle set |
Implemented in SoaDistanceTableABOMPTarget< T, D, SC >, SoaDistanceTableAAOMPTarget< T, D, SC >, SoaDistanceTableAA< T, D, SC >, and SoaDistanceTableAB< T, D, SC >.
Referenced by DistanceTable::mw_evaluate().
|
inlinevirtual |
finalize distance table calculation after particle-by-particle moves if update() doesn't make the table up-to-date during p-by-p moves finalizePbyP takes action to bring the table up-to-date
Definition at line 182 of file DistanceTable.h.
Referenced by DistanceTable::mw_finalizePbyP().
|
pure virtual |
find the first nearest neighbor
iat | source particle id |
r | distance |
dr | displacement |
newpos | if true, use the data in temp_r_ and temp_dr_ for the proposed move. if false, use the data in distance_[iat] and displacements_[iat] |
Implemented in SoaDistanceTableAB< T, D, SC >.
Referenced by HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluate_v(), HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluate_vgh(), and HybridRepCenterOrbitals< SPLINEBASE::DataType >::evaluate_vgl().
|
inline |
returns the reference the origin particleset
Definition at line 88 of file DistanceTable.h.
References DistanceTable::origin_.
|
inline |
get modes
Definition at line 79 of file DistanceTable.h.
References DistanceTable::modes_.
|
inline |
return the name of table
Definition at line 85 of file DistanceTable.h.
References DistanceTable::name_.
|
pure virtual |
evaluate the temporary pair relations when a move is proposed
P | the target particle set |
rnew | proposed new position |
iat | the particle to be moved |
prepare_old | if true, prepare (temporary) old distances and displacements for using getOldDists and getOldDispls functions in acceptMove. |
Note: some distance table consumers (WaveFunctionComponent) have optimized code paths which require prepare_old = true for accepting a move. Drivers/Hamiltonians know whether moves will be accepted or not and manage this flag when calling ParticleSet::makeMoveXXX functions.
Implemented in SoaDistanceTableABOMPTarget< T, D, SC >, SoaDistanceTableAAOMPTarget< T, D, SC >, SoaDistanceTableAA< T, D, SC >, and SoaDistanceTableAB< T, D, SC >.
Referenced by DistanceTable::mw_move().
|
inlinevirtual |
Reimplemented in SoaDistanceTableABOMPTarget< T, D, SC >.
Definition at line 103 of file DistanceTable.h.
References DistanceTable::evaluate().
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::mw_finalizePbyP().
|
inlinevirtual |
walker batched version of finalizePbyP If not DTModes::NEED_TEMP_DATA_ON_HOST, host distance table data is not updated at all during p-by-p Thus, a recompute is necessary to update the whole host distance table for consumers like the Coulomb potential.
Reimplemented in SoaDistanceTableAAOMPTarget< T, D, SC >.
Definition at line 188 of file DistanceTable.h.
References DistanceTable::finalizePbyP().
|
inlinevirtual |
walker batched version of move.
this function may be implemented asynchronously. Additional synchroniziation for collecting results should be handled by the caller. If DTModes::NEED_TEMP_DATA_ON_HOST, host data will be updated. If no consumer requests data on the host, the transfer is skipped.
Reimplemented in SoaDistanceTableAAOMPTarget< T, D, SC >.
Definition at line 140 of file DistanceTable.h.
References DistanceTable::move().
|
inlinevirtual |
recompute multi walker internal data, recompute
dt_list | the distance table batch |
p_list | the target particle set batch |
recompute | if true, must recompute. Otherwise, implementation dependent. |
Reimplemented in SoaDistanceTableABOMPTarget< T, D, SC >.
Definition at line 115 of file DistanceTable.h.
|
inlinevirtual |
walker batched version of updatePartial.
If not DTModes::NEED_TEMP_DATA_ON_HOST, host data is not up-to-date and host distance table will not be updated.
Reimplemented in SoaDistanceTableAAOMPTarget< T, D, SC >.
Definition at line 170 of file DistanceTable.h.
References DistanceTable::updatePartial().
|
inline |
Definition at line 205 of file DistanceTable.h.
|
inlinevirtual |
return a shared resource to a collection
Reimplemented in SoaDistanceTableABOMPTarget< T, D, SC >, and SoaDistanceTableAAOMPTarget< T, D, SC >.
Definition at line 218 of file DistanceTable.h.
|
inline |
set modes
Definition at line 82 of file DistanceTable.h.
References DistanceTable::modes_.
|
inline |
returns the number of source particles
Definition at line 97 of file DistanceTable.h.
References DistanceTable::num_sources_.
Referenced by Backflow_eI< FT >::evaluatePbyP().
|
inline |
returns the number of centers
Definition at line 94 of file DistanceTable.h.
References DistanceTable::num_targets_.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::associateResource(), CoulombPotential< T >::evaluate_spAB(), and CoulombPotential< T >::evaluateAB().
|
pure virtual |
update the distance table by the pair relations from the temporal position.
Used when a move is accepted in regular mode
iat | the particle with an accepted move |
Implemented in SoaDistanceTableAAOMPTarget< T, D, SC >, SoaDistanceTableABOMPTarget< T, D, SC >, SoaDistanceTableAA< T, D, SC >, and SoaDistanceTableAB< T, D, SC >.
Referenced by DistanceTable::updatePartial().
|
inlinevirtual |
fill partially the distance table by the pair relations from the temporary or old particle position.
Used in forward mode when a move is reject
iat | the particle with an accepted move |
from_temp | if true, copy from temp. if false, copy from old |
Reimplemented in SoaDistanceTableAAOMPTarget< T, D, SC >, and SoaDistanceTableAA< T, D, SC >.
Definition at line 161 of file DistanceTable.h.
References DistanceTable::update().
Referenced by DistanceTable::mw_updatePartial().
|
static |
Definition at line 41 of file DistanceTable.h.
|
protected |
operation modes defined by DTModes
Definition at line 60 of file DistanceTable.h.
Referenced by DistanceTable::getModes(), SoaDistanceTableAB< T, D, SC >::move(), SoaDistanceTableABOMPTarget< T, D, SC >::move(), SoaDistanceTableABOMPTarget< T, D, SC >::mw_evaluate(), SoaDistanceTableAAOMPTarget< T, D, SC >::mw_finalizePbyP(), SoaDistanceTableAAOMPTarget< T, D, SC >::mw_move(), SoaDistanceTableAAOMPTarget< T, D, SC >::mw_updatePartial(), and DistanceTable::setModes().
|
protected |
name of the table
Definition at line 57 of file DistanceTable.h.
Referenced by DistanceTableAB::getMultiWalkerDataPtr(), DistanceTableAA::getMultiWalkerTempDataPtr(), DistanceTable::getName(), and DistanceTableAB::getPerTargetPctlStrideSize().
|
protected |
Definition at line 53 of file DistanceTable.h.
Referenced by SoaDistanceTableAB< T, D, SC >::evaluate(), SoaDistanceTableABOMPTarget< T, D, SC >::evaluate(), SoaDistanceTableAB< T, D, SC >::get_first_neighbor(), SoaDistanceTableABOMPTarget< T, D, SC >::get_first_neighbor(), SoaDistanceTableABOMPTarget< T, D, SC >::getPerTargetPctlStrideSize(), SoaDistanceTableAB< T, D, SC >::move(), SoaDistanceTableABOMPTarget< T, D, SC >::move(), SoaDistanceTableABOMPTarget< T, D, SC >::mw_evaluate(), SoaDistanceTableAB< T, D, SC >::resize(), SoaDistanceTableABOMPTarget< T, D, SC >::resize(), SoaDistanceTableABOMPTarget< T, D, SC >::SoaDistanceTableABOMPTarget(), DistanceTable::sources(), SoaDistanceTableAB< T, D, SC >::update(), and SoaDistanceTableABOMPTarget< T, D, SC >::update().
|
protected |
Definition at line 54 of file DistanceTable.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::acquireResource(), SoaDistanceTableAB< T, D, SC >::evaluate(), SoaDistanceTableAA< T, D, SC >::evaluate(), SoaDistanceTableAAOMPTarget< T, D, SC >::evaluate(), SoaDistanceTableABOMPTarget< T, D, SC >::evaluate(), SoaDistanceTableAA< T, D, SC >::get_first_neighbor(), SoaDistanceTableAAOMPTarget< T, D, SC >::get_first_neighbor(), SoaDistanceTableAA< T, D, SC >::move(), SoaDistanceTableAAOMPTarget< T, D, SC >::move(), SoaDistanceTableAAOMPTarget< T, D, SC >::mw_move(), SoaDistanceTableAB< T, D, SC >::resize(), SoaDistanceTableAA< T, D, SC >::resize(), SoaDistanceTableABOMPTarget< T, D, SC >::resize(), SoaDistanceTableAAOMPTarget< T, D, SC >::resize(), DistanceTable::targets(), SoaDistanceTableAA< T, D, SC >::update(), and SoaDistanceTableAAOMPTarget< T, D, SC >::update().
|
protected |
Definition at line 51 of file DistanceTable.h.
Referenced by DistanceTable::centers(), SoaDistanceTableAB< T, D, SC >::evaluate(), SoaDistanceTableABOMPTarget< T, D, SC >::evaluate(), DistanceTable::get_origin(), SoaDistanceTableAB< T, D, SC >::move(), and SoaDistanceTableABOMPTarget< T, D, SC >::move().