Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement SPOSetT<T> template class hierarchy #4684

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 7 additions & 2 deletions src/Numerics/OneDimGridFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@


#include "OneDimGridFactory.h"
#include "Configuration.h"
#include "OhmmsData/AttributeSet.h"
#include "Message/UniformCommunicateError.h"

namespace qmcplusplus
{
std::unique_ptr<OneDimGridFactory::GridType> OneDimGridFactory::createGrid(xmlNodePtr cur)
template <typename T>
std::unique_ptr<typename OneDimGridFactory<T>::GridType> OneDimGridFactory<T>::createGrid(xmlNodePtr cur)
{
std::unique_ptr<GridType> agrid;
RealType ri = 1e-5;
RealType rf = 100.0;
RealType ascale = -1.0e0;
RealType astep = 1.25e-2;
IndexType npts = 1001;
QMCTraits::IndexType npts = 1001;
std::string gridType("log");
std::string gridID("invalid");
OhmmsAttributeSet radAttrib;
Expand Down Expand Up @@ -74,4 +76,7 @@ std::unique_ptr<OneDimGridFactory::GridType> OneDimGridFactory::createGrid(xmlNo
}
return agrid;
}

template struct OneDimGridFactory<double>;
template struct OneDimGridFactory<float>;
} // namespace qmcplusplus
6 changes: 4 additions & 2 deletions src/Numerics/OneDimGridFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@

#ifndef QMCPLUSPLUS_ONEDIMGRIDFACTORY_H
#define QMCPLUSPLUS_ONEDIMGRIDFACTORY_H
#include "Configuration.h"
#include "Numerics/OneDimGridFunctor.h"
#include "Numerics/LibxmlNumericIO.h"

namespace qmcplusplus
{
/** Factory class using Singleton pattern
*/
struct OneDimGridFactory : public QMCTraits
template <typename T>
struct OneDimGridFactory
{
using RealType = T;
///typedef of the one-dimensional grid
using GridType = OneDimGridBase<RealType>;

Expand Down
4 changes: 2 additions & 2 deletions src/Numerics/SoaCartesianTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace qmcplusplus
{
/** CartesianTensor according to Gamess order
* @tparam T, value_type, e.g. double
* @tparam T, ValueType, e.g. double
*
* Original implementation Numerics/CartesianTensor.h
* Modified to use SoA for cXYZ and used by SoaAtomicBasisSet
Expand All @@ -40,12 +40,12 @@ template<class T>
class SoaCartesianTensor
{
private:
using value_type = T;
using ggg_type = TinyVector<Tensor<T, 3>, 3>;
using OffloadVector = Vector<T, OffloadPinnedAllocator<T>>;
using OffloadArray2D = Array<T, 2, OffloadPinnedAllocator<T>>;
using OffloadArray3D = Array<T, 3, OffloadPinnedAllocator<T>>;
using OffloadArray4D = Array<T, 4, OffloadPinnedAllocator<T>>;
using ValueType = T;

///maximum angular momentum
int Lmax;
Expand Down
3 changes: 3 additions & 0 deletions src/Numerics/SoaSphericalTensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ namespace qmcplusplus
template<typename T>
class SoaSphericalTensor
{

private:
using OffloadVector = Vector<T, OffloadPinnedAllocator<T>>;
using OffloadArray2D = Array<T, 2, OffloadPinnedAllocator<T>>;
using OffloadArray3D = Array<T, 3, OffloadPinnedAllocator<T>>;
using OffloadArray4D = Array<T, 4, OffloadPinnedAllocator<T>>;
using ValueType = T;

///maximum angular momentum for the center
int Lmax;
/// Normalization factors
Expand Down
30 changes: 14 additions & 16 deletions src/Particle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,23 @@
# create libqmcparticle
####################################
set(PARTICLE
InitMolecularSystem.cpp
SimulationCell.cpp
ParticleSetPool.cpp
ParticleSet.cpp
InitMolecularSystemT.cpp
SimulationCellT.cpp
ParticleSetPoolT.cpp
ParticleSetT.cpp
PSdispatcher.cpp
VirtualParticleSet.cpp
ParticleSet.BC.cpp
VirtualParticleSetT.cpp
DynamicCoordinatesBuilder.cpp
MCCoords.cpp
MCWalkerConfiguration.cpp
WalkerConfigurations.cpp
DynamicCoordinatesT.cpp
MCCoordsT.cpp
MCWalkerConfigurationT.cpp
WalkerConfigurationsT.cpp
SpeciesSet.cpp
SampleStack.cpp
createDistanceTableAA.cpp
createDistanceTableAB.cpp
SampleStackT.cpp
createDistanceTableT.cpp
HDFWalkerInputManager.cpp
LongRange/KContainer.cpp
LongRange/StructFact.cpp
LongRange/KContainerT.cpp
LongRange/StructFactT.cpp
LongRange/LPQHIBasis.cpp
LongRange/LPQHISRCoulombBasis.cpp
LongRange/EwaldHandlerQuasi2D.cpp
Expand All @@ -51,8 +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
createDistanceTableAAOMPTarget.cpp
createDistanceTableABOMPTarget.cpp)
createDistanceTableTOMPTarget.cpp)

add_library(qmcparticle_omptarget OBJECT ${PARTICLE_OMPTARGET_SRCS})

Expand Down
Loading