Skip to content

Commit effac82

Browse files
committed
Rename classes as well.
1 parent 52943b6 commit effac82

16 files changed

+245
-242
lines changed

src/Particle/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ SET(PARTICLE
3636

3737
IF(ENABLE_OFFLOAD)
3838
SET(PARTICLE ${PARTICLE}
39-
createDistanceTableABOMP.cpp
39+
createDistanceTableABOMPTarget.cpp
4040
)
4141
ENDIF(ENABLE_OFFLOAD)
4242

src/Particle/DynamicCoordinatesBuilder.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "DynamicCoordinatesBuilder.h"
1414
#include "Particle/RealSpacePositions.h"
15-
#include "Particle/RealSpacePositionsOMP.h"
15+
#include "Particle/RealSpacePositionsOMPTarget.h"
1616

1717
namespace qmcplusplus
1818
{
@@ -24,7 +24,7 @@ std::unique_ptr<DynamicCoordinates> createDynamicCoordinates(const DynamicCoordi
2424
return std::make_unique<RealSpacePositions>();
2525
#if defined(ENABLE_OFFLOAD)
2626
else if (kind == DynamicCoordinateKind::DC_POS_OFFLOAD)
27-
return std::make_unique<RealSpacePositionsOMP>();
27+
return std::make_unique<RealSpacePositionsOMPTarget>();
2828
#endif
2929
else
3030
APP_ABORT("DynamicCoordinatesBuilder::createDynamicCoordinates unknown DynamicCoordinateKind");

src/Particle/RealSpacePositionsOMP.h src/Particle/RealSpacePositionsOMPTarget.h

+10-7
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
//////////////////////////////////////////////////////////////////////////////////////
1111

1212

13-
/** @file RealSpacePostionsOMP.h
13+
/** @file RealSpacePostionsOMPTarget.h
1414
*/
15-
#ifndef QMCPLUSPLUS_REALSPACE_POSITIONS_OMP_H
16-
#define QMCPLUSPLUS_REALSPACE_POSITIONS_OMP_H
15+
#ifndef QMCPLUSPLUS_REALSPACE_POSITIONS_OMPTARGET_H
16+
#define QMCPLUSPLUS_REALSPACE_POSITIONS_OMPTARGET_H
1717

1818
#include "Particle/DynamicCoordinates.h"
1919
#include "OhmmsSoA/VectorSoaContainer.h"
@@ -24,11 +24,11 @@ namespace qmcplusplus
2424
{
2525
/** Introduced to handle virtual moves and ratio computations, e.g. for non-local PP evaluations.
2626
*/
27-
class RealSpacePositionsOMP : public DynamicCoordinates
27+
class RealSpacePositionsOMPTarget : public DynamicCoordinates
2828
{
2929
public:
30-
RealSpacePositionsOMP() : DynamicCoordinates(DynamicCoordinateKind::DC_POS_OFFLOAD), RSoA_device_ptr(nullptr) {}
31-
RealSpacePositionsOMP(const RealSpacePositionsOMP& in)
30+
RealSpacePositionsOMPTarget() : DynamicCoordinates(DynamicCoordinateKind::DC_POS_OFFLOAD), RSoA_device_ptr(nullptr) {}
31+
RealSpacePositionsOMPTarget(const RealSpacePositionsOMPTarget& in)
3232
: DynamicCoordinates(DynamicCoordinateKind::DC_POS_OFFLOAD), RSoA(in.RSoA)
3333
{
3434
RSoA_hostview.attachReference(RSoA.size(), RSoA.capacity(), RSoA.data());
@@ -37,7 +37,10 @@ class RealSpacePositionsOMP : public DynamicCoordinates
3737
updateH2D();
3838
}
3939

40-
std::unique_ptr<DynamicCoordinates> makeClone() override { return std::make_unique<RealSpacePositionsOMP>(*this); }
40+
std::unique_ptr<DynamicCoordinates> makeClone() override
41+
{
42+
return std::make_unique<RealSpacePositionsOMPTarget>(*this);
43+
}
4144

4245
void resize(size_t n) override
4346
{

src/Particle/SoaDistanceTableABOMP.h src/Particle/SoaDistanceTableABOMPTarget.h

+20-20
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
// File created by: Jeongnim Kim, [email protected], Intel Corp.
1111
//////////////////////////////////////////////////////////////////////////////////////
1212
// -*- C++ -*-
13-
#ifndef QMCPLUSPLUS_DTDIMPL_AB_OMP_H
14-
#define QMCPLUSPLUS_DTDIMPL_AB_OMP_H
13+
#ifndef QMCPLUSPLUS_DTDIMPL_AB_OMPTARGET_H
14+
#define QMCPLUSPLUS_DTDIMPL_AB_OMPTARGET_H
1515

1616
#include "OMPTarget/OMPallocator.hpp"
1717
#include "Platforms/PinnedAllocator.h"
18-
#include "Particle/RealSpacePositionsOMP.h"
18+
#include "Particle/RealSpacePositionsOMPTarget.h"
1919

2020
namespace qmcplusplus
2121
{
2222
/**@ingroup nnlist
2323
* @brief A derived classe from DistacneTableData, specialized for AB using a transposed form
2424
*/
2525
template<typename T, unsigned D, int SC>
26-
class SoaDistanceTableABOMP : public DTD_BConds<T, D, SC>, public DistanceTableData
26+
class SoaDistanceTableABOMPTarget : public DTD_BConds<T, D, SC>, public DistanceTableData
2727
{
2828
private:
2929
template<typename DT>
@@ -49,15 +49,15 @@ class SoaDistanceTableABOMP : public DTD_BConds<T, D, SC>, public DistanceTableD
4949
NewTimer& eval_timer_;
5050

5151
public:
52-
SoaDistanceTableABOMP(const ParticleSet& source, ParticleSet& target)
52+
SoaDistanceTableABOMPTarget(const ParticleSet& source, ParticleSet& target)
5353
: DTD_BConds<T, D, SC>(source.Lattice),
5454
DistanceTableData(source, target),
5555
r_dr_device_ptr_(nullptr),
56-
offload_timer_(*timer_manager.createTimer(std::string("SoaDistanceTableABOMP::offload_") + target.getName() + "_" + source.getName(), timer_level_fine)),
57-
copy_timer_(*timer_manager.createTimer(std::string("SoaDistanceTableABOMP::copy_") + target.getName() + "_" + source.getName(), timer_level_fine)),
58-
eval_timer_(*timer_manager.createTimer(std::string("SoaDistanceTableABOMP::evaluate_") + target.getName() + "_" + source.getName(), timer_level_fine))
56+
offload_timer_(*timer_manager.createTimer(std::string("SoaDistanceTableABOMPTarget::offload_") + target.getName() + "_" + source.getName(), timer_level_fine)),
57+
copy_timer_(*timer_manager.createTimer(std::string("SoaDistanceTableABOMPTarget::copy_") + target.getName() + "_" + source.getName(), timer_level_fine)),
58+
eval_timer_(*timer_manager.createTimer(std::string("SoaDistanceTableABOMPTarget::evaluate_") + target.getName() + "_" + source.getName(), timer_level_fine))
5959
{
60-
auto* coordinates_soa = dynamic_cast<const RealSpacePositionsOMP*>(&source.getCoordinates());
60+
auto* coordinates_soa = dynamic_cast<const RealSpacePositionsOMPTarget*>(&source.getCoordinates());
6161
if (!coordinates_soa) throw std::runtime_error("Source particle set doesn't have OpenMP offload. Contact developers!");
6262
resize(source.getTotalNum(), target.getTotalNum());
6363
#pragma omp target enter data map(to:this[:1])
@@ -94,10 +94,10 @@ class SoaDistanceTableABOMP : public DTD_BConds<T, D, SC>, public DistanceTableD
9494
temp_dr_.resize(N_sources);
9595
}
9696

97-
SoaDistanceTableABOMP() = delete;
98-
SoaDistanceTableABOMP(const SoaDistanceTableABOMP&) = delete;
97+
SoaDistanceTableABOMPTarget() = delete;
98+
SoaDistanceTableABOMPTarget(const SoaDistanceTableABOMPTarget&) = delete;
9999

100-
~SoaDistanceTableABOMP()
100+
~SoaDistanceTableABOMPTarget()
101101
{
102102
#pragma omp target exit data map(delete:this[:1])
103103
}
@@ -187,13 +187,13 @@ class SoaDistanceTableABOMP : public DTD_BConds<T, D, SC>, public DistanceTableD
187187
count_targets = 0;
188188
for (size_t iw = 0; iw < nw; iw++)
189189
{
190-
auto& dt = static_cast<SoaDistanceTableABOMP&>(dt_list[iw].get());
190+
auto& dt = static_cast<SoaDistanceTableABOMPTarget&>(dt_list[iw].get());
191191
ParticleSet& pset(p_list[iw]);
192192

193193
assert(N_sources == dt.N_sources);
194194

195-
auto& RSoA_OMP = static_cast<const RealSpacePositionsOMP&>(dt.Origin->getCoordinates());
196-
source_ptrs[iw] = const_cast<RealType*>(RSoA_OMP.getDevicePtr());
195+
auto& RSoA_OMPTarget = static_cast<const RealSpacePositionsOMPTarget&>(dt.Origin->getCoordinates());
196+
source_ptrs[iw] = const_cast<RealType*>(RSoA_OMPTarget.getDevicePtr());
197197

198198
for (size_t iat = 0; iat < pset.getTotalNum(); ++iat, ++count_targets)
199199
{
@@ -242,7 +242,7 @@ class SoaDistanceTableABOMP : public DTD_BConds<T, D, SC>, public DistanceTableD
242242
ScopedTimer copy(&copy_timer_);
243243
for (size_t iw = 0; iw < nw; iw++)
244244
{
245-
auto& dt = static_cast<SoaDistanceTableABOMP&>(dt_list[iw].get());
245+
auto& dt = static_cast<SoaDistanceTableABOMPTarget&>(dt_list[iw].get());
246246
auto* pool_ptr = dt.r_dr_memorypool_.data();
247247
#pragma omp target update from(pool_ptr[:dt.r_dr_memorypool_.size()]) nowait depend(inout:total_targets)
248248
}
@@ -279,13 +279,13 @@ class SoaDistanceTableABOMP : public DTD_BConds<T, D, SC>, public DistanceTableD
279279
count_targets = 0;
280280
for (size_t iw = 0; iw < nw; iw++)
281281
{
282-
auto& dt = static_cast<SoaDistanceTableABOMP&>(dt_list[iw].get());
282+
auto& dt = static_cast<SoaDistanceTableABOMPTarget&>(dt_list[iw].get());
283283
ParticleSet& pset(p_list[iw]);
284284

285285
assert(N_sources == dt.N_sources);
286286

287-
auto& RSoA_OMP = static_cast<const RealSpacePositionsOMP&>(dt.Origin->getCoordinates());
288-
source_ptrs[iw] = const_cast<RealType*>(RSoA_OMP.getDevicePtr());
287+
auto& RSoA_OMPTarget = static_cast<const RealSpacePositionsOMPTarget&>(dt.Origin->getCoordinates());
288+
source_ptrs[iw] = const_cast<RealType*>(RSoA_OMPTarget.getDevicePtr());
289289

290290
for (size_t iat = 0; iat < pset.getTotalNum(); ++iat, ++count_targets)
291291
{
@@ -337,7 +337,7 @@ class SoaDistanceTableABOMP : public DTD_BConds<T, D, SC>, public DistanceTableD
337337
{
338338
const int wid = walker_id_ptr[iat];
339339
const int pid = particle_id[iat];
340-
auto& dt = static_cast<SoaDistanceTableABOMP&>(dt_list[wid].get());
340+
auto& dt = static_cast<SoaDistanceTableABOMPTarget&>(dt_list[wid].get());
341341
assert(N_sources_padded == dt.displacements_[pid].capacity());
342342
auto offset = offload_output.data() + iat * N_sources_padded * (D + 1);
343343
std::copy_n(offset, N_sources_padded, dt.distances_[pid].data());

src/Particle/createDistanceTable.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ DistanceTableData* createDistanceTable(ParticleSet& s, std::ostream& description
4242

4343
///free function create a distable table of s-t
4444
DistanceTableData* createDistanceTableAB(const ParticleSet& s, ParticleSet& t, std::ostream& description);
45-
DistanceTableData* createDistanceTableABOMP(const ParticleSet& s, ParticleSet& t, std::ostream& description);
45+
DistanceTableData* createDistanceTableABOMPTarget(const ParticleSet& s, ParticleSet& t, std::ostream& description);
4646

4747
inline DistanceTableData* createDistanceTable(const ParticleSet& s, ParticleSet& t, std::ostream& description)
4848
{
@@ -51,7 +51,7 @@ inline DistanceTableData* createDistanceTable(const ParticleSet& s, ParticleSet&
5151
// Thus the implementation selection is determined by the source particle set.
5252
#if defined(ENABLE_OFFLOAD)
5353
if (s.getCoordinates().getKind() == DynamicCoordinateKind::DC_POS_OFFLOAD)
54-
return createDistanceTableABOMP(s, t, description);
54+
return createDistanceTableABOMPTarget(s, t, description);
5555
else
5656
#endif
5757
return createDistanceTableAB(s, t, description);

src/Particle/createDistanceTableABOMP.cpp src/Particle/createDistanceTableABOMPTarget.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919
#include "Lattice/ParticleBConds.h"
2020
#include "CPU/SIMD/algorithm.hpp"
2121
#include "Lattice/ParticleBConds3DSoa.h"
22-
#include "Particle/SoaDistanceTableABOMP.h"
22+
#include "Particle/SoaDistanceTableABOMPTarget.h"
2323
namespace qmcplusplus
2424
{
2525
/** Adding AsymmetricDTD to the list, e.g., el-el distance table
2626
*\param s source/target particle set
2727
*\return index of the distance table with the name
2828
*/
29-
DistanceTableData* createDistanceTableABOMP(const ParticleSet& s, ParticleSet& t, std::ostream& description)
29+
DistanceTableData* createDistanceTableABOMPTarget(const ParticleSet& s, ParticleSet& t, std::ostream& description)
3030
{
3131
using RealType = ParticleSet::RealType;
3232
enum
@@ -45,19 +45,19 @@ DistanceTableData* createDistanceTableABOMP(const ParticleSet& s, ParticleSet& t
4545
if (s.Lattice.DiagonalOnly)
4646
{
4747
o << " Distance computations use orthorhombic periodic cell in 3D." << std::endl;
48-
dt = new SoaDistanceTableABOMP<RealType, DIM, PPPO + SOA_OFFSET>(s, t);
48+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, PPPO + SOA_OFFSET>(s, t);
4949
}
5050
else
5151
{
5252
if (s.Lattice.WignerSeitzRadius > s.Lattice.SimulationCellRadius)
5353
{
5454
o << " Distance computations use general periodic cell in 3D with corner image checks." << std::endl;
55-
dt = new SoaDistanceTableABOMP<RealType, DIM, PPPG + SOA_OFFSET>(s, t);
55+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, PPPG + SOA_OFFSET>(s, t);
5656
}
5757
else
5858
{
5959
o << " Distance computations use general periodic cell in 3D without corner image checks." << std::endl;
60-
dt = new SoaDistanceTableABOMP<RealType, DIM, PPPS + SOA_OFFSET>(s, t);
60+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, PPPS + SOA_OFFSET>(s, t);
6161
}
6262
}
6363
}
@@ -66,31 +66,31 @@ DistanceTableData* createDistanceTableABOMP(const ParticleSet& s, ParticleSet& t
6666
if (s.Lattice.DiagonalOnly)
6767
{
6868
o << " Distance computations use orthorhombic code for periodic cell in 2D." << std::endl;
69-
dt = new SoaDistanceTableABOMP<RealType, DIM, PPNO + SOA_OFFSET>(s, t);
69+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, PPNO + SOA_OFFSET>(s, t);
7070
}
7171
else
7272
{
7373
if (s.Lattice.WignerSeitzRadius > s.Lattice.SimulationCellRadius)
7474
{
7575
o << " Distance computations use general periodic cell in 2D with corner image checks." << std::endl;
76-
dt = new SoaDistanceTableABOMP<RealType, DIM, PPNG + SOA_OFFSET>(s, t);
76+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, PPNG + SOA_OFFSET>(s, t);
7777
}
7878
else
7979
{
8080
o << " Distance computations use general periodic cell in 2D without corner image checks." << std::endl;
81-
dt = new SoaDistanceTableABOMP<RealType, DIM, PPNS + SOA_OFFSET>(s, t);
81+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, PPNS + SOA_OFFSET>(s, t);
8282
}
8383
}
8484
}
8585
else if (sc == SUPERCELL_WIRE)
8686
{
8787
o << " Distance computations use periodic cell in one dimension." << std::endl;
88-
dt = new SoaDistanceTableABOMP<RealType, DIM, SUPERCELL_WIRE + SOA_OFFSET>(s, t);
88+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, SUPERCELL_WIRE + SOA_OFFSET>(s, t);
8989
}
9090
else //open boundary condition
9191
{
9292
o << " Distance computations use open boundary conditions in 3D." << std::endl;
93-
dt = new SoaDistanceTableABOMP<RealType, DIM, SUPERCELL_OPEN + SOA_OFFSET>(s, t);
93+
dt = new SoaDistanceTableABOMPTarget<RealType, DIM, SUPERCELL_OPEN + SOA_OFFSET>(s, t);
9494
}
9595

9696
//set dt properties

0 commit comments

Comments
 (0)