![]() |
QMCPACK
|
A derived classe from DistacneTableData, specialized for dense case. More...
Classes | |
struct | DTAAMultiWalkerMem |
multi walker shared memory buffer More... | |
Public Member Functions | |
SoaDistanceTableAAOMPTarget (ParticleSet &target) | |
SoaDistanceTableAAOMPTarget ()=delete | |
SoaDistanceTableAAOMPTarget (const SoaDistanceTableAAOMPTarget &)=delete | |
~SoaDistanceTableAAOMPTarget () | |
size_t | compute_size (int N) const |
void | resize () |
const RealType * | getMultiWalkerTempDataPtr () const override |
return multi walker temporary pair distance table data pointer More... | |
void | createResource (ResourceCollection &collection) const override |
initialize a shared resource and hand it to a collection More... | |
void | acquireResource (ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const override |
acquire a shared resource from a collection More... | |
void | releaseResource (ResourceCollection &collection, const RefVectorWithLeader< DistanceTable > &dt_list) const override |
return a shared resource to a collection More... | |
void | evaluate (ParticleSet &P) override |
evaluate the full Distance Table More... | |
const RealType * | mw_evalDistsInRange (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, size_t range_begin, size_t range_end) const override |
compute distances from particles in [range_begin, range_end) to all the particles. More... | |
void | move (const ParticleSet &P, const PosType &rnew, const IndexType iat, bool prepare_old) override |
evaluate the temporary pair relations More... | |
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 override |
evaluate the temporary pair relations when a move is proposed this implementation is asynchronous and the synchronization is managed at ParticleSet. More... | |
int | get_first_neighbor (IndexType iat, RealType &r, PosType &dr, bool newpos) const override |
void | update (IndexType iat) override |
After accepting the iat-th particle, update the iat-th row of distances_ and displacements_. More... | |
void | updatePartial (IndexType jat, bool from_temp) override |
fill partially the distance table by the pair relations from the temporary or old particle position. More... | |
void | mw_updatePartial (const RefVectorWithLeader< DistanceTable > &dt_list, IndexType jat, const std::vector< bool > &from_temp) override |
walker batched version of updatePartial. More... | |
void | mw_finalizePbyP (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list) const override |
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... | |
size_t | get_num_particls_stored () const override |
![]() | |
DTD_BConds (const CrystalLattice< T, D > &lat) | |
constructor: doing nothing More... | |
T | apply_bc (TinyVector< T, D > &displ) const |
apply BC on displ and return |displ|^2 More... | |
void | apply_bc (std::vector< TinyVector< T, D >> &dr, std::vector< T > &r, std::vector< T > &rinv) const |
apply BC on dr and evaluate r and rinv More... | |
void | apply_bc (std::vector< TinyVector< T, D >> &dr, std::vector< T > &r) const |
void | evaluate_rsquared (TinyVector< T, D > *restrict dr, T *restrict rr, int n) |
![]() | |
DistanceTableAA (const ParticleSet &target, DTModes modes) | |
constructor using source and target ParticleSet More... | |
const std::vector< DistRow > & | getDistances () const |
return full table distances More... | |
const std::vector< DisplRow > & | getDisplacements () const |
return full table displacements More... | |
const DistRow & | getDistRow (int iel) const |
return a row of distances for a given target particle More... | |
const DisplRow & | getDisplRow (int iel) const |
return a row of displacements for a given target particle More... | |
const DistRow & | getTempDists () const |
return the temporary distances when a move is proposed More... | |
const DisplRow & | getTempDispls () const |
return the temporary displacements when a move is proposed More... | |
const DistRow & | getOldDists () const |
return old distances set up by move() for optimized distance table consumers More... | |
const DisplRow & | getOldDispls () const |
return old displacements set up by move() for optimized distance table consumers More... | |
![]() | |
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 | 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 | 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 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) |
Public Attributes | |
aligned_vector< RealType > | memory_pool_ |
actual memory for dist and displacements_ More... | |
DistRow | temp_r_mem_ |
actual memory for temp_r_ More... | |
DisplRow | temp_dr_mem_ |
actual memory for temp_dr_ More... | |
DistRow | old_r_mem_ |
actual memory for old_r_ More... | |
DisplRow | old_dr_mem_ |
actual memory for old_dr_ More... | |
ResourceHandle< DTAAMultiWalkerMem > | mw_mem_handle_ |
Private Attributes | |
const size_t | num_targets_padded_ |
number of targets with padding More... | |
int | old_prepared_elec_id_ |
set to particle id after move() with prepare_old = true. More... | |
NewTimer & | offload_timer_ |
timer for offload portion More... | |
NewTimer & | evaluate_timer_ |
timer for evaluate() More... | |
NewTimer & | move_timer_ |
timer for move() More... | |
NewTimer & | update_timer_ |
timer for update() More... | |
const size_t | num_particls_stored = 64 |
the particle count of the internal stored distances. More... | |
Additional Inherited Members | |
![]() | |
using | IndexType = QMCTraits::IndexType |
using | RealType = QMCTraits::RealType |
using | PosType = QMCTraits::PosType |
using | DistRow = Vector< RealType, aligned_allocator< RealType > > |
using | DisplRow = VectorSoaContainer< RealType, DIM > |
![]() | |
static constexpr unsigned | DIM = OHMMS_DIM |
![]() | |
std::vector< DistRow > | distances_ |
distances_[num_targets_][num_sources_], [i][3][j] = |r_A2[j] - r_A1[i]| Note: Derived classes decide if it is a memory view or the actual storage For only the lower triangle (j<i) data can be accessed safely. More... | |
std::vector< DisplRow > | displacements_ |
displacements_[num_targets_][3][num_sources_], [i][3][j] = r_A2[j] - r_A1[i] Note: Derived classes decide if it is a memory view or the actual storage only the lower triangle (j<i) is defined. More... | |
DistRow | temp_r_ |
temp_r More... | |
DisplRow | temp_dr_ |
temp_dr More... | |
DistRow | old_r_ |
old distances More... | |
DisplRow | old_dr_ |
old displacements More... | |
![]() | |
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... | |
A derived classe from DistacneTableData, specialized for dense case.
Definition at line 31 of file SoaDistanceTableAAOMPTarget.h.
|
inline |
Definition at line 67 of file SoaDistanceTableAAOMPTarget.h.
References ParticleSet::getCoordinates(), and SoaDistanceTableAAOMPTarget< T, D, SC >::resize().
|
delete |
|
delete |
|
inline |
Definition at line 89 of file SoaDistanceTableAAOMPTarget.h.
|
inlineoverridevirtual |
acquire a shared resource from a collection
Reimplemented from DistanceTable.
Definition at line 127 of file SoaDistanceTableAAOMPTarget.h.
References Vector< T, Alloc >::attachReference(), Vector< T, Alloc >::free(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), ResourceCollection::lendResource(), SoaDistanceTableAAOMPTarget< T, D, SC >::mw_mem_handle_, DistanceTable::num_targets_, SoaDistanceTableAAOMPTarget< T, D, SC >::num_targets_padded_, and DistanceTableAA::temp_r_.
|
inline |
Definition at line 91 of file SoaDistanceTableAAOMPTarget.h.
References qmcplusplus::Units::force::N.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::resize().
|
inlineoverridevirtual |
initialize a shared resource and hand it to a collection
Reimplemented from DistanceTable.
Definition at line 122 of file SoaDistanceTableAAOMPTarget.h.
References ResourceCollection::addResource().
|
inlineoverridevirtual |
evaluate the full Distance Table
P | the target particle set |
Implements DistanceTable.
Definition at line 172 of file SoaDistanceTableAAOMPTarget.h.
References DistanceTableAA::displacements_, DistanceTableAA::distances_, SoaDistanceTableAAOMPTarget< T, D, SC >::evaluate_timer_, DynamicCoordinates::getAllParticlePos(), ParticleSet::getCoordinates(), DistanceTable::num_targets_, and ParticleSet::R.
|
inlineoverride |
Definition at line 376 of file SoaDistanceTableAAOMPTarget.h.
References DistanceTableAA::displacements_, DistanceTableAA::distances_, DistanceTable::num_targets_, DistanceTableAA::temp_dr_, and DistanceTableAA::temp_r_.
|
inlineoverridevirtual |
Reimplemented from DistanceTableAA.
Definition at line 484 of file SoaDistanceTableAAOMPTarget.h.
References SoaDistanceTableAAOMPTarget< T, D, SC >::num_particls_stored.
|
inlineoverridevirtual |
return multi walker temporary pair distance table data pointer
Reimplemented from DistanceTableAA.
Definition at line 117 of file SoaDistanceTableAAOMPTarget.h.
References SoaDistanceTableAAOMPTarget< T, D, SC >::mw_mem_handle_.
|
inlineoverridevirtual |
evaluate the temporary pair relations
Implements DistanceTable.
Definition at line 257 of file SoaDistanceTableAAOMPTarget.h.
References Vector< T, Alloc >::attachReference(), VectorSoaContainer< T, D, Alloc >::attachReference(), VectorSoaContainer< T, D, Alloc >::capacity(), Vector< T, Alloc >::data(), VectorSoaContainer< T, D, Alloc >::data(), DynamicCoordinates::getAllParticlePos(), ParticleSet::getCoordinates(), SoaDistanceTableAAOMPTarget< T, D, SC >::move_timer_, DistanceTable::num_targets_, DistanceTableAA::old_dr_, SoaDistanceTableAAOMPTarget< T, D, SC >::old_dr_mem_, SoaDistanceTableAAOMPTarget< T, D, SC >::old_prepared_elec_id_, DistanceTableAA::old_r_, SoaDistanceTableAAOMPTarget< T, D, SC >::old_r_mem_, ParticleSet::R, Vector< T, Alloc >::size(), VectorSoaContainer< T, D, Alloc >::size(), DistanceTableAA::temp_dr_, SoaDistanceTableAAOMPTarget< T, D, SC >::temp_dr_mem_, DistanceTableAA::temp_r_, and SoaDistanceTableAAOMPTarget< T, D, SC >::temp_r_mem_.
|
inlineoverridevirtual |
compute distances from particles in [range_begin, range_end) to all the particles.
Although [range_begin, range_end) and be any particle [0, num_sources), it is only necessary to compute half of the table due to the symmetry of AA table. See note of the output data object mw_distances_subset To keep resident memory minimal on the device, range_end - range_begin < num_particls_stored is required.
Reimplemented from DistanceTableAA.
Definition at line 187 of file SoaDistanceTableAAOMPTarget.h.
References RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), RealSpacePositionsOMPTarget::getMultiWalkerRSoADevicePtrs(), omptarget::min(), and SoaDistanceTableAAOMPTarget< T, D, SC >::DTAAMultiWalkerMem::mw_distances_subset.
|
inlineoverridevirtual |
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 from DistanceTable.
Definition at line 475 of file SoaDistanceTableAAOMPTarget.h.
References DistanceTable::modes_, DistanceTable::mw_evaluate(), qmcplusplus::NEED_FULL_TABLE_ON_HOST_AFTER_DONEPBYP, and qmcplusplus::NEED_TEMP_DATA_ON_HOST.
|
inlineoverridevirtual |
evaluate the temporary pair relations when a move is proposed this implementation is asynchronous and the synchronization is managed at ParticleSet.
Transferring results to host depends on DTModes::NEED_TEMP_DATA_ON_HOST. If the temporary pair distance are consumed on the device directly, the device to host data transfer can be skipped as an optimization.
Reimplemented from DistanceTable.
Definition at line 288 of file SoaDistanceTableAAOMPTarget.h.
References RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), omptarget::min(), DistanceTable::modes_, SoaDistanceTableAAOMPTarget< T, D, SC >::move_timer_, qmcplusplus::NEED_TEMP_DATA_ON_HOST, DistanceTable::num_targets_, SoaDistanceTableAAOMPTarget< T, D, SC >::num_targets_padded_, SoaDistanceTableAAOMPTarget< T, D, SC >::offload_timer_, and SoaDistanceTableAAOMPTarget< T, D, SC >::old_prepared_elec_id_.
|
inlineoverridevirtual |
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 from DistanceTable.
Definition at line 463 of file SoaDistanceTableAAOMPTarget.h.
References DistanceTable::modes_, qmcplusplus::NEED_TEMP_DATA_ON_HOST, and SoaDistanceTableAAOMPTarget< T, D, SC >::updatePartial().
|
inlineoverridevirtual |
return a shared resource to a collection
Reimplemented from DistanceTable.
Definition at line 158 of file SoaDistanceTableAAOMPTarget.h.
References Vector< T, Alloc >::free(), RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), SoaDistanceTableAAOMPTarget< T, D, SC >::mw_mem_handle_, ResourceCollection::takebackResource(), and DistanceTableAA::temp_r_.
|
inline |
Definition at line 98 of file SoaDistanceTableAAOMPTarget.h.
References SoaDistanceTableAAOMPTarget< T, D, SC >::compute_size(), DistanceTableAA::displacements_, DistanceTableAA::distances_, SoaDistanceTableAAOMPTarget< T, D, SC >::memory_pool_, DistanceTable::num_targets_, SoaDistanceTableAAOMPTarget< T, D, SC >::old_dr_mem_, SoaDistanceTableAAOMPTarget< T, D, SC >::old_r_mem_, VectorSoaContainer< T, D, Alloc >::resize(), Vector< T, Alloc >::resize(), SoaDistanceTableAAOMPTarget< T, D, SC >::temp_dr_mem_, and SoaDistanceTableAAOMPTarget< T, D, SC >::temp_r_mem_.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::SoaDistanceTableAAOMPTarget().
|
inlineoverridevirtual |
After accepting the iat-th particle, update the iat-th row of distances_ and displacements_.
Upper triangle is not needed in the later computation and thus not updated
Implements DistanceTable.
Definition at line 420 of file SoaDistanceTableAAOMPTarget.h.
References qmcplusplus::syclBLAS::copy_n(), Vector< T, Alloc >::data(), VectorSoaContainer< T, D, Alloc >::data(), DistanceTableAA::displacements_, DistanceTableAA::distances_, DistanceTable::num_targets_, Vector< T, Alloc >::size(), DistanceTableAA::temp_dr_, DistanceTableAA::temp_r_, and SoaDistanceTableAAOMPTarget< T, D, SC >::update_timer_.
|
inlineoverridevirtual |
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 from DistanceTable.
Definition at line 438 of file SoaDistanceTableAAOMPTarget.h.
References qmcplusplus::syclBLAS::copy_n(), Vector< T, Alloc >::data(), VectorSoaContainer< T, D, Alloc >::data(), DistanceTableAA::displacements_, DistanceTableAA::distances_, DistanceTableAA::old_dr_, SoaDistanceTableAAOMPTarget< T, D, SC >::old_prepared_elec_id_, DistanceTableAA::old_r_, Vector< T, Alloc >::size(), DistanceTableAA::temp_dr_, DistanceTableAA::temp_r_, and SoaDistanceTableAAOMPTarget< T, D, SC >::update_timer_.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::mw_updatePartial().
|
private |
timer for evaluate()
Definition at line 498 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::evaluate().
aligned_vector<RealType> memory_pool_ |
actual memory for dist and displacements_
Definition at line 34 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::resize().
|
private |
timer for move()
Definition at line 500 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::move(), and SoaDistanceTableAAOMPTarget< T, D, SC >::mw_move().
ResourceHandle<DTAAMultiWalkerMem> mw_mem_handle_ |
|
private |
the particle count of the internal stored distances.
Definition at line 504 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::get_num_particls_stored().
|
private |
number of targets with padding
Definition at line 488 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::acquireResource(), and SoaDistanceTableAAOMPTarget< T, D, SC >::mw_move().
|
private |
timer for offload portion
Definition at line 496 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::mw_move().
DisplRow old_dr_mem_ |
actual memory for old_dr_
Definition at line 43 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::move(), and SoaDistanceTableAAOMPTarget< T, D, SC >::resize().
|
private |
set to particle id after move() with prepare_old = true.
-1 means not prepared. It is intended only for safety checks, not for codepath selection.
Definition at line 493 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::move(), SoaDistanceTableAAOMPTarget< T, D, SC >::mw_move(), and SoaDistanceTableAAOMPTarget< T, D, SC >::updatePartial().
DistRow old_r_mem_ |
actual memory for old_r_
Definition at line 41 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::move(), and SoaDistanceTableAAOMPTarget< T, D, SC >::resize().
DisplRow temp_dr_mem_ |
actual memory for temp_dr_
Definition at line 39 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::move(), and SoaDistanceTableAAOMPTarget< T, D, SC >::resize().
DistRow temp_r_mem_ |
actual memory for temp_r_
Definition at line 37 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::move(), and SoaDistanceTableAAOMPTarget< T, D, SC >::resize().
|
private |
timer for update()
Definition at line 502 of file SoaDistanceTableAAOMPTarget.h.
Referenced by SoaDistanceTableAAOMPTarget< T, D, SC >::update(), and SoaDistanceTableAAOMPTarget< T, D, SC >::updatePartial().