Skip to content

Commit

Permalink
Implement SPOSetT template class
Browse files Browse the repository at this point in the history
Asses the effort to change this.
Currently without consumers or tests.

Concretize friend class declaration

Define testing::getMyVars for SPOSetT

Add FakeSPOT class

Move SpinorSet to a templated class

Refactor FreeOrbital class

Base typed aliases on SPOSet<T> on OrbitalSetTraits<T>

Add FullRealType in SPOSet and RotatedSPOs

Add this in templated meta class

Add explicit function instantions for FreeOrbital

Add templated class SHOSetT

Signed-off-by: Steven Hahn <[email protected]>

Add PWRealOrbitalSetT template class

Revert test_RotatedSPOs.cpp

Revert test_RotatedSPOs.cpp

Reorder specialized function definitions to appease OMP target compilation

Add ConstantSPOSetT

Refactor BsplineSet and SplineC2C

Follow existing pattern for SplineC2C allowing for std::complex<T>

PWOribitalSetT and PWBasisT

Add FullRealType in SPOSet and RotatedSPOs

Move generic definition after specialization

add implicit implementations

Fix some errors

initial commit of templated PWOribitSetT that compiles

cleanup

templateitze PWBasis as well, as is dependancy

remove inaccurate comment

remove polluted commit

Add LCAOrbitalSetT

Add templated class LCAOrbitalSetWithCorrectionT

Signed-off-by: Steven Hahn <[email protected]>

Add SPOSetBuilderT, SHOSetBuilderT and SoaCuspCorrectionT

Fix PWOrbitalSet alias types
Fix LCAOrbitalSetWithCorrectionT
Reuse SPOSet types

Signed-off-by: Steven Hahn <[email protected]>

Implement CompositeSPOSetT class

Specialize functions in RotatedSPOsT

Fix function signature
Change order of definition

Implement SPOSetBuilderFactoryT and most required builders

Add missing implementation to SPOSetBuilderT

Signed-off-by: Steven Hahn <[email protected]>

Add CI to WIP refactoring branch

add SplineR2RT

Empty-Commit

Further template propagation to fix offload build

Implement SplineC2RTOMPTarget template class

add missing particlesetT

Refactored everything needed for test_RotatedSPOsT

Add new bits to RotatedSPOsT

Bugfix: removed QMC_COMPLEX conditions where no longer needed

Accomodate new refactored headers

simd::dot and Spline classes

Move memory reference inside PRAGMA

Causes a memory corruption when defining internal pos

Fix pragma typo with is_device_ptr

Implement SPOSetT template class

Asses the initial effort to refactor SPOSet into templates
without consumers or tests.
Concretize friend class declaration
Define testing::getMyVars for SPOSetT
Add FakeSPOT class
Move SpinorSet to a templated class
Refactor FreeOrbital class
Base typed aliases on SPOSet<T> on OrbitalSetTraits<T>
Add FullRealType in SPOSet and RotatedSPOs
Add this in templated meta class
Add explicit function instantions for FreeOrbital
Add templated class SHOSetT
Add PWRealOrbitalSetT template class
Revert test_RotatedSPOs.cpp

Signed-off-by: Steven Hahn <[email protected]>

Revert test_RotatedSPOs.cpp

PWOribitalSetT and PWBasisT

Add FullRealType in SPOSet and RotatedSPOs

Move generic definition after specialization

add implicit implementations

Fix some errors

initial commit of templated PWOribitSetT that compiles

cleanup

templateitze PWBasis as well, as is dependancy

remove inaccurate comment

remove polluted commit

Start replacing legacy code with templated classes

Fix ornl CI tests

sulfur: Add missing SPOSet header in NiO tests
nitrogen: Add missing memory header for std::unique_ptr

clang-format-16 on new files

Fix license file headers

Fix typo with T1->T
  • Loading branch information
williamfgc committed Nov 8, 2023
1 parent 864c22d commit cb3d07c
Show file tree
Hide file tree
Showing 273 changed files with 27,367 additions and 18,171 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches:
- develop
- main
- ref-add-SPOSetT
pull_request:
branches:
- develop
- main
- ref-add-SPOSetT

jobs:
linux:
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
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

0 comments on commit cb3d07c

Please sign in to comment.