Skip to content

Commit

Permalink
Merge pull request QMCPACK#4851 from ye-luo/hybridrep-builder
Browse files Browse the repository at this point in the history
More restructuring of spline reader classes
  • Loading branch information
prckent authored Dec 1, 2023
2 parents 30e06c9 + ac9e6c3 commit 09203fe
Show file tree
Hide file tree
Showing 20 changed files with 1,233 additions and 1,103 deletions.
8 changes: 4 additions & 4 deletions src/QMCWaveFunctions/BsplineFactory/BsplineReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file is distributed under the University of Illinois/NCSA Open Source License.
// See LICENSE file in top directory for details.
//
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
// Copyright (c) 2023 QMCPACK developers.
//
// File developed by: Jeongnim Kim, [email protected], University of Illinois at Urbana-Champaign
// Paul R. C. Kent, [email protected], Oak Ridge National Laboratory
Expand Down Expand Up @@ -161,9 +161,9 @@ std::unique_ptr<SPOSet> BsplineReader::create_spline_set(int spin, xmlNodePtr cu
* At gamma or arbitrary kpoints with complex wavefunctions, spo2band[i]==i
*/
void BsplineReader::initialize_spo2band(int spin,
const std::vector<BandInfo>& bigspace,
SPOSetInfo& sposet,
std::vector<int>& spo2band)
const std::vector<BandInfo>& bigspace,
SPOSetInfo& sposet,
std::vector<int>& spo2band)
{
spo2band.reserve(bigspace.size());
int ns = 0;
Expand Down
7 changes: 4 additions & 3 deletions src/QMCWaveFunctions/BsplineFactory/BsplineReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file is distributed under the University of Illinois/NCSA Open Source License.
// See LICENSE file in top directory for details.
//
// Copyright (c) 2016 Jeongnim Kim and QMCPACK developers.
// Copyright (c) 2023 QMCPACK developers.
//
// File developed by: Jeongnim Kim, [email protected], University of Illinois at Urbana-Champaign
// Raymond Clay III, [email protected], Lawrence Livermore National Laboratory
Expand All @@ -20,9 +20,10 @@
#ifndef QMCPLUSPLUS_BSPLINE_READER_H
#define QMCPLUSPLUS_BSPLINE_READER_H

#include "mpi/collectives.h"
#include "mpi/point2point.h"
#include <vector>
#include <einspline/bspline_base.h>
#include <BandInfo.h>
#include "EinsplineSetBuilder.h"

namespace qmcplusplus
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
* -
*/
#include "EinsplineSetBuilder.h"
#include <array>
#include <string_view>
#include "OhmmsData/AttributeSet.h"
#include "Message/CommOperators.h"
#include <Message/UniformCommunicateError.h>
#include "QMCWaveFunctions/BsplineFactory/BsplineReader.h"
#include "Particle/DistanceTable.h"

#include <array>
#include <string_view>
#include "mpi/collectives.h"

namespace qmcplusplus
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "Utilities/Timer.h"
#include "ParticleBase/RandomSeqGenerator.h"
#include "Particle/DistanceTable.h"
#include <fftw3.h>
#include "Utilities/ProgressReportEngine.h"
#include "einspline_helper.hpp"
#include "BsplineReader.h"
#include "BsplineSet.h"
Expand Down Expand Up @@ -257,23 +255,13 @@ std::unique_ptr<SPOSet> EinsplineSetBuilder::createSPOSetFromXML(xmlNodePtr cur)
{
//if(TargetPtcl.Lattice.SuperCellEnum != SUPERCELL_BULK && truncate=="yes")
if (MixedSplineReader == 0)
{
if (use_single)
MixedSplineReader = createBsplineRealSingle(this, hybrid_rep == "yes", useGPU);
else
MixedSplineReader = createBsplineRealDouble(this, hybrid_rep == "yes", useGPU);
}
MixedSplineReader = createBsplineReal(this, use_single, hybrid_rep == "yes", useGPU);
}
else
#endif
{
if (MixedSplineReader == 0)
{
if (use_single)
MixedSplineReader = createBsplineComplexSingle(this, hybrid_rep == "yes", useGPU);
else
MixedSplineReader = createBsplineComplexDouble(this, hybrid_rep == "yes", useGPU);
}
MixedSplineReader = createBsplineComplex(this, use_single, hybrid_rep == "yes", useGPU);
}

MixedSplineReader->setCommon(XMLRoot);
Expand Down
14 changes: 2 additions & 12 deletions src/QMCWaveFunctions/BsplineFactory/EinsplineSpinorSetBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,23 +177,13 @@ std::unique_ptr<SPOSet> EinsplineSpinorSetBuilder::createSPOSetFromXML(xmlNodePt
if (use_real_splines_)
{
if (MixedSplineReader == 0)
{
if (use_single)
MixedSplineReader = createBsplineRealSingle(this, hybrid_rep == "yes", useGPU);
else
MixedSplineReader = createBsplineRealDouble(this, hybrid_rep == "yes", useGPU);
}
MixedSplineReader = createBsplineReal(this, use_single, hybrid_rep == "yes", useGPU);
}
else
#endif
{
if (MixedSplineReader == 0)
{
if (use_single)
MixedSplineReader = createBsplineComplexSingle(this, hybrid_rep == "yes", useGPU);
else
MixedSplineReader = createBsplineComplexDouble(this, hybrid_rep == "yes", useGPU);
}
MixedSplineReader = createBsplineComplex(this, use_single, hybrid_rep == "yes", useGPU);
}

MixedSplineReader->setCommon(XMLRoot);
Expand Down
2 changes: 2 additions & 0 deletions src/QMCWaveFunctions/BsplineFactory/HybridRepCplx.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "QMCWaveFunctions/BsplineFactory/HybridRepCenterOrbitals.h"
#include "CPU/SIMD/inner_product.hpp"
#include "BsplineSet.h"

namespace qmcplusplus
{
Expand All @@ -35,6 +36,7 @@ class HybridRepCplx : public SPLINEBASE, private HybridRepCenterOrbitals<typenam
using SplineBase = SPLINEBASE;
using HYBRIDBASE = HybridRepCenterOrbitals<typename SPLINEBASE::DataType>;
using ST = typename SPLINEBASE::DataType;
using DataType = typename SPLINEBASE::DataType;
using PointType = typename SPLINEBASE::PointType;
using SingleSplineType = typename SPLINEBASE::SingleSplineType;
using RealType = typename SPLINEBASE::RealType;
Expand Down
2 changes: 2 additions & 0 deletions src/QMCWaveFunctions/BsplineFactory/HybridRepReal.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "QMCWaveFunctions/BsplineFactory/HybridRepCenterOrbitals.h"
#include "CPU/SIMD/inner_product.hpp"
#include "BsplineSet.h"

namespace qmcplusplus
{
Expand All @@ -35,6 +36,7 @@ class HybridRepReal : public SPLINEBASE, private HybridRepCenterOrbitals<typenam
using SplineBase = SPLINEBASE;
using HYBRIDBASE = HybridRepCenterOrbitals<typename SPLINEBASE::DataType>;
using ST = typename SPLINEBASE::DataType;
using DataType = typename SPLINEBASE::DataType;
using PointType = typename SPLINEBASE::PointType;
using SingleSplineType = typename SPLINEBASE::SingleSplineType;
using RealType = typename SPLINEBASE::RealType;
Expand Down
Loading

0 comments on commit 09203fe

Please sign in to comment.