Skip to content

Commit

Permalink
Start replacing legacy code with templated classes
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve authored and williamfgc committed Oct 25, 2023
1 parent 0071536 commit 1c282f3
Show file tree
Hide file tree
Showing 225 changed files with 1,808 additions and 30,995 deletions.
2 changes: 2 additions & 0 deletions src/Containers/OhmmsSoA/VectorSoaContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ struct VectorSoaContainer
template<typename T1>
void copyIn(const Vector<TinyVector<T1, D>>& in)
{
static_assert(std::is_same_v<T, T1>);
//if(nLocal!=in.size()) resize(in.size());
PosAoS2SoA(nLocal, D, reinterpret_cast<const T1*>(in.first_address()), D, myData, nGhosts);
}
Expand All @@ -222,6 +223,7 @@ struct VectorSoaContainer
template<typename T1>
void copyOut(Vector<TinyVector<T1, D>>& out) const
{
static_assert(std::is_same_v<T, T1>);
PosSoA2AoS(nLocal, D, myData, nGhosts, reinterpret_cast<T1*>(out.first_address()), D);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Estimators/EstimatorManagerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
#include "OhmmsPETE/OhmmsVector.h"
#include "io/hdf/hdf_archive.h"
#include <bitset>
#include "Particle/MCWalkerConfiguration.h"

namespace qmcplusplus
{
class MCWalkerConfiguration;
class QMCHamiltonian;
class CollectablesEstimator;

Expand All @@ -52,7 +52,7 @@ class EstimatorManagerBase

using EstimatorType = ScalarEstimatorBase;
using BufferType = std::vector<RealType>;
using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits>;
using MCPWalker = MCWalkerConfiguration::Walker_t;

///default constructor
EstimatorManagerBase(Communicate* c = 0);
Expand Down
3 changes: 2 additions & 1 deletion src/Estimators/EstimatorManagerCrowd.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "Estimators/EstimatorManagerNew.h"
#include "Particle/Walker.h"
#include "OhmmsPETE/OhmmsVector.h"
#include "Particle/MCWalkerConfiguration.h"

namespace qmcplusplus
{
Expand All @@ -38,7 +39,7 @@ class QMCHamiltonian;
class EstimatorManagerCrowd
{
public:
using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits>;
using MCPWalker = MCWalkerConfiguration::Walker_t;
using RealType = EstimatorManagerNew::RealType;
using FullPrecRealType = EstimatorManagerNew::FullPrecRealType;

Expand Down
3 changes: 2 additions & 1 deletion src/Estimators/OperatorEstBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "QMCWaveFunctions/OrbitalSetTraits.h"
#include "type_traits/DataLocality.h"
#include "hdf/hdf_archive.h"
#include "Particle/MCWalkerConfiguration.h"
#include <bitset>

namespace qmcplusplus
Expand All @@ -41,7 +42,7 @@ class OperatorEstBase
public:
using QMCT = QMCTraits;
using FullPrecRealType = QMCT::FullPrecRealType;
using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits>;
using MCPWalker = MCWalkerConfiguration::Walker_t;

using Data = std::vector<QMCT::RealType>;

Expand Down
2 changes: 1 addition & 1 deletion src/Estimators/ScalarEstimatorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct ScalarEstimatorBase
using RealType = QMCTraits::FullPrecRealType;
using accumulator_type = accumulator_set<RealType>;
using Walker_t = MCWalkerConfiguration::Walker_t;
using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits>;
using MCPWalker = Walker_t;
using WalkerIterator = MCWalkerConfiguration::const_iterator;
using RecordListType = RecordNamedProperty<RealType>;

Expand Down
2 changes: 1 addition & 1 deletion src/Estimators/tests/test_EstimatorManagerCrowd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TEST_CASE("EstimatorManagerCrowd PerParticleHamiltonianLogger integration", "[es

EstimatorManagerCrowd emc(emn);

using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits>;
using MCPWalker = EstimatorManagerCrowd::MCPWalker;

std::vector<MCPWalker> walkers(num_walkers, MCPWalker(pset.getTotalNum()));

Expand Down
2 changes: 1 addition & 1 deletion src/Estimators/tests/test_MagnetizationDensity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ TEST_CASE("MagnetizationDensity::IntegrationTest", "[estimators]")
using GradVector = Vector<Grad>;
using ValueMatrix = Matrix<Value>;
using PropertySetType = OperatorBase::PropertySetType;
using MCPWalker = Walker<QMCTraits, PtclOnLatticeTraits>;
using MCPWalker = Walker<ParticleSetTraits<QMCTraits::ValueType>, LatticeParticleTraits<QMCTraits::ValueType>>;
using Data = MagnetizationDensity::Data;
using GradMatrix = Matrix<Grad>;
using namespace testing;
Expand Down
19 changes: 2 additions & 17 deletions src/Particle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,22 @@
# create libqmcparticle
####################################
set(PARTICLE
InitMolecularSystem.cpp
InitMolecularSystemT.cpp
SimulationCell.cpp
SimulationCellT.cpp
ParticleSetPool.cpp
ParticleSetPoolT.cpp
ParticleSet.cpp
ParticleSetT.cpp
PSdispatcher.cpp
VirtualParticleSet.cpp
VirtualParticleSetT.cpp
ParticleSet.BC.cpp
DynamicCoordinatesBuilder.cpp
DynamicCoordinatesT.cpp
MCCoords.cpp
MCCoordsT.cpp
MCWalkerConfiguration.cpp
MCWalkerConfigurationT.cpp
WalkerConfigurations.cpp
WalkerConfigurationsT.cpp
SpeciesSet.cpp
SampleStack.cpp
SampleStackT.cpp
createDistanceTableAA.cpp
createDistanceTableAB.cpp
createDistanceTableT.cpp
HDFWalkerInputManager.cpp
LongRange/KContainer.cpp
LongRange/KContainerT.cpp
LongRange/StructFact.cpp
LongRange/StructFactT.cpp
LongRange/LPQHIBasis.cpp
LongRange/LPQHISRCoulombBasis.cpp
Expand All @@ -63,9 +50,7 @@ target_include_directories(qmcparticle PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(qmcparticle PRIVATE platform_cpu_LA)
target_link_libraries(qmcparticle PUBLIC qmcnumerics qmcutil platform_runtime)
set(PARTICLE_OMPTARGET_SRCS
createDistanceTableTOMPTarget.cpp
createDistanceTableAAOMPTarget.cpp
createDistanceTableABOMPTarget.cpp)
createDistanceTableTOMPTarget.cpp)

if(USE_OBJECT_TARGET)
add_library(qmcparticle_omptarget OBJECT ${PARTICLE_OMPTARGET_SRCS})
Expand Down
Loading

0 comments on commit 1c282f3

Please sign in to comment.