![]() |
QMCPACK
|
A derived classe from DistacneTableData, specialized for AB using a transposed form. More...
Classes | |
struct | DTABMultiWalkerMem |
multi walker shared memory buffer More... | |
Public Member Functions | |
SoaDistanceTableABOMPTarget (const ParticleSet &source, ParticleSet &target) | |
SoaDistanceTableABOMPTarget ()=delete | |
SoaDistanceTableABOMPTarget (const SoaDistanceTableABOMPTarget &)=delete | |
~SoaDistanceTableABOMPTarget () | |
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... | |
const T * | getMultiWalkerDataPtr () const override |
return multi-walker full (all pairs) distance table data pointer More... | |
size_t | getPerTargetPctlStrideSize () const override |
return stride of per target pctl data. full table data = stride * num of target particles More... | |
void | evaluate (ParticleSet &P) override |
evaluate the full table More... | |
void | mw_evaluate (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list) const override |
void | mw_recompute (const RefVectorWithLeader< DistanceTable > &dt_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< bool > &recompute) const override |
recompute multi walker internal data, recompute More... | |
void | move (const ParticleSet &P, const PosType &rnew, const IndexType iat, bool prepare_old) override |
evaluate the temporary pair relations More... | |
void | update (IndexType iat) override |
update the stripe for jat-th particle More... | |
int | get_first_neighbor (IndexType iat, RealType &r, PosType &dr, bool newpos) 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) |
![]() | |
DistanceTableAB (const ParticleSet &source, 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... | |
![]() | |
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_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 | 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) |
Private Types | |
template<typename DT > | |
using | OffloadPinnedVector = Vector< DT, OMPallocator< DT, PinnedAlignedAllocator< DT > >> |
Private Member Functions | |
void | resize () |
Static Private Member Functions | |
static void | associateResource (const RefVectorWithLeader< DistanceTable > &dt_list) |
Private Attributes | |
OffloadPinnedVector< RealType > | r_dr_memorypool_ |
accelerator output buffer for r and dr More... | |
OffloadPinnedVector< T > | target_pos |
accelerator input array for a list of target particle positions, num_targets_ x D More... | |
ResourceHandle< DTABMultiWalkerMem > | mw_mem_handle_ |
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... | |
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 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 More... | |
DistRow | temp_r_ |
temp_r More... | |
DisplRow | temp_dr_ |
temp_dr 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 AB using a transposed form.
Definition at line 31 of file SoaDistanceTableABOMPTarget.h.
|
private |
Definition at line 35 of file SoaDistanceTableABOMPTarget.h.
|
inline |
Definition at line 121 of file SoaDistanceTableABOMPTarget.h.
References ParticleSet::getCoordinates(), DistanceTable::num_sources_, VectorSoaContainer< T, D, Alloc >::resize(), Vector< T, Alloc >::resize(), DistanceTableAB::temp_dr_, and DistanceTableAB::temp_r_.
|
delete |
|
delete |
|
inline |
Definition at line 145 of file SoaDistanceTableABOMPTarget.h.
|
inlineoverridevirtual |
acquire a shared resource from a collection
Reimplemented from DistanceTable.
Definition at line 152 of file SoaDistanceTableABOMPTarget.h.
References SoaDistanceTableABOMPTarget< T, D, SC >::associateResource(), RefVectorWithLeader< T >::getCastedLeader(), ResourceCollection::lendResource(), and SoaDistanceTableABOMPTarget< T, D, SC >::mw_mem_handle_.
|
inlinestaticprivate |
Definition at line 81 of file SoaDistanceTableABOMPTarget.h.
References RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), and DistanceTable::targets().
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::acquireResource().
|
inlineoverridevirtual |
initialize a shared resource and hand it to a collection
Reimplemented from DistanceTable.
Definition at line 147 of file SoaDistanceTableABOMPTarget.h.
References ResourceCollection::addResource().
|
inlineoverridevirtual |
evaluate the full table
Implements DistanceTable.
Definition at line 175 of file SoaDistanceTableABOMPTarget.h.
References VectorSoaContainer< T, D, Alloc >::data(), DistanceTableAB::displacements_, DistanceTableAB::distances_, SoaDistanceTableABOMPTarget< T, D, SC >::evaluate_timer_, DynamicCoordinates::getAllParticlePos(), ParticleSet::getCoordinates(), SoaDistanceTableABOMPTarget< T, D, SC >::getPerTargetPctlStrideSize(), omptarget::min(), DistanceTable::num_sources_, DistanceTable::num_targets_, SoaDistanceTableABOMPTarget< T, D, SC >::offload_timer_, DistanceTable::origin_, ParticleSet::R, SoaDistanceTableABOMPTarget< T, D, SC >::resize(), and SoaDistanceTableABOMPTarget< T, D, SC >::target_pos.
|
inlineoverride |
Definition at line 369 of file SoaDistanceTableABOMPTarget.h.
References DistanceTableAB::displacements_, DistanceTableAB::distances_, DistanceTable::num_sources_, DistanceTableAB::temp_dr_, and DistanceTableAB::temp_r_.
|
inlineoverridevirtual |
return multi-walker full (all pairs) distance table data pointer
Reimplemented from DistanceTableAB.
Definition at line 170 of file SoaDistanceTableABOMPTarget.h.
References SoaDistanceTableABOMPTarget< T, D, SC >::mw_mem_handle_.
|
inlineoverridevirtual |
return stride of per target pctl data. full table data = stride * num of target particles
Reimplemented from DistanceTableAB.
Definition at line 172 of file SoaDistanceTableABOMPTarget.h.
References DistanceTable::num_sources_.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::evaluate(), SoaDistanceTableABOMPTarget< T, D, SC >::mw_evaluate(), and SoaDistanceTableABOMPTarget< T, D, SC >::resize().
|
inlineoverridevirtual |
evaluate the temporary pair relations
Implements DistanceTable.
Definition at line 348 of file SoaDistanceTableABOMPTarget.h.
References Vector< T, Alloc >::data(), DistanceTableAB::displacements_, DistanceTableAB::distances_, DynamicCoordinates::getAllParticlePos(), ParticleSet::getCoordinates(), DistanceTable::modes_, SoaDistanceTableABOMPTarget< T, D, SC >::move_timer_, qmcplusplus::NEED_FULL_TABLE_ANYTIME, DistanceTable::num_sources_, DistanceTable::origin_, ParticleSet::R, DistanceTableAB::temp_dr_, and DistanceTableAB::temp_r_.
|
inlineoverridevirtual |
Reimplemented from DistanceTable.
Definition at line 227 of file SoaDistanceTableABOMPTarget.h.
References SoaDistanceTableABOMPTarget< T, D, SC >::evaluate_timer_, RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), RefVectorWithLeader< T >::getLeader(), SoaDistanceTableABOMPTarget< T, D, SC >::getPerTargetPctlStrideSize(), omptarget::min(), DistanceTable::modes_, qmcplusplus::MW_EVALUATE_RESULT_NO_TRANSFER_TO_HOST, SoaDistanceTableABOMPTarget< T, D, SC >::DTABMultiWalkerMem::mw_r_dr, DistanceTable::num_sources_, SoaDistanceTableABOMPTarget< T, D, SC >::DTABMultiWalkerMem::offload_input, and qmcplusplus::pset.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::mw_recompute().
|
inlineoverridevirtual |
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 from DistanceTable.
Definition at line 340 of file SoaDistanceTableABOMPTarget.h.
References SoaDistanceTableABOMPTarget< T, D, SC >::mw_evaluate().
|
inlineoverridevirtual |
return a shared resource to a collection
Reimplemented from DistanceTable.
Definition at line 159 of file SoaDistanceTableABOMPTarget.h.
References DistanceTableAB::distances_, RefVectorWithLeader< T >::getCastedElement(), RefVectorWithLeader< T >::getCastedLeader(), SoaDistanceTableABOMPTarget< T, D, SC >::mw_mem_handle_, and ResourceCollection::takebackResource().
|
inlineprivate |
Definition at line 59 of file SoaDistanceTableABOMPTarget.h.
References DistanceTableAB::displacements_, DistanceTableAB::distances_, SoaDistanceTableABOMPTarget< T, D, SC >::getPerTargetPctlStrideSize(), DistanceTable::num_sources_, DistanceTable::num_targets_, and SoaDistanceTableABOMPTarget< T, D, SC >::r_dr_memorypool_.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::evaluate().
|
inlineoverridevirtual |
update the stripe for jat-th particle
Implements DistanceTable.
Definition at line 361 of file SoaDistanceTableABOMPTarget.h.
References qmcplusplus::syclBLAS::copy_n(), Vector< T, Alloc >::data(), VectorSoaContainer< T, D, Alloc >::data(), DistanceTableAB::displacements_, DistanceTableAB::distances_, DistanceTable::num_sources_, DistanceTableAB::temp_dr_, DistanceTableAB::temp_r_, and SoaDistanceTableABOMPTarget< T, D, SC >::update_timer_.
|
private |
timer for evaluate()
Definition at line 409 of file SoaDistanceTableABOMPTarget.h.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::evaluate(), and SoaDistanceTableABOMPTarget< T, D, SC >::mw_evaluate().
|
private |
timer for move()
Definition at line 411 of file SoaDistanceTableABOMPTarget.h.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::move().
|
private |
Definition at line 57 of file SoaDistanceTableABOMPTarget.h.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::acquireResource(), SoaDistanceTableABOMPTarget< T, D, SC >::getMultiWalkerDataPtr(), and SoaDistanceTableABOMPTarget< T, D, SC >::releaseResource().
|
private |
timer for offload portion
Definition at line 407 of file SoaDistanceTableABOMPTarget.h.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::evaluate().
|
private |
accelerator output buffer for r and dr
Definition at line 38 of file SoaDistanceTableABOMPTarget.h.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::resize().
|
private |
accelerator input array for a list of target particle positions, num_targets_ x D
Definition at line 40 of file SoaDistanceTableABOMPTarget.h.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::evaluate().
|
private |
timer for update()
Definition at line 413 of file SoaDistanceTableABOMPTarget.h.
Referenced by SoaDistanceTableABOMPTarget< T, D, SC >::update().