From 854c6f21d02006be56e68b78a56008cd7634b631 Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 21:48:38 -0800 Subject: [PATCH 01/24] Added GKS boilerplate to include directory --- include/gauxc/xc_integrator.hpp | 2 ++ include/gauxc/xc_integrator/impl.hpp | 7 +++++ .../gauxc/xc_integrator/replicated/impl.hpp | 22 +++++++++++++++ .../replicated_xc_integrator_impl.hpp | 28 +++++++++++++++++++ .../replicated_xc_integrator.hpp | 2 ++ .../xc_integrator/xc_integrator_impl.hpp | 6 ++++ 6 files changed, 67 insertions(+) diff --git a/include/gauxc/xc_integrator.hpp b/include/gauxc/xc_integrator.hpp index 547d07f1..19b92c66 100644 --- a/include/gauxc/xc_integrator.hpp +++ b/include/gauxc/xc_integrator.hpp @@ -33,6 +33,7 @@ class XCIntegrator { using exc_vxc_type_rks = std::tuple< value_type, matrix_type >; using exc_vxc_type_uks = std::tuple< value_type, matrix_type, matrix_type >; + using exc_vxc_type_gks = std::tuple< value_type, matrix_type, matrix_type, matrix_type, matrix_type >; using exc_grad_type = std::vector< value_type >; using exx_type = matrix_type; @@ -55,6 +56,7 @@ class XCIntegrator { value_type integrate_den( const MatrixType& ); exc_vxc_type_rks eval_exc_vxc ( const MatrixType& ); exc_vxc_type_uks eval_exc_vxc ( const MatrixType&, const MatrixType& ); + exc_vxc_type_uks eval_exc_vxc ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&); exc_grad_type eval_exc_grad( const MatrixType& ); exx_type eval_exx ( const MatrixType&, const IntegratorSettingsEXX& = IntegratorSettingsEXX{} ); diff --git a/include/gauxc/xc_integrator/impl.hpp b/include/gauxc/xc_integrator/impl.hpp index 7d839647..faacdd55 100644 --- a/include/gauxc/xc_integrator/impl.hpp +++ b/include/gauxc/xc_integrator/impl.hpp @@ -45,6 +45,13 @@ typename XCIntegrator::exc_vxc_type_uks return pimpl_->eval_exc_vxc(Pscalar, Pz); }; +template +typename XCIntegrator::exc_vxc_type_gks + XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py ) { + if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); + return pimpl_->eval_exc_vxc(Pscalar, Pz, Px, Py); + }; + template typename XCIntegrator::exc_grad_type XCIntegrator::eval_exc_grad( const MatrixType& P ) { diff --git a/include/gauxc/xc_integrator/replicated/impl.hpp b/include/gauxc/xc_integrator/replicated/impl.hpp index 8d3d23b6..2f1bca5b 100644 --- a/include/gauxc/xc_integrator/replicated/impl.hpp +++ b/include/gauxc/xc_integrator/replicated/impl.hpp @@ -94,6 +94,28 @@ typename ReplicatedXCIntegrator::exc_vxc_type_uks } +template +typename ReplicatedXCIntegrator::exc_vxc_type_gks + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py) { + + if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); + matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); + matrix_type VXCz( Pz.rows(), Pz.cols() ); + value_type EXC; + + pimpl_->eval_exc_vxc( Pscalar.rows(), Pscalar.cols(), Pscalar.data(), Pscalar.rows(), + Pz.data(), Pz.rows(), + Px.data(), Px.rows(), + Py.data(), Py.rows(), + VXCscalar.data(), VXCscalar.rows(), + VXCz.data(), VXCz.rows(), + VXCx.data(), VXCx.rows(), + VXCy.data(), VXCy.rows(), &EXC ); + + return std::make_tuple( EXC, VXCscalar, VXCz, VXCx, VXCy); + +} + template typename ReplicatedXCIntegrator::exc_grad_type ReplicatedXCIntegrator::eval_exc_grad_( const MatrixType& P ) { diff --git a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp index 4e0854fd..be360a88 100644 --- a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp @@ -48,6 +48,20 @@ class ReplicatedXCIntegratorImpl { value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, value_type* EXC ) = 0; + virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, + int64_t ldpscalar, + const value_type* Pz, + int64_t ldpz, + const value_type* Px, + int64_t ldpx, + const value_type* Py, + int64_t ldpy, + value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCx, int64_t ldvxcx, + value_type* VXCy, int64_t ldvxcy, + value_type* EXC ) = 0; + virtual void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD ) = 0; virtual void eval_exx_( int64_t m, int64_t n, const value_type* P, @@ -78,6 +92,20 @@ class ReplicatedXCIntegratorImpl { value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, value_type* EXC ); + void eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, + int64_t ldpscalar, + const value_type* Pz, + int64_t ldpz, + const value_type* Px, + int64_t ldpx, + const value_type* Py, + int64_t ldpy, + value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCx, int64_t ldvxcx, + value_type* VXCy, int64_t ldvxcy, + value_type* EXC ); + void eval_exc_grad( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD ); diff --git a/include/gauxc/xc_integrator/replicated_xc_integrator.hpp b/include/gauxc/xc_integrator/replicated_xc_integrator.hpp index a2a536f5..c4718389 100644 --- a/include/gauxc/xc_integrator/replicated_xc_integrator.hpp +++ b/include/gauxc/xc_integrator/replicated_xc_integrator.hpp @@ -30,6 +30,7 @@ class ReplicatedXCIntegrator : public XCIntegratorImpl { using value_type = typename XCIntegratorImpl::value_type; using exc_vxc_type_rks = typename XCIntegratorImpl::exc_vxc_type_rks; using exc_vxc_type_uks = typename XCIntegratorImpl::exc_vxc_type_uks; + using exc_vxc_type_gks = typename XCIntegratorImpl::exc_vxc_type_gks; using exc_grad_type = typename XCIntegratorImpl::exc_grad_type; using exx_type = typename XCIntegratorImpl::exx_type; @@ -41,6 +42,7 @@ class ReplicatedXCIntegrator : public XCIntegratorImpl { value_type integrate_den_( const MatrixType& ) override; exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& ) override; exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType&, const MatrixType& ) override; + exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType& ) override; exc_grad_type eval_exc_grad_( const MatrixType& ) override; exx_type eval_exx_ ( const MatrixType&, const IntegratorSettingsEXX& ) override; const util::Timer& get_timings_() const override; diff --git a/include/gauxc/xc_integrator/xc_integrator_impl.hpp b/include/gauxc/xc_integrator/xc_integrator_impl.hpp index beb615a3..dc92df89 100644 --- a/include/gauxc/xc_integrator/xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/xc_integrator_impl.hpp @@ -22,6 +22,7 @@ class XCIntegratorImpl { using value_type = typename matrix_type::value_type; using exc_vxc_type_rks = typename XCIntegrator::exc_vxc_type_rks; using exc_vxc_type_uks = typename XCIntegrator::exc_vxc_type_uks; + using exc_vxc_type_gks = typename XCIntegrator::exc_vxc_type_gks; using exc_grad_type = typename XCIntegrator::exc_grad_type; using exx_type = typename XCIntegrator::exx_type; @@ -30,6 +31,7 @@ class XCIntegratorImpl { virtual value_type integrate_den_( const MatrixType& P ) = 0; virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P ) = 0; virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz ) = 0; + virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, , const MatrixType& Py ) = 0; virtual exc_grad_type eval_exc_grad_( const MatrixType& P ) = 0; virtual exx_type eval_exx_ ( const MatrixType& P, const IntegratorSettingsEXX& settings ) = 0; @@ -70,6 +72,10 @@ class XCIntegratorImpl { return eval_exc_vxc_(Pscalar, Pz); } + exc_vxc_type_gks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py ) { + return eval_exc_vxc_(Pscalar, Pz, Px, Py); + } + /** Integrate EXC gradient for RKS * * TODO: add API for UKS/GKS From ea8a679f2a597c6c6de20e34003cf427f18c13b9 Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 21:57:00 -0800 Subject: [PATCH 02/24] Added GKS definitions to ReferenceReplicatedXCHostIntegrator --- ...eference_replicated_xc_host_integrator.hpp | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp index 19ad3ccf..66395d2f 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp @@ -40,6 +40,21 @@ class ReferenceReplicatedXCHostIntegrator : value_type* VXCz, int64_t ldvxcz, value_type* EXC ) override; + void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, + const value_type* Pz, + int64_t ldpz, + const value_type* Px, + int64_t ldpx, + const value_type* Py, + int64_t ldpy, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCx, int64_t ldvxcx, + value_type* VXCy, int64_t ldvxcy + value_type* EXC ) override; + + void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD ) override; @@ -56,6 +71,16 @@ class ReferenceReplicatedXCHostIntegrator : value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC, value_type *N_EL ); + + void exc_vxc_local_work_( const value_type* Ps, int64_t ldps, + const value_type* Pz, int64_t ldpz, + const value_type* Px, int64_t ldpx, + const value_type* Py, int64_t ldpy, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCx, int64_t ldvxcx, + value_type* VXCy, int64_t ldvxcy, + value_type* EXC, value_type *N_EL ); void exc_grad_local_work_( const value_type* P, int64_t ldp, value_type* EXC_GRAD ); void exx_local_work_( const value_type* P, int64_t ldp, value_type* K, int64_t ldk, From 224cab9d696ab2e74285611ea49f4be2a0f26d9c Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 22:08:30 -0800 Subject: [PATCH 03/24] Added GKS boilerplate to reference_replicated_xc_host_integrator_exc_vxc.hpp --- ..._replicated_xc_host_integrator_exc_vxc.hpp | 92 +++++++++++++++++-- 1 file changed, 86 insertions(+), 6 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index 44afd131..baa5e8f2 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -44,7 +44,8 @@ void ReferenceReplicatedXCHostIntegrator:: // Compute Local contributions to EXC / VXC this->timer_.time_op("XCIntegrator.LocalWork", [&](){ //exc_vxc_local_work_( P, ldp, VXC, ldvxc, EXC, &N_EL ); - exc_vxc_local_work_( P, ldp, nullptr, 0, VXC, ldvxc, nullptr, 0, EXC, &N_EL ); + exc_vxc_local_work_( P, ldp, nullptr, 0, nullptr, 0, nullptr, 0, + VXC, ldvxc, nullptr, 0, nullptr, 0, nullptr, 0, EXC, &N_EL ); }); @@ -97,7 +98,8 @@ void ReferenceReplicatedXCHostIntegrator:: // Compute Local contributions to EXC / VXC this->timer_.time_op("XCIntegrator.LocalWork", [&](){ - exc_vxc_local_work_( Ps, ldps, Pz, ldpz, VXCs, ldvxcs, VXCz, ldvxcz, EXC, &N_EL ); + exc_vxc_local_work_( Ps, ldps, Pz, ldpz, nullptr, 0,nullptr, 0, + VXCs, ldvxcs, VXCz, ldvxcz, nullptr, 0, nullptr, 0, EXC, &N_EL ); }); @@ -117,18 +119,96 @@ void ReferenceReplicatedXCHostIntegrator:: } +template +void ReferenceReplicatedXCHostIntegrator:: + eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, + const value_type* Pz, + int64_t ldpz, + const value_type* Px, + int64_t ldpx, + const value_type* Py, + int64_t ldpy, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCx, int64_t ldvxcx, + value_type* VXCy, int64_t ldvxcy, + value_type* EXC ) { + + const auto& basis = this->load_balancer_->basis(); + + // Check that P / VXC are sane + const int64_t nbf = basis.nbf(); + if( m != n ) + GAUXC_GENERIC_EXCEPTION("P/VXC Must Be Square"); + if( m != nbf ) + GAUXC_GENERIC_EXCEPTION("P/VXC Must Have Same Dimension as Basis"); + if( ldps < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDPSCALAR"); + if( ldpz < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDPZ"); + if( ldpx < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDPX"); + if( ldpy < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDPY"); + if( ldvxcs < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDVXCSCALAR"); + if( ldvxcz < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDVXCZ"); + if( ldvxcx < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDVXCX"); + if( ldvxcy < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDVXCY"); + + // Get Tasks + this->load_balancer_->get_tasks(); + + // Temporary electron count to judge integrator accuracy + value_type N_EL; + + // Compute Local contributions to EXC / VXC + this->timer_.time_op("XCIntegrator.LocalWork", [&](){ + exc_vxc_local_work_( Ps, ldps, Pz, ldpz, Px, ldpx, Py, ldpy, + VXCs, ldvxcs, VXCz, ldvxcz, + VXCx, ldvxcx, VXCy, ldvxcy, EXC, &N_EL ); + }); + + + // Reduce Results + this->timer_.time_op("XCIntegrator.Allreduce", [&](){ + + if( not this->reduction_driver_->takes_host_memory() ) + GAUXC_GENERIC_EXCEPTION("This Module Only Works With Host Reductions"); + + this->reduction_driver_->allreduce_inplace( VXCs, nbf*nbf, ReductionOp::Sum ); + this->reduction_driver_->allreduce_inplace( VXCz, nbf*nbf, ReductionOp::Sum ); + this->reduction_driver_->allreduce_inplace( VXCx, nbf*nbf, ReductionOp::Sum ); + this->reduction_driver_->allreduce_inplace( VXCy, nbf*nbf, ReductionOp::Sum ); + this->reduction_driver_->allreduce_inplace( EXC, 1 , ReductionOp::Sum ); + this->reduction_driver_->allreduce_inplace( &N_EL, 1 , ReductionOp::Sum ); + + }); + + +} + + template void ReferenceReplicatedXCHostIntegrator:: exc_vxc_local_work_( const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, + const value_type* Px, int64_t ldpx, + const value_type* Py, int64_t ldpy, value_type* VXCs, int64_t ldvxcs, - value_type* VXCz, int64_t ldvxcz, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCx, int64_t ldvxcx, + value_type* VXCy, int64_t ldvxcy, value_type* EXC, value_type *N_EL ) { - - const bool is_uks = (Pz != nullptr) and (VXCz != nullptr); - const bool is_rks = not is_uks; // TODO: GKS + const bool is_gks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx != nullptr) and (VXCy != nullptr); + const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx = nullptr) and (VXCy = nullptr); + const bool is_rks = not is_uks and not is_gks; // Cast LWD to LocalHostWorkDriver auto* lwd = dynamic_cast(this->local_work_driver_.get()); From 38d9e9e434f683293772cdb2bb7e43164967e273 Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 22:30:30 -0800 Subject: [PATCH 04/24] Fixed some GKS boilerplate bugs --- include/gauxc/xc_integrator.hpp | 2 +- .../gauxc/xc_integrator/replicated/impl.hpp | 2 ++ .../xc_integrator/xc_integrator_impl.hpp | 2 +- ...eference_replicated_xc_host_integrator.hpp | 2 +- ..._replicated_xc_host_integrator_exc_vxc.hpp | 2 +- .../replicated_xc_integrator_impl.cxx | 27 +++++++++++++++++++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/include/gauxc/xc_integrator.hpp b/include/gauxc/xc_integrator.hpp index 19b92c66..c5e7bda4 100644 --- a/include/gauxc/xc_integrator.hpp +++ b/include/gauxc/xc_integrator.hpp @@ -56,7 +56,7 @@ class XCIntegrator { value_type integrate_den( const MatrixType& ); exc_vxc_type_rks eval_exc_vxc ( const MatrixType& ); exc_vxc_type_uks eval_exc_vxc ( const MatrixType&, const MatrixType& ); - exc_vxc_type_uks eval_exc_vxc ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&); + exc_vxc_type_gks eval_exc_vxc ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&); exc_grad_type eval_exc_grad( const MatrixType& ); exx_type eval_exx ( const MatrixType&, const IntegratorSettingsEXX& = IntegratorSettingsEXX{} ); diff --git a/include/gauxc/xc_integrator/replicated/impl.hpp b/include/gauxc/xc_integrator/replicated/impl.hpp index 2f1bca5b..eaa2b0f0 100644 --- a/include/gauxc/xc_integrator/replicated/impl.hpp +++ b/include/gauxc/xc_integrator/replicated/impl.hpp @@ -101,6 +101,8 @@ typename ReplicatedXCIntegrator::exc_vxc_type_gks if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); matrix_type VXCz( Pz.rows(), Pz.cols() ); + matrix_type VXCx( Px.rows(), Px.cols() ); + matrix_type VXCy( Py.rows(), Py.cols() ); value_type EXC; pimpl_->eval_exc_vxc( Pscalar.rows(), Pscalar.cols(), Pscalar.data(), Pscalar.rows(), diff --git a/include/gauxc/xc_integrator/xc_integrator_impl.hpp b/include/gauxc/xc_integrator/xc_integrator_impl.hpp index dc92df89..05012918 100644 --- a/include/gauxc/xc_integrator/xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/xc_integrator_impl.hpp @@ -31,7 +31,7 @@ class XCIntegratorImpl { virtual value_type integrate_den_( const MatrixType& P ) = 0; virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P ) = 0; virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz ) = 0; - virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, , const MatrixType& Py ) = 0; + virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py ) = 0; virtual exc_grad_type eval_exc_grad_( const MatrixType& P ) = 0; virtual exx_type eval_exx_ ( const MatrixType& P, const IntegratorSettingsEXX& settings ) = 0; diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp index 66395d2f..da7a21c8 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp @@ -51,7 +51,7 @@ class ReferenceReplicatedXCHostIntegrator : value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, - value_type* VXCy, int64_t ldvxcy + value_type* VXCy, int64_t ldvxcy, value_type* EXC ) override; diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index baa5e8f2..a1ec1e1a 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -207,7 +207,7 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* EXC, value_type *N_EL ) { const bool is_gks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx != nullptr) and (VXCy != nullptr); - const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx = nullptr) and (VXCy = nullptr); + const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx == nullptr) and (VXCy == nullptr); const bool is_rks = not is_uks and not is_gks; // Cast LWD to LocalHostWorkDriver diff --git a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx index 6833e2f5..b04d48a6 100644 --- a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx +++ b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx @@ -59,6 +59,33 @@ void ReplicatedXCIntegratorImpl:: } +template +void ReplicatedXCIntegratorImpl:: + eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, + int64_t ldpscalar, + const value_type* Pz, + int64_t ldpz, + const value_type* Px, + int64_t ldpx, + const value_type* Py, + int64_t ldpy, + value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCx, int64_t ldvxcx, + value_type* VXCy, int64_t ldvxcy, + value_type* EXC ) { + + eval_exc_vxc_(m,n,Pscalar,ldpscalar, + Pz,ldpz, + Px,ldpx, + Py,ldpy, + VXCscalar,ldvxcscalar, + VXCz,ldvxcz, + VXCx,ldvxcx, + VXCy,ldvxcy,EXC); + +} + template void ReplicatedXCIntegratorImpl:: eval_exc_grad( int64_t m, int64_t n, const value_type* P, From 935fab2980869dc3213a2f2035b2512d59e54ac2 Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 23:09:11 -0800 Subject: [PATCH 05/24] Added GKS boilerplate to local host work driver --- .../host/local_host_work_driver.cxx | 51 +++++++++++++++++++ .../host/local_host_work_driver.hpp | 22 ++++++++ .../host/local_host_work_driver_pimpl.hpp | 19 ++++++- .../host/reference_local_host_work_driver.cxx | 31 ++++++++++- .../host/reference_local_host_work_driver.hpp | 24 +++++++-- 5 files changed, 141 insertions(+), 6 deletions(-) diff --git a/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx index 8de8b22f..64c12cf7 100644 --- a/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx @@ -147,6 +147,16 @@ void LocalHostWorkDriver::eval_uvvar_lda_uks( size_t npts, size_t nbe, } +void LocalHostWorkDriver::eval_uvvar_lda_gks( size_t npts, size_t nbe, + const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, + size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, + double* den_eval, double* K) { + + throw_if_invalid_pimpl(pimpl_); + pimpl_->eval_uvvar_lda_gks(npts, nbe, basis_eval, Xs, ldxs, Xz, ldxz, Xx, ldxx, Xy, ldxy, den_eval, K); + +} + // U/VVar GGA (density + grad, gamma) void LocalHostWorkDriver::eval_uvvar_gga_rks( size_t npts, size_t nbe, @@ -176,6 +186,21 @@ void LocalHostWorkDriver::eval_uvvar_gga_uks( size_t npts, size_t nbe, } +void LocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, + const double* basis_eval, const double* dbasis_x_eval, + const double *dbasis_y_eval, const double* dbasis_z_eval, const double* Xs, + size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, + const double* Xy, size_t ldxy, double* den_eval, double* dden_x_eval, double* dden_y_eval, + double* dden_z_eval, double* gamma, double* K, double* H ) { + + throw_if_invalid_pimpl(pimpl_); + pimpl_->eval_uvvar_gga_gks(npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, + dbasis_z_eval, Xs, ldxs, Xz, ldxz, Xx, ldxx, Xy, ldxy, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, + gamma, K, H); + +} + + // Eval Z Matrix LDA VXC void LocalHostWorkDriver::eval_zmat_lda_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* basis_eval, double* Z, size_t ldz ) { @@ -196,6 +221,18 @@ void LocalHostWorkDriver::eval_zmat_lda_vxc_uks( size_t npts, size_t nbe, } +void LocalHostWorkDriver::eval_zmat_lda_vxc_gks( size_t npts, size_t nbe, + const double* vrho, const double* basis_eval, double* Zs, size_t ldzs, + double* Zz, size_t ldzz,double* Zx, size_t ldzx, double* Zy, size_t ldzy, double* K ) { + + throw_if_invalid_pimpl(pimpl_); + pimpl_->eval_zmat_lda_vxc_gks(npts, nbe, vrho, basis_eval, Zs, ldzs, + Zz, ldzz, Zx, ldzx, Zy, ldzy, K); + + +} + + // Eval Z Matrix GGA VXC void LocalHostWorkDriver::eval_zmat_gga_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* vgamma, const double* basis_eval, @@ -225,6 +262,20 @@ void LocalHostWorkDriver::eval_zmat_gga_vxc_uks( size_t npts, size_t nbe, } +void LocalHostWorkDriver::eval_zmat_gga_vxc_gks( size_t npts, size_t nbe, + const double* vrho, const double* vgamma, const double* basis_eval, + const double* dbasis_x_eval, const double* dbasis_y_eval, + const double* dbasis_z_eval, const double* dden_x_eval, + const double* dden_y_eval, const double* dden_z_eval, double* Zs, size_t ldzs, + double* Zz, size_t ldzz, double* Zx, size_t ldzx,double* Zy, size_t ldzy, double* K, double* H ) { + + throw_if_invalid_pimpl(pimpl_); + pimpl_->eval_zmat_gga_vxc_gks(npts, nbe, vrho, vgamma, basis_eval, dbasis_x_eval, + dbasis_y_eval, dbasis_z_eval, dden_x_eval, dden_y_eval, dden_z_eval, + Zs, ldzs, Zz, ldzz, Zx, ldzx, Zy, ldzy, K, H); + +} + // Increment VXC by Z void LocalHostWorkDriver::inc_vxc( size_t npts, size_t nbf, size_t nbe, const double* basis_eval, const submat_map_t& submat_map, const double* Z, diff --git a/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp b/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp index 003066d5..f99dc31c 100644 --- a/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp +++ b/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp @@ -207,6 +207,11 @@ class LocalHostWorkDriver : public LocalWorkDriver { const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, double* den_eval); + void eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, + const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K); + + /** Evaluate the U and V variavles for RKS GGA * * U = rho + gradient @@ -238,6 +243,13 @@ class LocalHostWorkDriver : public LocalWorkDriver { const double* Xz, size_t ldxz, double* den_eval, double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma ); + void eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* dbasis_x_eavl, const double *dbasis_y_eval, + const double* dbasis_z_eval, const double* Xs, size_t ldxs, + const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, + const double* Xy, size_t ldxy, double* den_eval, + double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ); + /** Evaluate the VXC Z Matrix for RKS LDA * * Z(mu,i) = 0.5 * vrho(i) * B(mu, i) @@ -259,6 +271,10 @@ class LocalHostWorkDriver : public LocalWorkDriver { const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz ); + void eval_zmat_lda_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz, + double* Zx, size_t ldzx,double* Zy, size_t ldzy, double *K ); + /** Evaluate the VXC Z Matrix for RKS LDA * * Z(mu,i) = 0.5 * vrho(i) * B(mu, i) + @@ -293,6 +309,12 @@ class LocalHostWorkDriver : public LocalWorkDriver { const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz ); + void eval_zmat_gga_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* vgamma, const double* basis_eval, const double* dbasis_x_eval, + const double* dbasis_y_eval, const double* dbasis_z_eval, + const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, + double* Zs, size_t ldzs, double* Zz, size_t ldzz, double* Zx, size_t ldzx, + double* Zy, size_t ldzy, double* K, double* H ); /** Increment VXC integrand given Z / Collocation (RKS LDA+GGA) * diff --git a/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp b/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp index 5c9e7c28..1c645d81 100644 --- a/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp +++ b/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp @@ -71,6 +71,9 @@ struct LocalHostWorkDriverPIMPL { virtual void eval_uvvar_lda_uks( size_t npts, size_t nbe, const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, double* den_eval) = 0; + virtual void eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, + const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K) = 0; virtual void eval_uvvar_gga_rks( size_t npts, size_t nbe, const double* basis_eval, const double* dbasis_x_eavl, const double *dbasis_y_eval, @@ -83,12 +86,20 @@ struct LocalHostWorkDriverPIMPL { const double* Xz, size_t ldxz, double* den_eval, double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma ) = 0; - + virtual void eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* dbasis_x_eavl, const double *dbasis_y_eval, + const double* dbasis_z_eval, const double* Xs, size_t ldxs, + const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, + const double* Xy, size_t ldxy, double* den_eval, + double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ) = 0; virtual void eval_zmat_lda_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* basis_eval, double* Z, size_t ldz ) = 0; virtual void eval_zmat_lda_vxc_uks( size_t npts, size_t nbe, const double* vrho, const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz ) = 0; + virtual void eval_zmat_lda_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz, + double* Zx, size_t ldzx,double* Zy, size_t ldzy, double *K ) = 0; virtual void eval_zmat_gga_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* vgamma, const double* basis_eval, const double* dbasis_x_eval, @@ -100,6 +111,12 @@ struct LocalHostWorkDriverPIMPL { const double* dbasis_y_eval, const double* dbasis_z_eval, const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz ) = 0; + virtual void eval_zmat_gga_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* vgamma, const double* basis_eval, const double* dbasis_x_eval, + const double* dbasis_y_eval, const double* dbasis_z_eval, + const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, + double* Zs, size_t ldzs, double* Zz, size_t ldzz, double* Zx, size_t ldzx, + double* Zy, size_t ldzy, double* K, double* H ) = 0; virtual void inc_vxc( size_t npts, size_t nbf, size_t nbe, const double* basis_eval, const submat_map_t& submat_map, const double* Z, diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx index e1a13911..9ca80ccd 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx @@ -141,7 +141,13 @@ namespace GauXC { } - + void ReferenceLocalHostWorkDriver::eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, + const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K) { + + } + + void ReferenceLocalHostWorkDriver::eval_uvvar_gga_rks( size_t npts, size_t nbe, const double* basis_eval, const double* dbasis_x_eval, const double *dbasis_y_eval, const double* dbasis_z_eval, const double* X, @@ -226,6 +232,14 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_uks( size_t npts, size_t nbe, } +void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* dbasis_x_eavl, const double *dbasis_y_eval, + const double* dbasis_z_eval, const double* Xs, size_t ldxs, + const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, + const double* Xy, size_t ldxy, double* den_eval, + double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ) { + +} // Eval Z Matrix LDA VXC void ReferenceLocalHostWorkDriver::eval_zmat_lda_vxc_rks( size_t npts, size_t nbf, @@ -271,6 +285,12 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_uks( size_t npts, size_t nbe, } +void ReferenceLocalHostWorkDriver::eval_zmat_lda_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz, + double* Zx, size_t ldzx,double* Zy, size_t ldzy, double *K ) { + +} + // Eval Z Matrix GGA VXC void ReferenceLocalHostWorkDriver::eval_zmat_gga_vxc_rks( size_t npts, size_t nbf, const double* vrho, const double* vgamma, const double* basis_eval, @@ -362,6 +382,15 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_uks( size_t npts, size_t nbe, } } +void ReferenceLocalHostWorkDriver::eval_zmat_gga_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* vgamma, const double* basis_eval, const double* dbasis_x_eval, + const double* dbasis_y_eval, const double* dbasis_z_eval, + const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, + double* Zs, size_t ldzs, double* Zz, size_t ldzz, double* Zx, size_t ldzx, + double* Zy, size_t ldzy, double* K, double* H ) { + +} + // Increment VXC by Z void ReferenceLocalHostWorkDriver::inc_vxc( size_t npts, size_t nbf, size_t nbe, const double* basis_eval, const submat_map_t& submat_map, const double* Z, diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp index 55fa27c5..20c153dd 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp @@ -72,6 +72,10 @@ struct ReferenceLocalHostWorkDriver : public detail::LocalHostWorkDriverPIMPL { void eval_uvvar_lda_uks( size_t npts, size_t nbe, const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, double* den_eval) override; + void eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, + const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, + double* den_eval, double* K) override; void eval_uvvar_gga_rks( size_t npts, size_t nbe, const double* basis_eval, const double* dbasis_x_eval, const double *dbasis_y_eval, @@ -84,13 +88,21 @@ struct ReferenceLocalHostWorkDriver : public detail::LocalHostWorkDriverPIMPL { const double* Xz, size_t ldxz, double* den_eval, double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma ) override; - + void eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* basis_eval, + const double* dbasis_x_eavl, const double *dbasis_y_eval, + const double* dbasis_z_eval, const double* Xs, size_t ldxs, + const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, + const double* Xy, size_t ldxy, double* den_eval, + double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, + double* K, double* H ) override; void eval_zmat_lda_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* basis_eval, double* Z, size_t ldz ) override; void eval_zmat_lda_vxc_uks( size_t npts, size_t nbe, const double* vrho, const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz ) override; - + void eval_zmat_lda_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz, + double* Zx, size_t ldzx,double* Zy, size_t ldzy, double *K ) override; void eval_zmat_gga_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* vgamma, const double* basis_eval, const double* dbasis_x_eval, @@ -102,8 +114,12 @@ struct ReferenceLocalHostWorkDriver : public detail::LocalHostWorkDriverPIMPL { const double* dbasis_y_eval, const double* dbasis_z_eval, const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz ) override; - - + void eval_zmat_gga_vxc_gks( size_t npts, size_t nbe, const double* vrho, + const double* vgamma, const double* basis_eval, const double* dbasis_x_eval, + const double* dbasis_y_eval, const double* dbasis_z_eval, + const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, + double* Zs, size_t ldzs, double* Zz, size_t ldzz, double* Zx, size_t ldzx, + double* Zy, size_t ldzy, double* K, double* H ) override; void inc_vxc( size_t npts, size_t nbf, size_t nbe, From 0c11f74bbc39a9b6731f3baee60fd2d321ebc950 Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 23:25:52 -0800 Subject: [PATCH 06/24] Implemented GKS UVVARS functions --- .../host/reference_local_host_work_driver.cxx | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx index 9ca80ccd..9a56ea01 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx @@ -145,6 +145,43 @@ namespace GauXC { const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K) { + for( int32_t i = 0; i < (int32_t)npts; ++i ) { + + const size_t ioffs = size_t(i) * ldxs; + const size_t ioffz = size_t(i) * ldxz; + const size_t ioffx = size_t(i) * ldxx; + const size_t ioffy = size_t(i) * ldxy; + + const auto* Xs_i = Xs + ioffs; + const auto* Xz_i = Xz + ioffz; + const auto* Xx_i = Xx + ioffx; + const auto* Xy_i = Xy + ioffy; + + const double rhos = blas::dot( nbe, basis_eval + ioffs, 1, Xs_i, 1 ); + const double rhoz = blas::dot( nbe, basis_eval + ioffz, 1, Xz_i, 1 ); + const double rhox = blas::dot( nbe, basis_eval + ioffx, 1, Xx_i, 1 ); + const double rhoy = blas::dot( nbe, basis_eval + ioffy, 1, Xy_i, 1 ); + + double mtemp = rhoz * rhoz + rhox * rhox + rhoy * rhoy; + double mnorm = 0; + + if (mtemp > 1.0e-24) { + mnorm = sqrt(mtemp); + K2[i] = rhoz / mnorm; + K3[i] = rhox / mnorm; + K4[i] = rhoy / mnorm; + } else { + mnorm = (1. / 3.) * (rhox + rhoy + rhoz); + K2[i] = 1. / 3.; + K3[i] = 1. / 3.; + K4[i] = 1. / 3.; + } + + den_eval[2*i] = 0.5*(rhos + mnorm); // rho_+ + den_eval[2*i+1] = 0.5*(rhos - mnorm); // rho_- + + } + } @@ -239,6 +276,121 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* Xy, size_t ldxy, double* den_eval, double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ) { + for( int32_t i = 0; i < (int32_t)npts; ++i ) { + + const size_t ioffs = size_t(i) * ldxs; + const size_t ioffz = size_t(i) * ldxz; + const size_t ioffx = size_t(i) * ldxx; + const size_t ioffy = size_t(i) * ldxy; + + const auto* Xs_i = Xs + ioffs; + const auto* Xz_i = Xz + ioffz; + const auto* Xx_i = Xx + ioffx; + const auto* Xy_i = Xy + ioffy; + + const double rhos = blas::dot( nbe, basis_eval + ioffs, 1, Xs_i, 1 ); + const double rhoz = blas::dot( nbe, basis_eval + ioffz, 1, Xz_i, 1 ); + const double rhox = blas::dot( nbe, basis_eval + ioffx, 1, Xx_i, 1 ); + const double rhoy = blas::dot( nbe, basis_eval + ioffy, 1, Xy_i, 1 ); + + const auto dndx = + 2. * blas::dot( nbe, dbasis_x_eval + ioffs, 1, Xs_i, 1 ); + const auto dndy = + 2. * blas::dot( nbe, dbasis_y_eval + ioffs, 1, Xs_i, 1 ); + const auto dndz = + 2. * blas::dot( nbe, dbasis_z_eval + ioffs, 1, Xs_i, 1 ); + + const auto dMzdx = + 2. * blas::dot( nbe, dbasis_x_eval + ioffz, 1, Xz_i, 1 ); + const auto dMzdy = + 2. * blas::dot( nbe, dbasis_y_eval + ioffz, 1, Xz_i, 1 ); + const auto dMzdz = + 2. * blas::dot( nbe, dbasis_z_eval + ioffz, 1, Xz_i, 1 ); + + const auto dMxdx = + 2. * blas::dot( nbe, dbasis_x_eval + ioffx, 1, Xx_i, 1 ); + const auto dMxdy = + 2. * blas::dot( nbe, dbasis_y_eval + ioffx, 1, Xx_i, 1 ); + const auto dMxdz = + 2. * blas::dot( nbe, dbasis_z_eval + ioffx, 1, Xx_i, 1 ); + + const auto dMydx = + 2. * blas::dot( nbe, dbasis_x_eval + ioffy, 1, Xy_i, 1 ); + const auto dMydy = + 2. * blas::dot( nbe, dbasis_y_eval + ioffy, 1, Xy_i, 1 ); + const auto dMydz = + 2. * blas::dot( nbe, dbasis_z_eval + ioffy, 1, Xy_i, 1 ); + + + dden_x_eval[4 * i] = dndx; + dden_y_eval[4 * i] = dndy; + dden_z_eval[4 * i] = dndz; + + dden_x_eval[4 * i + 1] = dMzdx; + dden_y_eval[4 * i + 1] = dMzdy; + dden_z_eval[4 * i + 1] = dMzdz; + + dden_x_eval[4 * i + 2] = dMxdx; + dden_y_eval[4 * i + 2] = dMxdy; + dden_z_eval[4 * i + 2] = dMxdz; + + dden_x_eval[4 * i + 3] = dMydx; + dden_y_eval[4 * i + 3] = dMydy; + dden_z_eval[4 * i + 3] = dMydz; + + double mtemp = rhoz * rhoz + rhox * rhox + rhoy * rhoy; + double mnorm = 0; + + auto dels_dot_dels = dndx * dndx + dndy * dndy + dndz * dndz; + auto delz_dot_delz = dMzdx * dMzdx + dMzdy * dMzdy + dMzdz * dMzdz; + auto delx_dot_delx = dMxdx * dMxdx + dMxdy * dMxdy + dMxdz * dMxdz; + auto dely_dot_dely = dMydx * dMydx + dMydy * dMydy + dMydz * dMydz; + + auto dels_dot_delz = dndx * dMzdx + dndy * dMzdy + dndz * dMzdz; + auto dels_dot_delx = dndx * dMxdx + dndy * dMxdy + dndz * dMxdz; + auto dels_dot_dely = dndx * dMydx + dndy * dMydy + dndz * dMydz; + + auto sum = delz_dot_delz + delx_dot_delx + dely_dot_dely; + auto s_sum = + dels_dot_delz * rhoz + dels_dot_delx * rhox + dels_dot_dely * rhoy; + + auto sqsum2 = + sqrt(dels_dot_delz * dels_dot_delz + dels_dot_delx * dels_dot_delx + + dels_dot_dely * dels_dot_dely); + + double sign = 1.; + if (std::signbit(s_sum)) + sign = -1.; + + if (mtemp > 1.0e-24) { + mnorm = sqrt(mtemp); + K2[i] = rhoz / mnorm; + K3[i] = rhox / mnorm; + K4[i] = rhoy / mnorm; + H2[i] = sign * dels_dot_delz / sqsum2; + H3[i] = sign * dels_dot_delx / sqsum2; + H4[i] = sign * dels_dot_dely / sqsum2; + } else { + mnorm = (1. / 3.) * (rhox + rhoy + rhoz); + K2[i] = 1. / 3.; + K3[i] = 1. / 3.; + K4[i] = 1. / 3.; + + H2[i] = sign / 3.; + H3[i] = sign / 3.; + H4[i] = sign / 3.; + } + + den_eval[2 * i] = 0.5 * (rhos + mnorm); + den_eval[2 * i + 1] = 0.5 * (rhos - mnorm); + + gamma[3 * i] = 0.25 * (dels_dot_dels + sum) + 0.5 * sign * sqsum2; + gamma[3 * i + 1] = 0.25 * (dels_dot_dels - sum); + gamma[3 * i + 2] = 0.25 * (dels_dot_dels + sum) - 0.5 * sign * sqsum2; + + + } + } // Eval Z Matrix LDA VXC From 6c289e4c87b8f798ddef675e95c0422cfe0c94c1 Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 23:31:52 -0800 Subject: [PATCH 07/24] Fixed some typos for the GKS UVVAR implementation --- .../host/reference_local_host_work_driver.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx index 9a56ea01..b60a0d8d 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx @@ -145,6 +145,11 @@ namespace GauXC { const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K) { + + auto *K2 = K; // KZ // store K in the Z matrix + auto *K3 = K2 + npts; + auto *K4 = K3 + npts; + for( int32_t i = 0; i < (int32_t)npts; ++i ) { const size_t ioffs = size_t(i) * ldxs; @@ -270,12 +275,20 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_uks( size_t npts, size_t nbe, } void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* basis_eval, - const double* dbasis_x_eavl, const double *dbasis_y_eval, + const double* dbasis_x_eval, const double *dbasis_y_eval, const double* dbasis_z_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ) { + auto *K2 = K; // KZ // store K in the Z matrix + auto *K3 = K2 + npts; + auto *K4 = K3 + npts; + + auto *H2 = H; // KZ // store K in the Z matrix + auto *H3 = H2 + npts; + auto *H4 = H3 + npts; + for( int32_t i = 0; i < (int32_t)npts; ++i ) { const size_t ioffs = size_t(i) * ldxs; From 6cdbe1c6ea18e1718eb2ced2e788ae5c93ee7034 Mon Sep 17 00:00:00 2001 From: elambros Date: Wed, 15 Nov 2023 23:58:54 -0800 Subject: [PATCH 08/24] Implemented EVAL_ZMAT for GKS --- .../host/reference_local_host_work_driver.cxx | 132 +++++++++++++++++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx index b60a0d8d..a7a43a7c 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx @@ -454,6 +454,34 @@ void ReferenceLocalHostWorkDriver::eval_zmat_lda_vxc_gks( size_t npts, size_t nb const double* basis_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz, double* Zx, size_t ldzx,double* Zy, size_t ldzy, double *K ) { + auto *KZ = K; // KZ // store K in the Z matrix + auto *KX = KZ + npts; + auto *KY = KX + npts; + + blas::lacpy( 'A', nbe, npts, basis_eval, nbe, Zs, ldzs); + blas::lacpy( 'A', nbe, npts, basis_eval, nbe, Zz, ldzz); + blas::lacpy( 'A', nbe, npts, basis_eval, nbe, Zx, ldzx); + blas::lacpy( 'A', nbe, npts, basis_eval, nbe, Zy, ldzy); + + for( int32_t i = 0; i < (int32_t)npts; ++i ) { + + auto* zs_col = Zs + i*ldzs; + auto* zz_col = Zz + i*ldzz; + auto* zx_col = Zx + i*ldzx; + auto* zy_col = Zy + i*ldzy; + + const double factp = 0.5 * vrho[2*i]; + const double factm = 0.5 * vrho[2*i+1]; + const double factor = 0.5 * (factp - factm); + + //eq. 56 https://doi.org/10.1140/epjb/e2018-90170-1 + GauXC::blas::scal( nbe, 0.5*(factp + factm), zs_col, 1 ); + GauXC::blas::scal( nbe, KZ[i] * factor, zz_col, 1 ); + GauXC::blas::scal( nbe, KX[i] * factor, zx_col, 1 ); + GauXC::blas::scal( nbe, KY[i] * factor, zy_col, 1 ); + + } + } // Eval Z Matrix GGA VXC @@ -547,13 +575,115 @@ void ReferenceLocalHostWorkDriver::eval_zmat_lda_vxc_gks( size_t npts, size_t nb } } -void ReferenceLocalHostWorkDriver::eval_zmat_gga_vxc_gks( size_t npts, size_t nbe, const double* vrho, +void ReferenceLocalHostWorkDriver::eval_zmat_gga_vxc_gks( size_t npts, size_t nbf, const double* vrho, const double* vgamma, const double* basis_eval, const double* dbasis_x_eval, const double* dbasis_y_eval, const double* dbasis_z_eval, const double* dden_x_eval, const double* dden_y_eval, const double* dden_z_eval, double* Zs, size_t ldzs, double* Zz, size_t ldzz, double* Zx, size_t ldzx, double* Zy, size_t ldzy, double* K, double* H ) { + auto *KZ = K; // KZ // store K in the Z matrix + auto *KX = KZ + npts; + auto *KY = KX + npts; + + auto *HZ = H; // KZ // store K in the Z matrix + auto *HX = HZ + npts; + auto *HY = HX + npts; + + if( ldzs != nbf ) GAUXC_GENERIC_EXCEPTION(std::string("INVALID DIMS")); + if( ldzz != nbf ) GAUXC_GENERIC_EXCEPTION(std::string("INVALID DIMS")); + if( ldzx != nbf ) GAUXC_GENERIC_EXCEPTION(std::string("INVALID DIMS")); + if( ldzy != nbf ) GAUXC_GENERIC_EXCEPTION(std::string("INVALID DIMS")); + + blas::lacpy( 'A', nbf, npts, basis_eval, nbf, Zs, ldzs); + blas::lacpy( 'A', nbf, npts, basis_eval, nbf, Zz, ldzz); + blas::lacpy( 'A', nbf, npts, basis_eval, nbf, Zx, ldzx); + blas::lacpy( 'A', nbf, npts, basis_eval, nbf, Zy, ldzy); + + + for( int32_t i = 0; i < (int32_t)npts; ++i ) { + + const int32_t ioff = i * nbf; + + auto* zs_col = Zs + ioff; + auto* zz_col = Zz + ioff; + auto* zx_col = Zx + ioff; + auto* zy_col = Zy + ioff; + + auto* bf_x_col = dbasis_x_eval + ioff; + auto* bf_y_col = dbasis_y_eval + ioff; + auto* bf_z_col = dbasis_z_eval + ioff; + + const double factp = 0.5 * vrho[2*i]; + const double factm = 0.5 * vrho[2*i+1]; + const double factor = 0.5 * (factp - factm); + + GauXC::blas::scal( nbf, 0.5*(factp + factm), zs_col, 1 ); //additional 0.5 is from eq 56 in petrone 2018 eur phys journal b "an efficent implementation of .. " + GauXC::blas::scal( nbf, KZ[i]*factor, zz_col, 1 ); + GauXC::blas::scal( nbf, KX[i]*factor, zx_col, 1 ); + GauXC::blas::scal( nbf, KY[i]*factor, zy_col, 1 ); + + const auto gga_fact_pp = vgamma[3 * i]; + const auto gga_fact_pm = vgamma[3 * i + 1]; + const auto gga_fact_mm = vgamma[3 * i + 2]; + + const auto gga_fact_1 = 0.5 * (gga_fact_pp + gga_fact_pm + gga_fact_mm); + const auto gga_fact_2 = 0.5 * (gga_fact_pp - gga_fact_mm); + const auto gga_fact_3 = 0.5 * (gga_fact_pp - gga_fact_pm + gga_fact_mm); + + const auto x_fact_s = gga_fact_1 * dden_x_eval[4 * i] + + gga_fact_2 * (HZ[i] * dden_x_eval[4 * i + 1] + + HX[i] * dden_x_eval[4 * i + 2] + + HY[i] * dden_x_eval[4 * i + 3]); + const auto y_fact_s = gga_fact_1 * dden_y_eval[4 * i] + + gga_fact_2 * (HZ[i] * dden_y_eval[4 * i + 1] + + HX[i] * dden_y_eval[4 * i + 2] + + HY[i] * dden_y_eval[4 * i + 3]); + const auto z_fact_s = gga_fact_1 * dden_z_eval[4 * i] + + gga_fact_2 * (HZ[i] * dden_z_eval[4 * i + 1] + + HX[i] * dden_z_eval[4 * i + 2] + + HY[i] * dden_z_eval[4 * i + 3]); + + const auto x_fact_z = gga_fact_3 * dden_x_eval[4 * i + 1] + + gga_fact_2 * HZ[i] * dden_x_eval[4 * i]; + const auto y_fact_z = gga_fact_3 * dden_y_eval[4 * i + 1] + + gga_fact_2 * HZ[i] * dden_y_eval[4 * i]; + const auto z_fact_z = gga_fact_3 * dden_z_eval[4 * i + 1] + + gga_fact_2 * HZ[i] * dden_z_eval[4 * i]; + + const auto x_fact_x = gga_fact_3 * dden_x_eval[4 * i + 2] + + gga_fact_2 * HX[i] * dden_x_eval[4 * i]; + const auto y_fact_x = gga_fact_3 * dden_y_eval[4 * i + 2] + + gga_fact_2 * HX[i] * dden_y_eval[4 * i]; + const auto z_fact_x = gga_fact_3 * dden_z_eval[4 * i + 2] + + gga_fact_2 * HX[i] * dden_z_eval[4 * i]; + + const auto x_fact_y = gga_fact_3 * dden_x_eval[4 * i + 3] + + gga_fact_2 * HY[i] * dden_x_eval[4 * i]; + const auto y_fact_y = gga_fact_3 * dden_y_eval[4 * i + 3] + + gga_fact_2 * HY[i] * dden_y_eval[4 * i]; + const auto z_fact_y = gga_fact_3 * dden_z_eval[4 * i + 3] + + gga_fact_2 * HY[i] * dden_z_eval[4 * i]; + + + blas::axpy(nbf, x_fact_s, bf_x_col, 1, zs_col, 1); + blas::axpy(nbf, y_fact_s, bf_y_col, 1, zs_col, 1); + blas::axpy(nbf, z_fact_s, bf_z_col, 1, zs_col, 1); + + blas::axpy(nbf, x_fact_z, bf_x_col, 1, zz_col, 1); + blas::axpy(nbf, y_fact_z, bf_y_col, 1, zz_col, 1); + blas::axpy(nbf, z_fact_z, bf_z_col, 1, zz_col, 1); + + blas::axpy(nbf, x_fact_x, bf_x_col, 1, zx_col, 1); + blas::axpy(nbf, y_fact_x, bf_y_col, 1, zx_col, 1); + blas::axpy(nbf, z_fact_x, bf_z_col, 1, zx_col, 1); + + blas::axpy(nbf, x_fact_y, bf_x_col, 1, zy_col, 1); + blas::axpy(nbf, y_fact_y, bf_y_col, 1, zy_col, 1); + blas::axpy(nbf, z_fact_y, bf_z_col, 1, zy_col, 1); + + } + } // Increment VXC by Z From c1d0138bfd9515e6d2080f0fc49483b8dd96c99b Mon Sep 17 00:00:00 2001 From: elambros Date: Thu, 16 Nov 2023 00:34:19 -0800 Subject: [PATCH 09/24] Implemented GKS inside eval_exc_vxc_local_work --- ..._replicated_xc_host_integrator_exc_vxc.hpp | 73 +++++++++++++++++-- 1 file changed, 68 insertions(+), 5 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index a1ec1e1a..4ce558bd 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -245,13 +245,21 @@ void ReferenceReplicatedXCHostIntegrator:: VXCs[i + j*ldvxcs] = 0.; } } - if(is_uks) { + if(not is_rks) { for( auto j = 0; j < nbf; ++j ) { for( auto i = 0; i < nbf; ++i ) { VXCz[i + j*ldvxcz] = 0.; } } } + if(is_gks) { + for( auto j = 0; j < nbf; ++j ) { + for( auto i = 0; i < nbf; ++i ) { + VXCx[i + j*ldvxcx] = 0.; + VXCy[i + j*ldvxcy] = 0.; + } + } + } *EXC = 0.; @@ -281,10 +289,15 @@ void ReferenceReplicatedXCHostIntegrator:: // Allocate enough memory for batch - const size_t spin_dim_scal = is_rks ? 1 : 2; - // Things that every calc needs + size_t spin_dim_scal_temp = is_rks ? 1 : 2; + spin_dim_scal_temp *= is_gks ? 2 : 1; + const size_t spin_dim_scal = spin_dim_scal_temp; + + const size_t gks_mod_KH = is_gks ? 6*npts : 0; // used to store H and H + +// Things that every calc needs host_data.nbe_scr .resize(nbe * nbe); - host_data.zmat .resize(npts * nbe * spin_dim_scal); + host_data.zmat .resize(npts * nbe * spin_dim_scal + gks_mod_KH); host_data.eps .resize(npts); host_data.vrho .resize(npts * spin_dim_scal); @@ -310,9 +323,15 @@ void ReferenceReplicatedXCHostIntegrator:: auto* zmat = host_data.zmat.data(); decltype(zmat) zmat_z = nullptr; + decltype(zmat) zmat_x = nullptr; + decltype(zmat) zmat_y = nullptr; if(!is_rks) { zmat_z = zmat + nbe * npts; } + if(is_gks) { + zmat_x = zmat_z + nbe * npts; + zmat_y = zmat_x + nbe * npts; + } auto* eps = host_data.eps.data(); auto* gamma = host_data.gamma.data(); @@ -325,6 +344,10 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* dden_x_eval = nullptr; value_type* dden_y_eval = nullptr; value_type* dden_z_eval = nullptr; + value_type* K = nullptr; + value_type* H = nullptr; + + if (is_gks) { K = zmat + npts * nbe * 4; } if( func.is_gga() ) { dbasis_x_eval = basis_eval + npts * nbe; @@ -333,6 +356,7 @@ void ReferenceReplicatedXCHostIntegrator:: dden_x_eval = den_eval + spin_dim_scal * npts; dden_y_eval = dden_x_eval + spin_dim_scal * npts; dden_z_eval = dden_y_eval + spin_dim_scal * npts; + if (is_gks) { H = K + 3*npts;} } @@ -360,7 +384,12 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Pz, ldpz, basis_eval, nbe, zmat_z, nbe, nbe_scr); } - + if(is_gks) { + lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Px, ldpx, basis_eval, nbe, + zmat_x, nbe, nbe_scr); + lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Py, ldpy, basis_eval, nbe, + zmat_y, nbe, nbe_scr); + } // Evaluate U and V variables if( func.is_gga() ) { @@ -372,6 +401,12 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_uvvar_gga_uks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, zmat, nbe, zmat_z, nbe, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma ); + } else if(is_gks) { + lwd->eval_uvvar_gga_gks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, + dbasis_z_eval, zmat, nbe, zmat_z, nbe, zmat_x, nbe, zmat_y, nbe, den_eval, dden_x_eval, + dden_y_eval, dden_z_eval, gamma, K, H ); + } else { + GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); } } else { if(is_rks) { @@ -379,6 +414,11 @@ void ReferenceReplicatedXCHostIntegrator:: } else if(is_uks) { lwd->eval_uvvar_lda_uks( npts, nbe, basis_eval, zmat, nbe, zmat_z, nbe, den_eval ); + } else if(is_gks) { + lwd->eval_uvvar_lda_gks( npts, nbe, basis_eval, zmat, nbe, zmat_z, nbe, + zmat_x, nbe, zmat_y, nbe, den_eval, K ); + } else { + GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); } } @@ -417,12 +457,20 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_zmat_gga_vxc_uks( npts, nbe, vrho, vgamma, basis_eval, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe, zmat_z, nbe); + } else if(is_gks) { + lwd->eval_zmat_gga_vxc_gks( npts, nbe, vrho, vgamma, basis_eval, dbasis_x_eval, + dbasis_y_eval, dbasis_z_eval, dden_x_eval, dden_y_eval, + dden_z_eval, zmat, nbe, zmat_z, nbe, zmat_x, nbe, zmat_y, nbe, + K, H); } } else { if(is_rks) { lwd->eval_zmat_lda_vxc_rks( npts, nbe, vrho, basis_eval, zmat, nbe ); } else if(is_uks) { lwd->eval_zmat_lda_vxc_uks( npts, nbe, vrho, basis_eval, zmat, nbe, zmat_z, nbe ); + } else if(is_gks) { + lwd->eval_zmat_lda_vxc_gks( npts, nbe, vrho, basis_eval, zmat, nbe, zmat_z, nbe, + zmat_x, nbe, zmat_y, nbe, K); } } @@ -444,7 +492,14 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_z, nbe, VXCz, ldvxcz, nbe_scr); } + if(is_gks) { + lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_x, nbe, VXCx, ldvxcx, + nbe_scr); + lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_y, nbe, VXCy, ldvxcy, + nbe_scr); + } + } } // Loop over tasks @@ -464,6 +519,14 @@ void ReferenceReplicatedXCHostIntegrator:: } } } + if( is_gks) { + for( int32_t j = 0; j < nbf; ++j ) { + for( int32_t i = j+1; i < nbf; ++i ) { + VXCx[ j + i*ldvxcx ] = VXCx[ i + j*ldvxcx ]; + VXCy[ j + i*ldvxcy ] = VXCy[ i + j*ldvxcy ]; + } + } + } } From 5e0eea88638a8ca02dead60d2016fdd5cf564f25 Mon Sep 17 00:00:00 2001 From: elambros Date: Thu, 16 Nov 2023 01:20:27 -0800 Subject: [PATCH 10/24] added debug print statements --- ..._replicated_xc_host_integrator_exc_vxc.hpp | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index 4ce558bd..ae841a21 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -273,7 +273,7 @@ void ReferenceReplicatedXCHostIntegrator:: #pragma omp for schedule(dynamic) for( size_t iT = 0; iT < ntasks; ++iT ) { - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; //std::cout << iT << "/" << ntasks << std::endl; // Alias current task const auto& task = tasks[iT]; @@ -288,6 +288,7 @@ void ReferenceReplicatedXCHostIntegrator:: const int32_t* shell_list = task.bfn_screening.shell_list.data(); // Allocate enough memory for batch + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; size_t spin_dim_scal_temp = is_rks ? 1 : 2; spin_dim_scal_temp *= is_gks ? 2 : 1; @@ -306,7 +307,7 @@ void ReferenceReplicatedXCHostIntegrator:: host_data.basis_eval .resize( npts * nbe ); host_data.den_scr .resize( npts * spin_dim_scal); } - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; // GGA data requirements const size_t gga_dim_scal = is_rks ? 1 : 3; if( func.is_gga() ){ @@ -332,7 +333,7 @@ void ReferenceReplicatedXCHostIntegrator:: zmat_x = zmat_z + nbe * npts; zmat_y = zmat_x + nbe * npts; } - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; auto* eps = host_data.eps.data(); auto* gamma = host_data.gamma.data(); auto* vrho = host_data.vrho.data(); @@ -346,7 +347,7 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* dden_z_eval = nullptr; value_type* K = nullptr; value_type* H = nullptr; - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; if (is_gks) { K = zmat + npts * nbe * 4; } if( func.is_gga() ) { @@ -364,7 +365,7 @@ void ReferenceReplicatedXCHostIntegrator:: std::vector< std::array > submat_map; std::tie(submat_map, std::ignore) = gen_compressed_submat_map(basis_map, task.bfn_screening.shell_list, nbf, nbf); - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; // Evaluate Collocation (+ Grad) if( func.is_gga() ) lwd->eval_collocation_gradient( npts, nshells, nbe, points, basis, shell_list, @@ -373,7 +374,7 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_collocation( npts, nshells, nbe, points, basis, shell_list, basis_eval ); - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; // Evaluate X matrix (fac * P * B) -> store in Z const auto xmat_fac = is_rks ? 2.0 : 1.0; // TODO Fix for spinor RKS input lwd->eval_xmat( npts, nbf, nbe, submat_map, xmat_fac, Ps, ldps, basis_eval, nbe, @@ -384,13 +385,14 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Pz, ldpz, basis_eval, nbe, zmat_z, nbe, nbe_scr); } + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; if(is_gks) { lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Px, ldpx, basis_eval, nbe, zmat_x, nbe, nbe_scr); lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Py, ldpy, basis_eval, nbe, zmat_y, nbe, nbe_scr); } - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; // Evaluate U and V variables if( func.is_gga() ) { if(is_rks) { @@ -408,6 +410,7 @@ void ReferenceReplicatedXCHostIntegrator:: } else { GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); } + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; } else { if(is_rks) { lwd->eval_uvvar_lda_rks( npts, nbe, basis_eval, zmat, nbe, den_eval ); @@ -434,7 +437,7 @@ void ReferenceReplicatedXCHostIntegrator:: vrho[spin_dim_scal*i] *= weights[i]; if(not is_rks) vrho[spin_dim_scal*i+1] *= weights[i]; } - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; if( func.is_gga() ){ for( int32_t i = 0; i < npts; ++i ) { vgamma[gga_dim_scal*i] *= weights[i]; @@ -445,7 +448,7 @@ void ReferenceReplicatedXCHostIntegrator:: } } - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; // Evaluate Z matrix for VXC if( func.is_gga() ) { @@ -463,6 +466,7 @@ void ReferenceReplicatedXCHostIntegrator:: dden_z_eval, zmat, nbe, zmat_z, nbe, zmat_x, nbe, zmat_y, nbe, K, H); } + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; } else { if(is_rks) { lwd->eval_zmat_lda_vxc_rks( npts, nbe, vrho, basis_eval, zmat, nbe ); @@ -474,7 +478,7 @@ void ReferenceReplicatedXCHostIntegrator:: } } - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; // Incremeta LT of VXC #pragma omp critical { @@ -498,7 +502,7 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_y, nbe, VXCy, ldvxcy, nbe_scr); } - + std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; } From 9a1ca0a30552defd06d8759cf6de67b0ca4aea53 Mon Sep 17 00:00:00 2001 From: elambros Date: Thu, 16 Nov 2023 03:07:31 -0800 Subject: [PATCH 11/24] Fixed bug related to how spin_dim_scal is used for vrho indexing in GKS. Removed print statements --- ..._replicated_xc_host_integrator_exc_vxc.hpp | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index ae841a21..b953986c 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -165,7 +165,7 @@ void ReferenceReplicatedXCHostIntegrator:: // Temporary electron count to judge integrator accuracy value_type N_EL; - + // Compute Local contributions to EXC / VXC this->timer_.time_op("XCIntegrator.LocalWork", [&](){ exc_vxc_local_work_( Ps, ldps, Pz, ldpz, Px, ldpx, Py, ldpy, @@ -273,7 +273,7 @@ void ReferenceReplicatedXCHostIntegrator:: #pragma omp for schedule(dynamic) for( size_t iT = 0; iT < ntasks; ++iT ) { - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + //std::cout << iT << "/" << ntasks << std::endl; // Alias current task const auto& task = tasks[iT]; @@ -288,12 +288,12 @@ void ReferenceReplicatedXCHostIntegrator:: const int32_t* shell_list = task.bfn_screening.shell_list.data(); // Allocate enough memory for batch - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + size_t spin_dim_scal_temp = is_rks ? 1 : 2; spin_dim_scal_temp *= is_gks ? 2 : 1; const size_t spin_dim_scal = spin_dim_scal_temp; - + const size_t sds = is_rks ? 1 : 2; const size_t gks_mod_KH = is_gks ? 6*npts : 0; // used to store H and H // Things that every calc needs @@ -307,7 +307,7 @@ void ReferenceReplicatedXCHostIntegrator:: host_data.basis_eval .resize( npts * nbe ); host_data.den_scr .resize( npts * spin_dim_scal); } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + // GGA data requirements const size_t gga_dim_scal = is_rks ? 1 : 3; if( func.is_gga() ){ @@ -333,7 +333,7 @@ void ReferenceReplicatedXCHostIntegrator:: zmat_x = zmat_z + nbe * npts; zmat_y = zmat_x + nbe * npts; } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + auto* eps = host_data.eps.data(); auto* gamma = host_data.gamma.data(); auto* vrho = host_data.vrho.data(); @@ -347,7 +347,7 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* dden_z_eval = nullptr; value_type* K = nullptr; value_type* H = nullptr; - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + if (is_gks) { K = zmat + npts * nbe * 4; } if( func.is_gga() ) { @@ -365,7 +365,7 @@ void ReferenceReplicatedXCHostIntegrator:: std::vector< std::array > submat_map; std::tie(submat_map, std::ignore) = gen_compressed_submat_map(basis_map, task.bfn_screening.shell_list, nbf, nbf); - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + // Evaluate Collocation (+ Grad) if( func.is_gga() ) lwd->eval_collocation_gradient( npts, nshells, nbe, points, basis, shell_list, @@ -374,7 +374,7 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_collocation( npts, nshells, nbe, points, basis, shell_list, basis_eval ); - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + // Evaluate X matrix (fac * P * B) -> store in Z const auto xmat_fac = is_rks ? 2.0 : 1.0; // TODO Fix for spinor RKS input lwd->eval_xmat( npts, nbf, nbe, submat_map, xmat_fac, Ps, ldps, basis_eval, nbe, @@ -385,14 +385,14 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Pz, ldpz, basis_eval, nbe, zmat_z, nbe, nbe_scr); } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + if(is_gks) { lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Px, ldpx, basis_eval, nbe, zmat_x, nbe, nbe_scr); lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Py, ldpy, basis_eval, nbe, zmat_y, nbe, nbe_scr); } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + // Evaluate U and V variables if( func.is_gga() ) { if(is_rks) { @@ -410,7 +410,7 @@ void ReferenceReplicatedXCHostIntegrator:: } else { GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + } else { if(is_rks) { lwd->eval_uvvar_lda_rks( npts, nbe, basis_eval, zmat, nbe, den_eval ); @@ -434,10 +434,10 @@ void ReferenceReplicatedXCHostIntegrator:: // Factor weights into XC results for( int32_t i = 0; i < npts; ++i ) { eps[i] *= weights[i]; - vrho[spin_dim_scal*i] *= weights[i]; - if(not is_rks) vrho[spin_dim_scal*i+1] *= weights[i]; + vrho[sds*i] *= weights[i]; + if(not is_rks) vrho[sds*i+1] *= weights[i]; } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + if( func.is_gga() ){ for( int32_t i = 0; i < npts; ++i ) { vgamma[gga_dim_scal*i] *= weights[i]; @@ -448,7 +448,7 @@ void ReferenceReplicatedXCHostIntegrator:: } } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + // Evaluate Z matrix for VXC if( func.is_gga() ) { @@ -466,7 +466,7 @@ void ReferenceReplicatedXCHostIntegrator:: dden_z_eval, zmat, nbe, zmat_z, nbe, zmat_x, nbe, zmat_y, nbe, K, H); } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + } else { if(is_rks) { lwd->eval_zmat_lda_vxc_rks( npts, nbe, vrho, basis_eval, zmat, nbe ); @@ -478,7 +478,7 @@ void ReferenceReplicatedXCHostIntegrator:: } } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + // Incremeta LT of VXC #pragma omp critical { @@ -502,7 +502,7 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_y, nbe, VXCy, ldvxcy, nbe_scr); } - std::cout << __LINE__ << " " << __func__ << " " << __FILE__ << " " << std::endl; + } From 21e8b7f3d788c277ee3533e538b668402366f025 Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 10:52:35 -0800 Subject: [PATCH 12/24] Made a ternary operation more concise --- .../reference_replicated_xc_host_integrator_exc_vxc.hpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index b953986c..7ff98ecb 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -288,15 +288,12 @@ void ReferenceReplicatedXCHostIntegrator:: const int32_t* shell_list = task.bfn_screening.shell_list.data(); // Allocate enough memory for batch - - - size_t spin_dim_scal_temp = is_rks ? 1 : 2; - spin_dim_scal_temp *= is_gks ? 2 : 1; - const size_t spin_dim_scal = spin_dim_scal_temp; + + const size_t spin_dim_scal = is_rks ? 1 : is_uks ? 2 : 4; // last case is_gks const size_t sds = is_rks ? 1 : 2; const size_t gks_mod_KH = is_gks ? 6*npts : 0; // used to store H and H -// Things that every calc needs + // Things that every calc needs host_data.nbe_scr .resize(nbe * nbe); host_data.zmat .resize(npts * nbe * spin_dim_scal + gks_mod_KH); host_data.eps .resize(npts); From f7cbbfb8193b954ea698268948d0f0850a99632d Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 11:06:09 -0800 Subject: [PATCH 13/24] moved RKS/UKS/GKS to top of eval_exc_vxc_local_work --- .../reference_replicated_xc_host_integrator_exc_vxc.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index 7ff98ecb..739555c1 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -209,6 +209,9 @@ void ReferenceReplicatedXCHostIntegrator:: const bool is_gks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx != nullptr) and (VXCy != nullptr); const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx == nullptr) and (VXCy == nullptr); const bool is_rks = not is_uks and not is_gks; + if (not is_rks and not is_uks and not is_gks) { + GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); + } // Cast LWD to LocalHostWorkDriver auto* lwd = dynamic_cast(this->local_work_driver_.get()); @@ -404,8 +407,6 @@ void ReferenceReplicatedXCHostIntegrator:: lwd->eval_uvvar_gga_gks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, zmat, nbe, zmat_z, nbe, zmat_x, nbe, zmat_y, nbe, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, K, H ); - } else { - GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); } } else { @@ -417,8 +418,6 @@ void ReferenceReplicatedXCHostIntegrator:: } else if(is_gks) { lwd->eval_uvvar_lda_gks( npts, nbe, basis_eval, zmat, nbe, zmat_z, nbe, zmat_x, nbe, zmat_y, nbe, den_eval, K ); - } else { - GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); } } From b40a99894a0b8ba126031f78e15c5f02b9846a7c Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 12:59:21 -0800 Subject: [PATCH 14/24] Added IntegratorSettingsEXCVXC class for runtime KS configuration options. Using for GKS small density tolerance --- include/gauxc/xc_integrator.hpp | 9 ++++--- include/gauxc/xc_integrator/impl.hpp | 13 ++++----- .../gauxc/xc_integrator/replicated/impl.hpp | 13 ++++----- .../replicated_xc_integrator_impl.hpp | 12 ++++----- .../replicated_xc_integrator.hpp | 6 ++--- .../xc_integrator/xc_integrator_impl.hpp | 19 ++++++------- include/gauxc/xc_integrator_settings.hpp | 5 ++++ .../host/local_host_work_driver.cxx | 8 +++--- .../host/local_host_work_driver.hpp | 4 +-- .../host/local_host_work_driver_pimpl.hpp | 4 +-- .../host/reference_local_host_work_driver.cxx | 12 ++++++--- .../host/reference_local_host_work_driver.hpp | 4 +-- ...eference_replicated_xc_host_integrator.hpp | 8 +++--- ..._replicated_xc_host_integrator_exc_vxc.hpp | 27 ++++++++++++------- .../replicated_xc_integrator_impl.cxx | 12 ++++----- 15 files changed, 90 insertions(+), 66 deletions(-) diff --git a/include/gauxc/xc_integrator.hpp b/include/gauxc/xc_integrator.hpp index c5e7bda4..d9a59d73 100644 --- a/include/gauxc/xc_integrator.hpp +++ b/include/gauxc/xc_integrator.hpp @@ -54,9 +54,12 @@ class XCIntegrator { XCIntegrator( XCIntegrator&& ) noexcept; value_type integrate_den( const MatrixType& ); - exc_vxc_type_rks eval_exc_vxc ( const MatrixType& ); - exc_vxc_type_uks eval_exc_vxc ( const MatrixType&, const MatrixType& ); - exc_vxc_type_gks eval_exc_vxc ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&); + exc_vxc_type_rks eval_exc_vxc ( const MatrixType&, + const IntegratorSettingsEXCVXC& = IntegratorSettingsEXCVXC{} ); + exc_vxc_type_uks eval_exc_vxc ( const MatrixType&, const MatrixType&, + const IntegratorSettingsEXCVXC& = IntegratorSettingsEXCVXC{} ); + exc_vxc_type_gks eval_exc_vxc ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&, + const IntegratorSettingsEXCVXC& = IntegratorSettingsEXCVXC{}); exc_grad_type eval_exc_grad( const MatrixType& ); exx_type eval_exx ( const MatrixType&, const IntegratorSettingsEXX& = IntegratorSettingsEXX{} ); diff --git a/include/gauxc/xc_integrator/impl.hpp b/include/gauxc/xc_integrator/impl.hpp index faacdd55..05543524 100644 --- a/include/gauxc/xc_integrator/impl.hpp +++ b/include/gauxc/xc_integrator/impl.hpp @@ -33,23 +33,24 @@ typename XCIntegrator::value_type template typename XCIntegrator::exc_vxc_type_rks - XCIntegrator::eval_exc_vxc( const MatrixType& P ) { + XCIntegrator::eval_exc_vxc( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - return pimpl_->eval_exc_vxc(P); + return pimpl_->eval_exc_vxc(P, ks_settings); }; template typename XCIntegrator::exc_vxc_type_uks - XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz ) { + XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - return pimpl_->eval_exc_vxc(Pscalar, Pz); + return pimpl_->eval_exc_vxc(Pscalar, Pz, ks_settings); }; template typename XCIntegrator::exc_vxc_type_gks - XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py ) { + XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + const IntegratorSettingsEXCVXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - return pimpl_->eval_exc_vxc(Pscalar, Pz, Px, Py); + return pimpl_->eval_exc_vxc(Pscalar, Pz, Px, Py, ks_settings); }; template diff --git a/include/gauxc/xc_integrator/replicated/impl.hpp b/include/gauxc/xc_integrator/replicated/impl.hpp index eaa2b0f0..44e60d2a 100644 --- a/include/gauxc/xc_integrator/replicated/impl.hpp +++ b/include/gauxc/xc_integrator/replicated/impl.hpp @@ -63,14 +63,14 @@ typename ReplicatedXCIntegrator::value_type template typename ReplicatedXCIntegrator::exc_vxc_type_rks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& P ) { + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXC( P.rows(), P.cols() ); value_type EXC; pimpl_->eval_exc_vxc( P.rows(), P.cols(), P.data(), P.rows(), - VXC.data(), VXC.rows(), &EXC ); + VXC.data(), VXC.rows(), &EXC, ks_settings ); return std::make_tuple( EXC, VXC ); @@ -78,7 +78,7 @@ typename ReplicatedXCIntegrator::exc_vxc_type_rks template typename ReplicatedXCIntegrator::exc_vxc_type_uks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz ) { + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); @@ -88,7 +88,7 @@ typename ReplicatedXCIntegrator::exc_vxc_type_uks pimpl_->eval_exc_vxc( Pscalar.rows(), Pscalar.cols(), Pscalar.data(), Pscalar.rows(), Pz.data(), Pz.rows(), VXCscalar.data(), VXCscalar.rows(), - VXCz.data(), VXCz.rows(), &EXC ); + VXCz.data(), VXCz.rows(), &EXC, ks_settings ); return std::make_tuple( EXC, VXCscalar, VXCz ); @@ -96,7 +96,8 @@ typename ReplicatedXCIntegrator::exc_vxc_type_uks template typename ReplicatedXCIntegrator::exc_vxc_type_gks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py) { + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + const IntegratorSettingsEXCVXC& ks_settings) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); @@ -112,7 +113,7 @@ typename ReplicatedXCIntegrator::exc_vxc_type_gks VXCscalar.data(), VXCscalar.rows(), VXCz.data(), VXCz.rows(), VXCx.data(), VXCx.rows(), - VXCy.data(), VXCy.rows(), &EXC ); + VXCy.data(), VXCy.rows(), &EXC, ks_settings ); return std::make_tuple( EXC, VXCscalar, VXCz, VXCx, VXCy); diff --git a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp index be360a88..915618e2 100644 --- a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp @@ -40,14 +40,14 @@ class ReplicatedXCIntegratorImpl { int64_t ldp, value_type* N_EL ) = 0; virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) = 0; + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) = 0; virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, const value_type* Pz, int64_t ldpz, value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) = 0; + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) = 0; virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, const value_type* Pz, @@ -60,7 +60,7 @@ class ReplicatedXCIntegratorImpl { value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC ) = 0; + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) = 0; virtual void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD ) = 0; @@ -83,7 +83,7 @@ class ReplicatedXCIntegratorImpl { void eval_exc_vxc( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ); + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ); void eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, @@ -91,7 +91,7 @@ class ReplicatedXCIntegratorImpl { int64_t ldpz, value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ); + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ); void eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, const value_type* Pz, @@ -104,7 +104,7 @@ class ReplicatedXCIntegratorImpl { value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC ); + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ); void eval_exc_grad( int64_t m, int64_t n, const value_type* P, diff --git a/include/gauxc/xc_integrator/replicated_xc_integrator.hpp b/include/gauxc/xc_integrator/replicated_xc_integrator.hpp index c4718389..a89d49bb 100644 --- a/include/gauxc/xc_integrator/replicated_xc_integrator.hpp +++ b/include/gauxc/xc_integrator/replicated_xc_integrator.hpp @@ -40,9 +40,9 @@ class ReplicatedXCIntegrator : public XCIntegratorImpl { std::unique_ptr< pimpl_type > pimpl_; value_type integrate_den_( const MatrixType& ) override; - exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& ) override; - exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType&, const MatrixType& ) override; - exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType& ) override; + exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType&, const IntegratorSettingsEXCVXC& ) override; + exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const IntegratorSettingsEXCVXC&) override; + exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&, const IntegratorSettingsEXCVXC& ) override; exc_grad_type eval_exc_grad_( const MatrixType& ) override; exx_type eval_exx_ ( const MatrixType&, const IntegratorSettingsEXX& ) override; const util::Timer& get_timings_() const override; diff --git a/include/gauxc/xc_integrator/xc_integrator_impl.hpp b/include/gauxc/xc_integrator/xc_integrator_impl.hpp index 05012918..aadfd828 100644 --- a/include/gauxc/xc_integrator/xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/xc_integrator_impl.hpp @@ -29,9 +29,10 @@ class XCIntegratorImpl { protected: virtual value_type integrate_den_( const MatrixType& P ) = 0; - virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P ) = 0; - virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz ) = 0; - virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py ) = 0; + virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) = 0; + virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) = 0; + virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + const IntegratorSettingsEXCVXC& ks_settings ) = 0; virtual exc_grad_type eval_exc_grad_( const MatrixType& P ) = 0; virtual exx_type eval_exx_ ( const MatrixType& P, const IntegratorSettingsEXX& settings ) = 0; @@ -64,16 +65,16 @@ class XCIntegratorImpl { * @param[in] P The alpha density matrix * @returns EXC / VXC in a combined structure */ - exc_vxc_type_rks eval_exc_vxc( const MatrixType& P ) { - return eval_exc_vxc_(P); + exc_vxc_type_rks eval_exc_vxc( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) { + return eval_exc_vxc_(P, ks_settings); } - exc_vxc_type_uks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz ) { - return eval_exc_vxc_(Pscalar, Pz); + exc_vxc_type_uks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) { + return eval_exc_vxc_(Pscalar, Pz, ks_settings); } - exc_vxc_type_gks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py ) { - return eval_exc_vxc_(Pscalar, Pz, Px, Py); + exc_vxc_type_gks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsEXCVXC& ks_settings ) { + return eval_exc_vxc_(Pscalar, Pz, Px, Py, ks_settings); } /** Integrate EXC gradient for RKS diff --git a/include/gauxc/xc_integrator_settings.hpp b/include/gauxc/xc_integrator_settings.hpp index 7a8c5074..d75d202d 100644 --- a/include/gauxc/xc_integrator_settings.hpp +++ b/include/gauxc/xc_integrator_settings.hpp @@ -16,4 +16,9 @@ struct IntegratorSettingsSNLinK : public IntegratorSettingsEXX { double k_tol = 1e-10; }; +struct IntegratorSettingsEXCVXC { virtual ~IntegratorSettingsEXCVXC() noexcept = default; }; +struct IntegratorSettingsKS : public IntegratorSettingsEXCVXC { + double gks_dtol = 1e-12; +}; + } diff --git a/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx index 64c12cf7..32b3561a 100644 --- a/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/local_host_work_driver.cxx @@ -150,10 +150,10 @@ void LocalHostWorkDriver::eval_uvvar_lda_uks( size_t npts, size_t nbe, void LocalHostWorkDriver::eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, - double* den_eval, double* K) { + double* den_eval, double* K, const double dtol) { throw_if_invalid_pimpl(pimpl_); - pimpl_->eval_uvvar_lda_gks(npts, nbe, basis_eval, Xs, ldxs, Xz, ldxz, Xx, ldxx, Xy, ldxy, den_eval, K); + pimpl_->eval_uvvar_lda_gks(npts, nbe, basis_eval, Xs, ldxs, Xz, ldxz, Xx, ldxx, Xy, ldxy, den_eval, K, dtol); } @@ -191,12 +191,12 @@ void LocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, const double *dbasis_y_eval, const double* dbasis_z_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* dden_x_eval, double* dden_y_eval, - double* dden_z_eval, double* gamma, double* K, double* H ) { + double* dden_z_eval, double* gamma, double* K, double* H, const double dtol ) { throw_if_invalid_pimpl(pimpl_); pimpl_->eval_uvvar_gga_gks(npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, Xs, ldxs, Xz, ldxz, Xx, ldxx, Xy, ldxy, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, - gamma, K, H); + gamma, K, H, dtol); } diff --git a/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp b/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp index f99dc31c..54e6cdbe 100644 --- a/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp +++ b/src/xc_integrator/local_work_driver/host/local_host_work_driver.hpp @@ -209,7 +209,7 @@ class LocalHostWorkDriver : public LocalWorkDriver { void eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, - const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K); + const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K, const double dtol); /** Evaluate the U and V variavles for RKS GGA @@ -248,7 +248,7 @@ class LocalHostWorkDriver : public LocalWorkDriver { const double* dbasis_z_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, - double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ); + double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H, const double dtol ); /** Evaluate the VXC Z Matrix for RKS LDA * diff --git a/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp b/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp index 1c645d81..ea2035fb 100644 --- a/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp +++ b/src/xc_integrator/local_work_driver/host/local_host_work_driver_pimpl.hpp @@ -73,7 +73,7 @@ struct LocalHostWorkDriverPIMPL { double* den_eval) = 0; virtual void eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, - const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K) = 0; + const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K, const double dtol) = 0; virtual void eval_uvvar_gga_rks( size_t npts, size_t nbe, const double* basis_eval, const double* dbasis_x_eavl, const double *dbasis_y_eval, @@ -91,7 +91,7 @@ struct LocalHostWorkDriverPIMPL { const double* dbasis_z_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, - double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ) = 0; + double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H, const double dtol) = 0; virtual void eval_zmat_lda_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* basis_eval, double* Z, size_t ldz ) = 0; diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx index a7a43a7c..20d9c2cc 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx @@ -143,12 +143,14 @@ namespace GauXC { void ReferenceLocalHostWorkDriver::eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, - const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K) { + const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K, const double dtol) { auto *K2 = K; // KZ // store K in the Z matrix auto *K3 = K2 + npts; auto *K4 = K3 + npts; + + double dtolsq = dtol*dtol; for( int32_t i = 0; i < (int32_t)npts; ++i ) { @@ -170,7 +172,7 @@ namespace GauXC { double mtemp = rhoz * rhoz + rhox * rhox + rhoy * rhoy; double mnorm = 0; - if (mtemp > 1.0e-24) { + if (mtemp > dtolsq) { mnorm = sqrt(mtemp); K2[i] = rhoz / mnorm; K3[i] = rhox / mnorm; @@ -279,7 +281,7 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* dbasis_z_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, - double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H ) { + double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H, const double dtol) { auto *K2 = K; // KZ // store K in the Z matrix auto *K3 = K2 + npts; @@ -289,6 +291,8 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, auto *H3 = H2 + npts; auto *H4 = H3 + npts; + double dtolsq = dtol*dtol; + for( int32_t i = 0; i < (int32_t)npts; ++i ) { const size_t ioffs = size_t(i) * ldxs; @@ -375,7 +379,7 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, if (std::signbit(s_sum)) sign = -1.; - if (mtemp > 1.0e-24) { + if (mtemp > dtolsq) { mnorm = sqrt(mtemp); K2[i] = rhoz / mnorm; K3[i] = rhox / mnorm; diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp index 20c153dd..611597d0 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.hpp @@ -75,7 +75,7 @@ struct ReferenceLocalHostWorkDriver : public detail::LocalHostWorkDriverPIMPL { void eval_uvvar_lda_gks( size_t npts, size_t nbe, const double* basis_eval, const double* Xs, size_t ldxs, const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, - double* den_eval, double* K) override; + double* den_eval, double* K, const double dtol) override; void eval_uvvar_gga_rks( size_t npts, size_t nbe, const double* basis_eval, const double* dbasis_x_eval, const double *dbasis_y_eval, @@ -94,7 +94,7 @@ struct ReferenceLocalHostWorkDriver : public detail::LocalHostWorkDriverPIMPL { const double* Xz, size_t ldxz, const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, - double* K, double* H ) override; + double* K, double* H, const double dtol ) override; void eval_zmat_lda_vxc_rks( size_t npts, size_t nbe, const double* vrho, const double* basis_eval, double* Z, size_t ldz ) override; diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp index da7a21c8..7ab6445c 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp @@ -30,7 +30,7 @@ class ReferenceReplicatedXCHostIntegrator : void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) override; + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -38,7 +38,7 @@ class ReferenceReplicatedXCHostIntegrator : int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) override; + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -52,7 +52,7 @@ class ReferenceReplicatedXCHostIntegrator : value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC ) override; + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) override; void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, @@ -80,7 +80,7 @@ class ReferenceReplicatedXCHostIntegrator : value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, value_type *N_EL ); + value_type* EXC, value_type *N_EL, const IntegratorSettingsEXCVXC& ks_settings ); void exc_grad_local_work_( const value_type* P, int64_t ldp, value_type* EXC_GRAD ); void exx_local_work_( const value_type* P, int64_t ldp, value_type* K, int64_t ldk, diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index 739555c1..98235c0f 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -19,7 +19,7 @@ template void ReferenceReplicatedXCHostIntegrator:: eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { const auto& basis = this->load_balancer_->basis(); @@ -45,7 +45,7 @@ void ReferenceReplicatedXCHostIntegrator:: this->timer_.time_op("XCIntegrator.LocalWork", [&](){ //exc_vxc_local_work_( P, ldp, VXC, ldvxc, EXC, &N_EL ); exc_vxc_local_work_( P, ldp, nullptr, 0, nullptr, 0, nullptr, 0, - VXC, ldvxc, nullptr, 0, nullptr, 0, nullptr, 0, EXC, &N_EL ); + VXC, ldvxc, nullptr, 0, nullptr, 0, nullptr, 0, EXC, &N_EL, ks_settings ); }); @@ -71,7 +71,7 @@ void ReferenceReplicatedXCHostIntegrator:: int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings) { const auto& basis = this->load_balancer_->basis(); @@ -99,7 +99,7 @@ void ReferenceReplicatedXCHostIntegrator:: // Compute Local contributions to EXC / VXC this->timer_.time_op("XCIntegrator.LocalWork", [&](){ exc_vxc_local_work_( Ps, ldps, Pz, ldpz, nullptr, 0,nullptr, 0, - VXCs, ldvxcs, VXCz, ldvxcz, nullptr, 0, nullptr, 0, EXC, &N_EL ); + VXCs, ldvxcs, VXCz, ldvxcz, nullptr, 0, nullptr, 0, EXC, &N_EL, ks_settings ); }); @@ -133,7 +133,7 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { const auto& basis = this->load_balancer_->basis(); @@ -170,7 +170,7 @@ void ReferenceReplicatedXCHostIntegrator:: this->timer_.time_op("XCIntegrator.LocalWork", [&](){ exc_vxc_local_work_( Ps, ldps, Pz, ldpz, Px, ldpx, Py, ldpy, VXCs, ldvxcs, VXCz, ldvxcz, - VXCx, ldvxcx, VXCy, ldvxcy, EXC, &N_EL ); + VXCx, ldvxcx, VXCy, ldvxcy, EXC, &N_EL, ks_settings ); }); @@ -204,7 +204,7 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, value_type *N_EL ) { + value_type* EXC, value_type *N_EL, const IntegratorSettingsEXCVXC& settings) { const bool is_gks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx != nullptr) and (VXCy != nullptr); const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx == nullptr) and (VXCy == nullptr); @@ -213,6 +213,15 @@ void ReferenceReplicatedXCHostIntegrator:: GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); } + + // Misc KS settings + IntegratorSettingsKS ks_settings; + if( auto* tmp = dynamic_cast(&settings) ) { + ks_settings = *tmp; + } + + const double gks_dtol = ks_settings.gks_dtol; + // Cast LWD to LocalHostWorkDriver auto* lwd = dynamic_cast(this->local_work_driver_.get()); @@ -406,7 +415,7 @@ void ReferenceReplicatedXCHostIntegrator:: } else if(is_gks) { lwd->eval_uvvar_gga_gks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, zmat, nbe, zmat_z, nbe, zmat_x, nbe, zmat_y, nbe, den_eval, dden_x_eval, - dden_y_eval, dden_z_eval, gamma, K, H ); + dden_y_eval, dden_z_eval, gamma, K, H, gks_dtol ); } } else { @@ -417,7 +426,7 @@ void ReferenceReplicatedXCHostIntegrator:: den_eval ); } else if(is_gks) { lwd->eval_uvvar_lda_gks( npts, nbe, basis_eval, zmat, nbe, zmat_z, nbe, - zmat_x, nbe, zmat_y, nbe, den_eval, K ); + zmat_x, nbe, zmat_y, nbe, den_eval, K, gks_dtol ); } } diff --git a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx index b04d48a6..79ee99e0 100644 --- a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx +++ b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx @@ -36,9 +36,9 @@ template void ReplicatedXCIntegratorImpl:: eval_exc_vxc( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { - eval_exc_vxc_(m,n,P,ldp,VXC,ldvxc,EXC); + eval_exc_vxc_(m,n,P,ldp,VXC,ldvxc,EXC,ks_settings); } @@ -50,12 +50,12 @@ void ReplicatedXCIntegratorImpl:: int64_t ldpz, value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings) { eval_exc_vxc_(m,n,Pscalar,ldpscalar, Pz,ldpz, VXCscalar,ldvxcscalar, - VXCz,ldvxcz,EXC); + VXCz,ldvxcz,EXC, ks_settings); } @@ -73,7 +73,7 @@ void ReplicatedXCIntegratorImpl:: value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { eval_exc_vxc_(m,n,Pscalar,ldpscalar, Pz,ldpz, @@ -82,7 +82,7 @@ void ReplicatedXCIntegratorImpl:: VXCscalar,ldvxcscalar, VXCz,ldvxcz, VXCx,ldvxcx, - VXCy,ldvxcy,EXC); + VXCy,ldvxcy,EXC, ks_settings); } From fd1ab77b81bd0160858e63c2dd7eb258aa357a77 Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 14:06:07 -0800 Subject: [PATCH 15/24] Changed IntegratorSettingsEXCVXC -> IntegratorSettingsXC --- include/gauxc/xc_integrator.hpp | 6 +++--- include/gauxc/xc_integrator/impl.hpp | 6 +++--- include/gauxc/xc_integrator/replicated/impl.hpp | 6 +++--- .../replicated/replicated_xc_integrator_impl.hpp | 12 ++++++------ .../gauxc/xc_integrator/replicated_xc_integrator.hpp | 6 +++--- include/gauxc/xc_integrator/xc_integrator_impl.hpp | 12 ++++++------ include/gauxc/xc_integrator_settings.hpp | 4 ++-- .../host/reference_replicated_xc_host_integrator.hpp | 8 ++++---- ...ference_replicated_xc_host_integrator_exc_vxc.hpp | 8 ++++---- .../replicated/replicated_xc_integrator_impl.cxx | 6 +++--- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/include/gauxc/xc_integrator.hpp b/include/gauxc/xc_integrator.hpp index d9a59d73..3cffcf7e 100644 --- a/include/gauxc/xc_integrator.hpp +++ b/include/gauxc/xc_integrator.hpp @@ -55,11 +55,11 @@ class XCIntegrator { value_type integrate_den( const MatrixType& ); exc_vxc_type_rks eval_exc_vxc ( const MatrixType&, - const IntegratorSettingsEXCVXC& = IntegratorSettingsEXCVXC{} ); + const IntegratorSettingsXC& = IntegratorSettingsXC{} ); exc_vxc_type_uks eval_exc_vxc ( const MatrixType&, const MatrixType&, - const IntegratorSettingsEXCVXC& = IntegratorSettingsEXCVXC{} ); + const IntegratorSettingsXC& = IntegratorSettingsXC{} ); exc_vxc_type_gks eval_exc_vxc ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&, - const IntegratorSettingsEXCVXC& = IntegratorSettingsEXCVXC{}); + const IntegratorSettingsXC& = IntegratorSettingsXC{}); exc_grad_type eval_exc_grad( const MatrixType& ); exx_type eval_exx ( const MatrixType&, const IntegratorSettingsEXX& = IntegratorSettingsEXX{} ); diff --git a/include/gauxc/xc_integrator/impl.hpp b/include/gauxc/xc_integrator/impl.hpp index 05543524..8e3d376d 100644 --- a/include/gauxc/xc_integrator/impl.hpp +++ b/include/gauxc/xc_integrator/impl.hpp @@ -33,14 +33,14 @@ typename XCIntegrator::value_type template typename XCIntegrator::exc_vxc_type_rks - XCIntegrator::eval_exc_vxc( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) { + XCIntegrator::eval_exc_vxc( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); return pimpl_->eval_exc_vxc(P, ks_settings); }; template typename XCIntegrator::exc_vxc_type_uks - XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) { + XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); return pimpl_->eval_exc_vxc(Pscalar, Pz, ks_settings); }; @@ -48,7 +48,7 @@ typename XCIntegrator::exc_vxc_type_uks template typename XCIntegrator::exc_vxc_type_gks XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, - const IntegratorSettingsEXCVXC& ks_settings ) { + const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); return pimpl_->eval_exc_vxc(Pscalar, Pz, Px, Py, ks_settings); }; diff --git a/include/gauxc/xc_integrator/replicated/impl.hpp b/include/gauxc/xc_integrator/replicated/impl.hpp index 44e60d2a..15471ab8 100644 --- a/include/gauxc/xc_integrator/replicated/impl.hpp +++ b/include/gauxc/xc_integrator/replicated/impl.hpp @@ -63,7 +63,7 @@ typename ReplicatedXCIntegrator::value_type template typename ReplicatedXCIntegrator::exc_vxc_type_rks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) { + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXC( P.rows(), P.cols() ); @@ -78,7 +78,7 @@ typename ReplicatedXCIntegrator::exc_vxc_type_rks template typename ReplicatedXCIntegrator::exc_vxc_type_uks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) { + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); @@ -97,7 +97,7 @@ typename ReplicatedXCIntegrator::exc_vxc_type_uks template typename ReplicatedXCIntegrator::exc_vxc_type_gks ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, - const IntegratorSettingsEXCVXC& ks_settings) { + const IntegratorSettingsXC& ks_settings) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); diff --git a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp index 915618e2..ab88c754 100644 --- a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp @@ -40,14 +40,14 @@ class ReplicatedXCIntegratorImpl { int64_t ldp, value_type* N_EL ) = 0; virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) = 0; + value_type* EXC, const IntegratorSettingsXC& ks_settings ) = 0; virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, const value_type* Pz, int64_t ldpz, value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) = 0; + value_type* EXC, const IntegratorSettingsXC& ks_settings ) = 0; virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, const value_type* Pz, @@ -60,7 +60,7 @@ class ReplicatedXCIntegratorImpl { value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) = 0; + value_type* EXC, const IntegratorSettingsXC& ks_settings ) = 0; virtual void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD ) = 0; @@ -83,7 +83,7 @@ class ReplicatedXCIntegratorImpl { void eval_exc_vxc( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ); + value_type* EXC, const IntegratorSettingsXC& ks_settings ); void eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, @@ -91,7 +91,7 @@ class ReplicatedXCIntegratorImpl { int64_t ldpz, value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ); + value_type* EXC, const IntegratorSettingsXC& ks_settings ); void eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, int64_t ldpscalar, const value_type* Pz, @@ -104,7 +104,7 @@ class ReplicatedXCIntegratorImpl { value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ); + value_type* EXC, const IntegratorSettingsXC& ks_settings ); void eval_exc_grad( int64_t m, int64_t n, const value_type* P, diff --git a/include/gauxc/xc_integrator/replicated_xc_integrator.hpp b/include/gauxc/xc_integrator/replicated_xc_integrator.hpp index a89d49bb..945f955b 100644 --- a/include/gauxc/xc_integrator/replicated_xc_integrator.hpp +++ b/include/gauxc/xc_integrator/replicated_xc_integrator.hpp @@ -40,9 +40,9 @@ class ReplicatedXCIntegrator : public XCIntegratorImpl { std::unique_ptr< pimpl_type > pimpl_; value_type integrate_den_( const MatrixType& ) override; - exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType&, const IntegratorSettingsEXCVXC& ) override; - exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const IntegratorSettingsEXCVXC&) override; - exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&, const IntegratorSettingsEXCVXC& ) override; + exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType&, const IntegratorSettingsXC& ) override; + exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const IntegratorSettingsXC&) override; + exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&, const IntegratorSettingsXC& ) override; exc_grad_type eval_exc_grad_( const MatrixType& ) override; exx_type eval_exx_ ( const MatrixType&, const IntegratorSettingsEXX& ) override; const util::Timer& get_timings_() const override; diff --git a/include/gauxc/xc_integrator/xc_integrator_impl.hpp b/include/gauxc/xc_integrator/xc_integrator_impl.hpp index aadfd828..9559180e 100644 --- a/include/gauxc/xc_integrator/xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/xc_integrator_impl.hpp @@ -29,10 +29,10 @@ class XCIntegratorImpl { protected: virtual value_type integrate_den_( const MatrixType& P ) = 0; - virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) = 0; - virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) = 0; + virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) = 0; + virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) = 0; virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, - const IntegratorSettingsEXCVXC& ks_settings ) = 0; + const IntegratorSettingsXC& ks_settings ) = 0; virtual exc_grad_type eval_exc_grad_( const MatrixType& P ) = 0; virtual exx_type eval_exx_ ( const MatrixType& P, const IntegratorSettingsEXX& settings ) = 0; @@ -65,15 +65,15 @@ class XCIntegratorImpl { * @param[in] P The alpha density matrix * @returns EXC / VXC in a combined structure */ - exc_vxc_type_rks eval_exc_vxc( const MatrixType& P, const IntegratorSettingsEXCVXC& ks_settings ) { + exc_vxc_type_rks eval_exc_vxc( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) { return eval_exc_vxc_(P, ks_settings); } - exc_vxc_type_uks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsEXCVXC& ks_settings ) { + exc_vxc_type_uks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { return eval_exc_vxc_(Pscalar, Pz, ks_settings); } - exc_vxc_type_gks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsEXCVXC& ks_settings ) { + exc_vxc_type_gks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsXC& ks_settings ) { return eval_exc_vxc_(Pscalar, Pz, Px, Py, ks_settings); } diff --git a/include/gauxc/xc_integrator_settings.hpp b/include/gauxc/xc_integrator_settings.hpp index d75d202d..11c21609 100644 --- a/include/gauxc/xc_integrator_settings.hpp +++ b/include/gauxc/xc_integrator_settings.hpp @@ -16,8 +16,8 @@ struct IntegratorSettingsSNLinK : public IntegratorSettingsEXX { double k_tol = 1e-10; }; -struct IntegratorSettingsEXCVXC { virtual ~IntegratorSettingsEXCVXC() noexcept = default; }; -struct IntegratorSettingsKS : public IntegratorSettingsEXCVXC { +struct IntegratorSettingsXC { virtual ~IntegratorSettingsXC() noexcept = default; }; +struct IntegratorSettingsKS : public IntegratorSettingsXC { double gks_dtol = 1e-12; }; diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp index 7ab6445c..611974e9 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp @@ -30,7 +30,7 @@ class ReferenceReplicatedXCHostIntegrator : void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) override; + value_type* EXC, const IntegratorSettingsXC& ks_settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -38,7 +38,7 @@ class ReferenceReplicatedXCHostIntegrator : int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) override; + value_type* EXC, const IntegratorSettingsXC& ks_settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -52,7 +52,7 @@ class ReferenceReplicatedXCHostIntegrator : value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) override; + value_type* EXC, const IntegratorSettingsXC& ks_settings ) override; void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, @@ -80,7 +80,7 @@ class ReferenceReplicatedXCHostIntegrator : value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, value_type *N_EL, const IntegratorSettingsEXCVXC& ks_settings ); + value_type* EXC, value_type *N_EL, const IntegratorSettingsXC& ks_settings ); void exc_grad_local_work_( const value_type* P, int64_t ldp, value_type* EXC_GRAD ); void exx_local_work_( const value_type* P, int64_t ldp, value_type* K, int64_t ldk, diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index 98235c0f..65699c0b 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -19,7 +19,7 @@ template void ReferenceReplicatedXCHostIntegrator:: eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { + value_type* EXC, const IntegratorSettingsXC& ks_settings ) { const auto& basis = this->load_balancer_->basis(); @@ -71,7 +71,7 @@ void ReferenceReplicatedXCHostIntegrator:: int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings) { + value_type* EXC, const IntegratorSettingsXC& ks_settings) { const auto& basis = this->load_balancer_->basis(); @@ -133,7 +133,7 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { + value_type* EXC, const IntegratorSettingsXC& ks_settings ) { const auto& basis = this->load_balancer_->basis(); @@ -204,7 +204,7 @@ void ReferenceReplicatedXCHostIntegrator:: value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, value_type *N_EL, const IntegratorSettingsEXCVXC& settings) { + value_type* EXC, value_type *N_EL, const IntegratorSettingsXC& settings) { const bool is_gks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx != nullptr) and (VXCy != nullptr); const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx == nullptr) and (VXCy == nullptr); diff --git a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx index 79ee99e0..f019b5c1 100644 --- a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx +++ b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx @@ -36,7 +36,7 @@ template void ReplicatedXCIntegratorImpl:: eval_exc_vxc( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { + value_type* EXC, const IntegratorSettingsXC& ks_settings ) { eval_exc_vxc_(m,n,P,ldp,VXC,ldvxc,EXC,ks_settings); @@ -50,7 +50,7 @@ void ReplicatedXCIntegratorImpl:: int64_t ldpz, value_type* VXCscalar, int64_t ldvxcscalar, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings) { + value_type* EXC, const IntegratorSettingsXC& ks_settings) { eval_exc_vxc_(m,n,Pscalar,ldpscalar, Pz,ldpz, @@ -73,7 +73,7 @@ void ReplicatedXCIntegratorImpl:: value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, - value_type* EXC, const IntegratorSettingsEXCVXC& ks_settings ) { + value_type* EXC, const IntegratorSettingsXC& ks_settings ) { eval_exc_vxc_(m,n,Pscalar,ldpscalar, Pz,ldpz, From 4ed32b11b3c71b6d3cb527226dd07944fdfeb189 Mon Sep 17 00:00:00 2001 From: Eleftherios Lambros <33043577+elambros@users.noreply.github.com> Date: Fri, 17 Nov 2023 14:15:41 -0800 Subject: [PATCH 16/24] Deleted the ":" file in src Byproduct of reckless sed usage --- src/: | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/: diff --git a/src/: b/src/: deleted file mode 100644 index 8acbc0d4..00000000 --- a/src/: +++ /dev/null @@ -1,24 +0,0 @@ -ARGC: 1 -ARGIND: 0 -ARGV: array, 1 elements -BINMODE: 0 -CONVFMT: "%.6g" -ERRNO: "" -FIELDWIDTHS: "" -FILENAME: "-" -FNR: 19 -FPAT: "[^[:space:]]+" -FS: " " -IGNORECASE: 0 -LINT: 0 -NF: 2 -NR: 19 -OFMT: "%.6g" -OFS: " " -ORS: "\n" -RLENGTH: 0 -RS: "\n" -RSTART: 0 -RT: "\n" -SUBSEP: "\034" -TEXTDOMAIN: "messages" From 2e68b2c9af00248376a1d72ee2d3dacedeea8b46 Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 14:33:52 -0800 Subject: [PATCH 17/24] Renamed Pscalar, VXCscalar -> Ps, VXCs etc.. --- include/gauxc/xc_integrator/impl.hpp | 8 +++---- .../gauxc/xc_integrator/replicated/impl.hpp | 20 ++++++++-------- .../replicated_xc_integrator_impl.hpp | 24 +++++++++---------- .../xc_integrator/xc_integrator_impl.hpp | 12 +++++----- src/: | 24 +++++++++++++++++++ ...incore_replicated_xc_device_integrator.hpp | 10 ++++---- ...eplicated_xc_device_integrator_exc_vxc.hpp | 18 +++++++------- ...atched_replicated_xc_device_integrator.hpp | 10 ++++---- ...eplicated_xc_device_integrator_exc_vxc.hpp | 14 +++++------ .../replicated_xc_integrator_impl.cxx | 20 ++++++++-------- 10 files changed, 92 insertions(+), 68 deletions(-) create mode 100644 src/: diff --git a/include/gauxc/xc_integrator/impl.hpp b/include/gauxc/xc_integrator/impl.hpp index 8e3d376d..5d4e0d88 100644 --- a/include/gauxc/xc_integrator/impl.hpp +++ b/include/gauxc/xc_integrator/impl.hpp @@ -40,17 +40,17 @@ typename XCIntegrator::exc_vxc_type_rks template typename XCIntegrator::exc_vxc_type_uks - XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { + XCIntegrator::eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - return pimpl_->eval_exc_vxc(Pscalar, Pz, ks_settings); + return pimpl_->eval_exc_vxc(Ps, Pz, ks_settings); }; template typename XCIntegrator::exc_vxc_type_gks - XCIntegrator::eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + XCIntegrator::eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - return pimpl_->eval_exc_vxc(Pscalar, Pz, Px, Py, ks_settings); + return pimpl_->eval_exc_vxc(Ps, Pz, Px, Py, ks_settings); }; template diff --git a/include/gauxc/xc_integrator/replicated/impl.hpp b/include/gauxc/xc_integrator/replicated/impl.hpp index 15471ab8..778d19b5 100644 --- a/include/gauxc/xc_integrator/replicated/impl.hpp +++ b/include/gauxc/xc_integrator/replicated/impl.hpp @@ -78,44 +78,44 @@ typename ReplicatedXCIntegrator::exc_vxc_type_rks template typename ReplicatedXCIntegrator::exc_vxc_type_uks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Ps, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); + matrix_type VXCs( Ps.rows(), Ps.cols() ); matrix_type VXCz( Pz.rows(), Pz.cols() ); value_type EXC; - pimpl_->eval_exc_vxc( Pscalar.rows(), Pscalar.cols(), Pscalar.data(), Pscalar.rows(), + pimpl_->eval_exc_vxc( Ps.rows(), Ps.cols(), Ps.data(), Ps.rows(), Pz.data(), Pz.rows(), - VXCscalar.data(), VXCscalar.rows(), + VXCs.data(), VXCs.rows(), VXCz.data(), VXCz.rows(), &EXC, ks_settings ); - return std::make_tuple( EXC, VXCscalar, VXCz ); + return std::make_tuple( EXC, VXCs, VXCz ); } template typename ReplicatedXCIntegrator::exc_vxc_type_gks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsXC& ks_settings) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - matrix_type VXCscalar( Pscalar.rows(), Pscalar.cols() ); + matrix_type VXCs( Ps.rows(), Ps.cols() ); matrix_type VXCz( Pz.rows(), Pz.cols() ); matrix_type VXCx( Px.rows(), Px.cols() ); matrix_type VXCy( Py.rows(), Py.cols() ); value_type EXC; - pimpl_->eval_exc_vxc( Pscalar.rows(), Pscalar.cols(), Pscalar.data(), Pscalar.rows(), + pimpl_->eval_exc_vxc( Ps.rows(), Ps.cols(), Ps.data(), Ps.rows(), Pz.data(), Pz.rows(), Px.data(), Px.rows(), Py.data(), Py.rows(), - VXCscalar.data(), VXCscalar.rows(), + VXCs.data(), VXCs.rows(), VXCz.data(), VXCz.rows(), VXCx.data(), VXCx.rows(), VXCy.data(), VXCy.rows(), &EXC, ks_settings ); - return std::make_tuple( EXC, VXCscalar, VXCz, VXCx, VXCy); + return std::make_tuple( EXC, VXCs, VXCz, VXCx, VXCy); } diff --git a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp index ab88c754..bd6ded7b 100644 --- a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp @@ -41,22 +41,22 @@ class ReplicatedXCIntegratorImpl { virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, value_type* EXC, const IntegratorSettingsXC& ks_settings ) = 0; - virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC, const IntegratorSettingsXC& ks_settings ) = 0; - virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + virtual void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, const value_type* Px, int64_t ldpx, const value_type* Py, int64_t ldpy, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, @@ -85,22 +85,22 @@ class ReplicatedXCIntegratorImpl { int64_t ldp, value_type* VXC, int64_t ldvxc, value_type* EXC, const IntegratorSettingsXC& ks_settings ); - void eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + void eval_exc_vxc( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC, const IntegratorSettingsXC& ks_settings ); - void eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + void eval_exc_vxc( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, const value_type* Px, int64_t ldpx, const value_type* Py, int64_t ldpy, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, diff --git a/include/gauxc/xc_integrator/xc_integrator_impl.hpp b/include/gauxc/xc_integrator/xc_integrator_impl.hpp index 9559180e..d32d8427 100644 --- a/include/gauxc/xc_integrator/xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/xc_integrator_impl.hpp @@ -30,8 +30,8 @@ class XCIntegratorImpl { virtual value_type integrate_den_( const MatrixType& P ) = 0; virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) = 0; - virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) = 0; - virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Ps, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) = 0; + virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsXC& ks_settings ) = 0; virtual exc_grad_type eval_exc_grad_( const MatrixType& P ) = 0; virtual exx_type eval_exx_ ( const MatrixType& P, @@ -69,12 +69,12 @@ class XCIntegratorImpl { return eval_exc_vxc_(P, ks_settings); } - exc_vxc_type_uks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { - return eval_exc_vxc_(Pscalar, Pz, ks_settings); + exc_vxc_type_uks eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) { + return eval_exc_vxc_(Ps, Pz, ks_settings); } - exc_vxc_type_gks eval_exc_vxc( const MatrixType& Pscalar, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsXC& ks_settings ) { - return eval_exc_vxc_(Pscalar, Pz, Px, Py, ks_settings); + exc_vxc_type_gks eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsXC& ks_settings ) { + return eval_exc_vxc_(Ps, Pz, Px, Py, ks_settings); } /** Integrate EXC gradient for RKS diff --git a/src/: b/src/: new file mode 100644 index 00000000..8acbc0d4 --- /dev/null +++ b/src/: @@ -0,0 +1,24 @@ +ARGC: 1 +ARGIND: 0 +ARGV: array, 1 elements +BINMODE: 0 +CONVFMT: "%.6g" +ERRNO: "" +FIELDWIDTHS: "" +FILENAME: "-" +FNR: 19 +FPAT: "[^[:space:]]+" +FS: " " +IGNORECASE: 0 +LINT: 0 +NF: 2 +NR: 19 +OFMT: "%.6g" +OFS: " " +ORS: "\n" +RLENGTH: 0 +RS: "\n" +RSTART: 0 +RT: "\n" +SUBSEP: "\034" +TEXTDOMAIN: "messages" diff --git a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp index cedb12df..6697c9f6 100644 --- a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp +++ b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp @@ -35,11 +35,11 @@ class IncoreReplicatedXCDeviceIntegrator : int64_t ldp, value_type* VXC, int64_t ldvxc, value_type* EXC ) override; - void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC ) override; @@ -66,12 +66,12 @@ class IncoreReplicatedXCDeviceIntegrator : host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ); - void exc_vxc_local_work_( const basis_type& basis, const value_type* Pscalar, int64_t ldpscalar, + void exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ); - void exc_vxc_local_work_( const basis_type& basis, const value_type* Pscalar, int64_t ldpscalar, + void exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, value_type* VXC, int64_t ldvxc, value_type* VXCz, int64_t ldvxcz, value_type* EXC, value_type *N_EL, diff --git a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp index be87e6d3..947ef739 100644 --- a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp @@ -109,14 +109,14 @@ void IncoreReplicatedXCDeviceIntegrator:: template void IncoreReplicatedXCDeviceIntegrator:: - eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC ) { - GauXC::util::unused(m,n,Pscalar,ldpscalar,Pz,ldpz,VXCscalar,ldvxcscalar,VXCz,ldvxcz,EXC); + GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } @@ -263,24 +263,24 @@ void IncoreReplicatedXCDeviceIntegrator:: template void IncoreReplicatedXCDeviceIntegrator:: - exc_vxc_local_work_( const basis_type& basis, const value_type* Pscalar, int64_t ldpscalar, + exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ) { - GauXC::util::unused(basis,Pscalar,ldpscalar,Pz,ldpz,task_begin,task_end,device_data); + GauXC::util::unused(basis,Ps,ldps,Pz,ldpz,task_begin,task_end,device_data); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } template void IncoreReplicatedXCDeviceIntegrator:: - exc_vxc_local_work_( const basis_type& basis, const value_type* Pscalar, int64_t ldpscalar, + exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC, value_type *N_EL, host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ) { - GauXC::util::unused(basis,Pscalar,ldpscalar,Pz,ldpz,VXCscalar,ldvxcscalar,VXCz,ldvxcz,EXC,N_EL,task_begin,task_end,device_data); + GauXC::util::unused(basis,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC,N_EL,task_begin,task_end,device_data); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } diff --git a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp index d41e5fcd..85ac8737 100644 --- a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp +++ b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp @@ -46,11 +46,11 @@ class ShellBatchedReplicatedXCDeviceIntegrator : int64_t ldp, value_type* VXC, int64_t ldvxc, value_type* EXC ) override; - void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC ) override; @@ -67,9 +67,9 @@ class ShellBatchedReplicatedXCDeviceIntegrator : incore_integrator_type& incore_integrator, XCDeviceData& device_data ); - void exc_vxc_local_work_( const basis_type& basis, const value_type* Pscalar, int64_t ldpscalar, + void exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC, value_type *N_EL, host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ); diff --git a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp index 87093e2b..d0f6c122 100644 --- a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp @@ -87,15 +87,15 @@ void ShellBatchedReplicatedXCDeviceIntegrator:: template void ShellBatchedReplicatedXCDeviceIntegrator:: - eval_exc_vxc_( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC ) { - GauXC::util::unused(m,n,Pscalar,ldpscalar,Pz,ldpz,VXCscalar,ldvxcscalar,VXCz,ldvxcz,EXC); + GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } @@ -195,14 +195,14 @@ void ShellBatchedReplicatedXCDeviceIntegrator:: template void ShellBatchedReplicatedXCDeviceIntegrator:: - exc_vxc_local_work_( const basis_type& basis, const value_type* Pscalar, int64_t ldpscalar, + exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC, value_type *N_EL, host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ) { - GauXC::util::unused(basis,Pscalar,ldpscalar,Pz,ldpz,VXCscalar,ldvxcscalar,VXCz,ldvxcz,EXC,N_EL,task_begin,task_end,device_data); + GauXC::util::unused(basis,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC,N_EL,task_begin,task_end,device_data); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } diff --git a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx index f019b5c1..bc829369 100644 --- a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx +++ b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx @@ -44,42 +44,42 @@ void ReplicatedXCIntegratorImpl:: template void ReplicatedXCIntegratorImpl:: - eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + eval_exc_vxc( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* EXC, const IntegratorSettingsXC& ks_settings) { - eval_exc_vxc_(m,n,Pscalar,ldpscalar, + eval_exc_vxc_(m,n,Ps,ldps, Pz,ldpz, - VXCscalar,ldvxcscalar, + VXCs,ldvxcs, VXCz,ldvxcz,EXC, ks_settings); } template void ReplicatedXCIntegratorImpl:: - eval_exc_vxc( int64_t m, int64_t n, const value_type* Pscalar, - int64_t ldpscalar, + eval_exc_vxc( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, const value_type* Pz, int64_t ldpz, const value_type* Px, int64_t ldpx, const value_type* Py, int64_t ldpy, - value_type* VXCscalar, int64_t ldvxcscalar, + value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, value_type* EXC, const IntegratorSettingsXC& ks_settings ) { - eval_exc_vxc_(m,n,Pscalar,ldpscalar, + eval_exc_vxc_(m,n,Ps,ldps, Pz,ldpz, Px,ldpx, Py,ldpy, - VXCscalar,ldvxcscalar, + VXCs,ldvxcs, VXCz,ldvxcz, VXCx,ldvxcx, VXCy,ldvxcy,EXC, ks_settings); From 79e56aed9fa0e7e124860cf6870bd25d3dc4ccd3 Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 15:23:52 -0800 Subject: [PATCH 18/24] Switched ordering from ZXY -> ZYX --- include/gauxc/xc_integrator/impl.hpp | 4 +- .../gauxc/xc_integrator/replicated/impl.hpp | 12 +-- .../replicated_xc_integrator_impl.hpp | 12 +-- .../xc_integrator/xc_integrator_impl.hpp | 6 +- .../host/reference_local_host_work_driver.cxx | 102 +++++++++--------- ...eference_replicated_xc_host_integrator.hpp | 10 +- ..._replicated_xc_host_integrator_exc_vxc.hpp | 42 ++++---- .../replicated_xc_integrator_impl.cxx | 12 +-- 8 files changed, 100 insertions(+), 100 deletions(-) diff --git a/include/gauxc/xc_integrator/impl.hpp b/include/gauxc/xc_integrator/impl.hpp index 5d4e0d88..c7956b57 100644 --- a/include/gauxc/xc_integrator/impl.hpp +++ b/include/gauxc/xc_integrator/impl.hpp @@ -47,10 +47,10 @@ typename XCIntegrator::exc_vxc_type_uks template typename XCIntegrator::exc_vxc_type_gks - XCIntegrator::eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + XCIntegrator::eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Py, const MatrixType& Px, const IntegratorSettingsXC& ks_settings ) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); - return pimpl_->eval_exc_vxc(Ps, Pz, Px, Py, ks_settings); + return pimpl_->eval_exc_vxc(Ps, Pz, Py, Px, ks_settings); }; template diff --git a/include/gauxc/xc_integrator/replicated/impl.hpp b/include/gauxc/xc_integrator/replicated/impl.hpp index 778d19b5..132faa09 100644 --- a/include/gauxc/xc_integrator/replicated/impl.hpp +++ b/include/gauxc/xc_integrator/replicated/impl.hpp @@ -96,26 +96,26 @@ typename ReplicatedXCIntegrator::exc_vxc_type_uks template typename ReplicatedXCIntegrator::exc_vxc_type_gks - ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + ReplicatedXCIntegrator::eval_exc_vxc_( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Py, const MatrixType& Px, const IntegratorSettingsXC& ks_settings) { if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED(); matrix_type VXCs( Ps.rows(), Ps.cols() ); matrix_type VXCz( Pz.rows(), Pz.cols() ); - matrix_type VXCx( Px.rows(), Px.cols() ); matrix_type VXCy( Py.rows(), Py.cols() ); + matrix_type VXCx( Px.rows(), Px.cols() ); value_type EXC; pimpl_->eval_exc_vxc( Ps.rows(), Ps.cols(), Ps.data(), Ps.rows(), Pz.data(), Pz.rows(), - Px.data(), Px.rows(), Py.data(), Py.rows(), + Px.data(), Px.rows(), VXCs.data(), VXCs.rows(), VXCz.data(), VXCz.rows(), - VXCx.data(), VXCx.rows(), - VXCy.data(), VXCy.rows(), &EXC, ks_settings ); + VXCy.data(), VXCy.rows(), + VXCx.data(), VXCx.rows(), &EXC, ks_settings ); - return std::make_tuple( EXC, VXCs, VXCz, VXCx, VXCy); + return std::make_tuple( EXC, VXCs, VXCz, VXCy, VXCx); } diff --git a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp index bd6ded7b..893db54c 100644 --- a/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/replicated/replicated_xc_integrator_impl.hpp @@ -52,14 +52,14 @@ class ReplicatedXCIntegratorImpl { int64_t ldps, const value_type* Pz, int64_t ldpz, - const value_type* Px, - int64_t ldpx, const value_type* Py, int64_t ldpy, + const value_type* Px, + int64_t ldpx, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, const IntegratorSettingsXC& ks_settings ) = 0; virtual void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, @@ -96,14 +96,14 @@ class ReplicatedXCIntegratorImpl { int64_t ldps, const value_type* Pz, int64_t ldpz, - const value_type* Px, - int64_t ldpx, const value_type* Py, int64_t ldpy, + const value_type* Px, + int64_t ldpx, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, const IntegratorSettingsXC& ks_settings ); diff --git a/include/gauxc/xc_integrator/xc_integrator_impl.hpp b/include/gauxc/xc_integrator/xc_integrator_impl.hpp index d32d8427..8a9ca618 100644 --- a/include/gauxc/xc_integrator/xc_integrator_impl.hpp +++ b/include/gauxc/xc_integrator/xc_integrator_impl.hpp @@ -31,7 +31,7 @@ class XCIntegratorImpl { virtual value_type integrate_den_( const MatrixType& P ) = 0; virtual exc_vxc_type_rks eval_exc_vxc_ ( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) = 0; virtual exc_vxc_type_uks eval_exc_vxc_ ( const MatrixType& Ps, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) = 0; - virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, + virtual exc_vxc_type_gks eval_exc_vxc_ ( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Py, const MatrixType& Px, const IntegratorSettingsXC& ks_settings ) = 0; virtual exc_grad_type eval_exc_grad_( const MatrixType& P ) = 0; virtual exx_type eval_exx_ ( const MatrixType& P, @@ -73,8 +73,8 @@ class XCIntegratorImpl { return eval_exc_vxc_(Ps, Pz, ks_settings); } - exc_vxc_type_gks eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Px, const MatrixType& Py, const IntegratorSettingsXC& ks_settings ) { - return eval_exc_vxc_(Ps, Pz, Px, Py, ks_settings); + exc_vxc_type_gks eval_exc_vxc( const MatrixType& Ps, const MatrixType& Pz, const MatrixType& Py, const MatrixType& Px, const IntegratorSettingsXC& ks_settings ) { + return eval_exc_vxc_(Ps, Pz, Py, Px, ks_settings); } /** Integrate EXC gradient for RKS diff --git a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx index 20d9c2cc..7201595b 100644 --- a/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/host/reference_local_host_work_driver.cxx @@ -146,9 +146,9 @@ namespace GauXC { const double* Xx, size_t ldxx, const double* Xy, size_t ldxy, double* den_eval, double* K, const double dtol) { - auto *K2 = K; // KZ // store K in the Z matrix - auto *K3 = K2 + npts; - auto *K4 = K3 + npts; + auto *KZ = K; // KZ // store K in the Z matrix + auto *KY = KZ + npts; + auto *KX = KY + npts; double dtolsq = dtol*dtol; @@ -174,14 +174,14 @@ namespace GauXC { if (mtemp > dtolsq) { mnorm = sqrt(mtemp); - K2[i] = rhoz / mnorm; - K3[i] = rhox / mnorm; - K4[i] = rhoy / mnorm; + KZ[i] = rhoz / mnorm; + KY[i] = rhoy / mnorm; + KX[i] = rhox / mnorm; } else { mnorm = (1. / 3.) * (rhox + rhoy + rhoz); - K2[i] = 1. / 3.; - K3[i] = 1. / 3.; - K4[i] = 1. / 3.; + KZ[i] = 1. / 3.; + KY[i] = 1. / 3.; + KX[i] = 1. / 3.; } den_eval[2*i] = 0.5*(rhos + mnorm); // rho_+ @@ -283,13 +283,13 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, const double* Xy, size_t ldxy, double* den_eval, double* dden_x_eval, double* dden_y_eval, double* dden_z_eval, double* gamma, double* K, double* H, const double dtol) { - auto *K2 = K; // KZ // store K in the Z matrix - auto *K3 = K2 + npts; - auto *K4 = K3 + npts; + auto *KZ = K; // KZ // store K in the Z matrix + auto *KY = KZ + npts; + auto *KX = KY + npts; - auto *H2 = H; // KZ // store K in the Z matrix - auto *H3 = H2 + npts; - auto *H4 = H3 + npts; + auto *HZ = H; // KZ // store K in the Z matrix + auto *HY = HZ + npts; + auto *HX = HY + npts; double dtolsq = dtol*dtol; @@ -347,13 +347,13 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, dden_y_eval[4 * i + 1] = dMzdy; dden_z_eval[4 * i + 1] = dMzdz; - dden_x_eval[4 * i + 2] = dMxdx; - dden_y_eval[4 * i + 2] = dMxdy; - dden_z_eval[4 * i + 2] = dMxdz; + dden_x_eval[4 * i + 2] = dMydx; + dden_y_eval[4 * i + 2] = dMydy; + dden_z_eval[4 * i + 2] = dMydz; - dden_x_eval[4 * i + 3] = dMydx; - dden_y_eval[4 * i + 3] = dMydy; - dden_z_eval[4 * i + 3] = dMydz; + dden_x_eval[4 * i + 3] = dMxdx; + dden_y_eval[4 * i + 3] = dMxdy; + dden_z_eval[4 * i + 3] = dMxdz; double mtemp = rhoz * rhoz + rhox * rhox + rhoy * rhoy; double mnorm = 0; @@ -381,21 +381,21 @@ void ReferenceLocalHostWorkDriver::eval_uvvar_gga_gks( size_t npts, size_t nbe, if (mtemp > dtolsq) { mnorm = sqrt(mtemp); - K2[i] = rhoz / mnorm; - K3[i] = rhox / mnorm; - K4[i] = rhoy / mnorm; - H2[i] = sign * dels_dot_delz / sqsum2; - H3[i] = sign * dels_dot_delx / sqsum2; - H4[i] = sign * dels_dot_dely / sqsum2; + KZ[i] = rhoz / mnorm; + KY[i] = rhoy / mnorm; + KX[i] = rhox / mnorm; + HZ[i] = sign * dels_dot_delz / sqsum2; + HY[i] = sign * dels_dot_dely / sqsum2; + HX[i] = sign * dels_dot_delx / sqsum2; } else { mnorm = (1. / 3.) * (rhox + rhoy + rhoz); - K2[i] = 1. / 3.; - K3[i] = 1. / 3.; - K4[i] = 1. / 3.; + KZ[i] = 1. / 3.; + KY[i] = 1. / 3.; + KX[i] = 1. / 3.; - H2[i] = sign / 3.; - H3[i] = sign / 3.; - H4[i] = sign / 3.; + HZ[i] = sign / 3.; + HY[i] = sign / 3.; + HX[i] = sign / 3.; } den_eval[2 * i] = 0.5 * (rhos + mnorm); @@ -459,8 +459,8 @@ void ReferenceLocalHostWorkDriver::eval_zmat_lda_vxc_gks( size_t npts, size_t nb double* Zx, size_t ldzx,double* Zy, size_t ldzy, double *K ) { auto *KZ = K; // KZ // store K in the Z matrix - auto *KX = KZ + npts; - auto *KY = KX + npts; + auto *KY = KZ + npts; + auto *KX = KY + npts; blas::lacpy( 'A', nbe, npts, basis_eval, nbe, Zs, ldzs); blas::lacpy( 'A', nbe, npts, basis_eval, nbe, Zz, ldzz); @@ -587,12 +587,12 @@ void ReferenceLocalHostWorkDriver::eval_zmat_gga_vxc_gks( size_t npts, size_t nb double* Zy, size_t ldzy, double* K, double* H ) { auto *KZ = K; // KZ // store K in the Z matrix - auto *KX = KZ + npts; - auto *KY = KX + npts; + auto *KY = KZ + npts; + auto *KX = KY + npts; auto *HZ = H; // KZ // store K in the Z matrix - auto *HX = HZ + npts; - auto *HY = HX + npts; + auto *HY = HZ + npts; + auto *HX = HY + npts; if( ldzs != nbf ) GAUXC_GENERIC_EXCEPTION(std::string("INVALID DIMS")); if( ldzz != nbf ) GAUXC_GENERIC_EXCEPTION(std::string("INVALID DIMS")); @@ -637,16 +637,16 @@ void ReferenceLocalHostWorkDriver::eval_zmat_gga_vxc_gks( size_t npts, size_t nb const auto x_fact_s = gga_fact_1 * dden_x_eval[4 * i] + gga_fact_2 * (HZ[i] * dden_x_eval[4 * i + 1] + - HX[i] * dden_x_eval[4 * i + 2] + - HY[i] * dden_x_eval[4 * i + 3]); + HY[i] * dden_x_eval[4 * i + 2] + + HX[i] * dden_x_eval[4 * i + 3]); const auto y_fact_s = gga_fact_1 * dden_y_eval[4 * i] + gga_fact_2 * (HZ[i] * dden_y_eval[4 * i + 1] + - HX[i] * dden_y_eval[4 * i + 2] + - HY[i] * dden_y_eval[4 * i + 3]); + HY[i] * dden_y_eval[4 * i + 2] + + HX[i] * dden_y_eval[4 * i + 3]); const auto z_fact_s = gga_fact_1 * dden_z_eval[4 * i] + gga_fact_2 * (HZ[i] * dden_z_eval[4 * i + 1] + - HX[i] * dden_z_eval[4 * i + 2] + - HY[i] * dden_z_eval[4 * i + 3]); + HY[i] * dden_z_eval[4 * i + 2] + + HX[i] * dden_z_eval[4 * i + 3]); const auto x_fact_z = gga_fact_3 * dden_x_eval[4 * i + 1] + gga_fact_2 * HZ[i] * dden_x_eval[4 * i]; @@ -655,18 +655,18 @@ void ReferenceLocalHostWorkDriver::eval_zmat_gga_vxc_gks( size_t npts, size_t nb const auto z_fact_z = gga_fact_3 * dden_z_eval[4 * i + 1] + gga_fact_2 * HZ[i] * dden_z_eval[4 * i]; - const auto x_fact_x = gga_fact_3 * dden_x_eval[4 * i + 2] + + const auto x_fact_x = gga_fact_3 * dden_x_eval[4 * i + 3] + gga_fact_2 * HX[i] * dden_x_eval[4 * i]; - const auto y_fact_x = gga_fact_3 * dden_y_eval[4 * i + 2] + + const auto y_fact_x = gga_fact_3 * dden_y_eval[4 * i + 3] + gga_fact_2 * HX[i] * dden_y_eval[4 * i]; - const auto z_fact_x = gga_fact_3 * dden_z_eval[4 * i + 2] + + const auto z_fact_x = gga_fact_3 * dden_z_eval[4 * i + 3] + gga_fact_2 * HX[i] * dden_z_eval[4 * i]; - const auto x_fact_y = gga_fact_3 * dden_x_eval[4 * i + 3] + + const auto x_fact_y = gga_fact_3 * dden_x_eval[4 * i + 2] + gga_fact_2 * HY[i] * dden_x_eval[4 * i]; - const auto y_fact_y = gga_fact_3 * dden_y_eval[4 * i + 3] + + const auto y_fact_y = gga_fact_3 * dden_y_eval[4 * i + 2] + gga_fact_2 * HY[i] * dden_y_eval[4 * i]; - const auto z_fact_y = gga_fact_3 * dden_z_eval[4 * i + 3] + + const auto z_fact_y = gga_fact_3 * dden_z_eval[4 * i + 2] + gga_fact_2 * HY[i] * dden_z_eval[4 * i]; diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp index 611974e9..cabeece2 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator.hpp @@ -44,14 +44,14 @@ class ReferenceReplicatedXCHostIntegrator : int64_t ldps, const value_type* Pz, int64_t ldpz, - const value_type* Px, - int64_t ldpx, const value_type* Py, int64_t ldpy, + const value_type* Px, + int64_t ldpx, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, const IntegratorSettingsXC& ks_settings ) override; @@ -74,12 +74,12 @@ class ReferenceReplicatedXCHostIntegrator : void exc_vxc_local_work_( const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, - const value_type* Px, int64_t ldpx, const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, value_type *N_EL, const IntegratorSettingsXC& ks_settings ); void exc_grad_local_work_( const value_type* P, int64_t ldp, value_type* EXC_GRAD ); diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index 65699c0b..636cd525 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -125,14 +125,14 @@ void ReferenceReplicatedXCHostIntegrator:: int64_t ldps, const value_type* Pz, int64_t ldpz, - const value_type* Px, - int64_t ldpx, const value_type* Py, int64_t ldpy, + const value_type* Px, + int64_t ldpx, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, const IntegratorSettingsXC& ks_settings ) { const auto& basis = this->load_balancer_->basis(); @@ -147,17 +147,17 @@ void ReferenceReplicatedXCHostIntegrator:: GAUXC_GENERIC_EXCEPTION("Invalid LDPSCALAR"); if( ldpz < nbf ) GAUXC_GENERIC_EXCEPTION("Invalid LDPZ"); - if( ldpx < nbf ) - GAUXC_GENERIC_EXCEPTION("Invalid LDPX"); if( ldpy < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDPX"); + if( ldpx < nbf ) GAUXC_GENERIC_EXCEPTION("Invalid LDPY"); if( ldvxcs < nbf ) GAUXC_GENERIC_EXCEPTION("Invalid LDVXCSCALAR"); if( ldvxcz < nbf ) GAUXC_GENERIC_EXCEPTION("Invalid LDVXCZ"); - if( ldvxcx < nbf ) - GAUXC_GENERIC_EXCEPTION("Invalid LDVXCX"); if( ldvxcy < nbf ) + GAUXC_GENERIC_EXCEPTION("Invalid LDVXCX"); + if( ldvxcx < nbf ) GAUXC_GENERIC_EXCEPTION("Invalid LDVXCY"); // Get Tasks @@ -168,9 +168,9 @@ void ReferenceReplicatedXCHostIntegrator:: // Compute Local contributions to EXC / VXC this->timer_.time_op("XCIntegrator.LocalWork", [&](){ - exc_vxc_local_work_( Ps, ldps, Pz, ldpz, Px, ldpx, Py, ldpy, + exc_vxc_local_work_( Ps, ldps, Pz, ldpz, Py, ldpy, Px, ldpx, VXCs, ldvxcs, VXCz, ldvxcz, - VXCx, ldvxcx, VXCy, ldvxcy, EXC, &N_EL, ks_settings ); + VXCy, ldvxcy, VXCx, ldvxcx, EXC, &N_EL, ks_settings ); }); @@ -182,8 +182,8 @@ void ReferenceReplicatedXCHostIntegrator:: this->reduction_driver_->allreduce_inplace( VXCs, nbf*nbf, ReductionOp::Sum ); this->reduction_driver_->allreduce_inplace( VXCz, nbf*nbf, ReductionOp::Sum ); - this->reduction_driver_->allreduce_inplace( VXCx, nbf*nbf, ReductionOp::Sum ); - this->reduction_driver_->allreduce_inplace( VXCy, nbf*nbf, ReductionOp::Sum ); + this->reduction_driver_->allreduce_inplace( VXCy, nbf*nbf, ReductionOp::Sum ); + this->reduction_driver_->allreduce_inplace( VXCx, nbf*nbf, ReductionOp::Sum ); this->reduction_driver_->allreduce_inplace( EXC, 1 , ReductionOp::Sum ); this->reduction_driver_->allreduce_inplace( &N_EL, 1 , ReductionOp::Sum ); @@ -198,16 +198,16 @@ template void ReferenceReplicatedXCHostIntegrator:: exc_vxc_local_work_( const value_type* Ps, int64_t ldps, const value_type* Pz, int64_t ldpz, - const value_type* Px, int64_t ldpx, const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, value_type *N_EL, const IntegratorSettingsXC& settings) { - const bool is_gks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx != nullptr) and (VXCy != nullptr); - const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCx == nullptr) and (VXCy == nullptr); + const bool is_gks = (Pz != nullptr) and (VXCz != nullptr) and (VXCy != nullptr) and (VXCx != nullptr); + const bool is_uks = (Pz != nullptr) and (VXCz != nullptr) and (VXCy == nullptr) and (VXCx == nullptr); const bool is_rks = not is_uks and not is_gks; if (not is_rks and not is_uks and not is_gks) { GAUXC_GENERIC_EXCEPTION("MUST BE EITHER RKS, UKS, or GKS!"); @@ -267,8 +267,8 @@ void ReferenceReplicatedXCHostIntegrator:: if(is_gks) { for( auto j = 0; j < nbf; ++j ) { for( auto i = 0; i < nbf; ++i ) { - VXCx[i + j*ldvxcx] = 0.; VXCy[i + j*ldvxcy] = 0.; + VXCx[i + j*ldvxcx] = 0.; } } } @@ -396,9 +396,9 @@ void ReferenceReplicatedXCHostIntegrator:: } if(is_gks) { - lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Px, ldpx, basis_eval, nbe, - zmat_x, nbe, nbe_scr); lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Py, ldpy, basis_eval, nbe, + zmat_x, nbe, nbe_scr); + lwd->eval_xmat( npts, nbf, nbe, submat_map, 1.0, Px, ldpx, basis_eval, nbe, zmat_y, nbe, nbe_scr); } @@ -502,9 +502,9 @@ void ReferenceReplicatedXCHostIntegrator:: nbe_scr); } if(is_gks) { - lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_x, nbe, VXCx, ldvxcx, + lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_x, nbe, VXCy, ldvxcy, nbe_scr); - lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_y, nbe, VXCy, ldvxcy, + lwd->inc_vxc( npts, nbf, nbe, basis_eval, submat_map, zmat_y, nbe, VXCx, ldvxcx, nbe_scr); } @@ -531,8 +531,8 @@ void ReferenceReplicatedXCHostIntegrator:: if( is_gks) { for( int32_t j = 0; j < nbf; ++j ) { for( int32_t i = j+1; i < nbf; ++i ) { - VXCx[ j + i*ldvxcx ] = VXCx[ i + j*ldvxcx ]; VXCy[ j + i*ldvxcy ] = VXCy[ i + j*ldvxcy ]; + VXCx[ j + i*ldvxcx ] = VXCx[ i + j*ldvxcx ]; } } } diff --git a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx index bc829369..92c5bcf3 100644 --- a/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx +++ b/src/xc_integrator/replicated/replicated_xc_integrator_impl.cxx @@ -65,24 +65,24 @@ void ReplicatedXCIntegratorImpl:: int64_t ldps, const value_type* Pz, int64_t ldpz, - const value_type* Px, - int64_t ldpx, const value_type* Py, int64_t ldpy, + const value_type* Px, + int64_t ldpx, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* VXCx, int64_t ldvxcx, value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, const IntegratorSettingsXC& ks_settings ) { eval_exc_vxc_(m,n,Ps,ldps, Pz,ldpz, - Px,ldpx, Py,ldpy, + Px,ldpx, VXCs,ldvxcs, VXCz,ldvxcz, - VXCx,ldvxcx, - VXCy,ldvxcy,EXC, ks_settings); + VXCy,ldvxcy, + VXCx,ldvxcx,EXC, ks_settings); } From 563f844bd6b7c16c7fd94c08131385a8088f4918 Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 16:23:47 -0800 Subject: [PATCH 19/24] Added placeholder GPU functions for GKS --- .../device/local_device_work_driver.cxx | 6 ++ .../device/local_device_work_driver.hpp | 6 ++ .../device/local_device_work_driver_pimpl.hpp | 4 ++ .../local_work_driver/device/scheme1_base.cxx | 24 ++++++++ .../local_work_driver/device/scheme1_base.hpp | 5 ++ ...incore_replicated_xc_device_integrator.hpp | 36 +++++++++++- ...eplicated_xc_device_integrator_exc_vxc.hpp | 56 ++++++++++++++++++- ...atched_replicated_xc_device_integrator.hpp | 29 +++++++++- ...eplicated_xc_device_integrator_exc_vxc.hpp | 45 ++++++++++++++- 9 files changed, 201 insertions(+), 10 deletions(-) diff --git a/src/xc_integrator/local_work_driver/device/local_device_work_driver.cxx b/src/xc_integrator/local_work_driver/device/local_device_work_driver.cxx index 919f2c60..de42fefb 100644 --- a/src/xc_integrator/local_work_driver/device/local_device_work_driver.cxx +++ b/src/xc_integrator/local_work_driver/device/local_device_work_driver.cxx @@ -44,12 +44,18 @@ FWD_TO_PIMPL(eval_uvvar_gga_rks) // U/VVar GGA (density + grad, gamma FWD_TO_PIMPL(eval_uvvar_lda_uks) // U/VVar LDA (density) FWD_TO_PIMPL(eval_uvvar_gga_uks) // U/VVar GGA (density + grad, gamma) +FWD_TO_PIMPL(eval_uvvar_lda_gks) // U/VVar LDA (density) +FWD_TO_PIMPL(eval_uvvar_gga_gks) // U/VVar GGA (density + grad, gamma) + FWD_TO_PIMPL(eval_zmat_lda_vxc_rks) // Eval Z Matrix LDA VXC FWD_TO_PIMPL(eval_zmat_gga_vxc_rks) // Eval Z Matrix GGA VXC FWD_TO_PIMPL(eval_zmat_lda_vxc_uks) // Eval Z Matrix LDA VXC FWD_TO_PIMPL(eval_zmat_gga_vxc_uks) // Eval Z Matrix GGA VXC +FWD_TO_PIMPL(eval_zmat_lda_vxc_gks) // Eval Z Matrix LDA VXC +FWD_TO_PIMPL(eval_zmat_gga_vxc_gks) // Eval Z Matrix GGA VXC + FWD_TO_PIMPL(eval_exx_fmat) // Eval EXX F Matrix //FWD_TO_PIMPL(eval_exx_gmat) // Eval EXX G Matrix diff --git a/src/xc_integrator/local_work_driver/device/local_device_work_driver.hpp b/src/xc_integrator/local_work_driver/device/local_device_work_driver.hpp index ad7f230c..37be7d33 100644 --- a/src/xc_integrator/local_work_driver/device/local_device_work_driver.hpp +++ b/src/xc_integrator/local_work_driver/device/local_device_work_driver.hpp @@ -69,6 +69,9 @@ class LocalDeviceWorkDriver : public LocalWorkDriver { void eval_uvvar_lda_uks( XCDeviceData* ); void eval_uvvar_gga_uks( XCDeviceData* ); + void eval_uvvar_lda_gks( XCDeviceData* ); + void eval_uvvar_gga_gks( XCDeviceData* ); + void eval_kern_exc_vxc_lda( const functional_type&, XCDeviceData* ); void eval_kern_exc_vxc_gga( const functional_type&, XCDeviceData* ); @@ -78,6 +81,9 @@ class LocalDeviceWorkDriver : public LocalWorkDriver { void eval_zmat_lda_vxc_uks( XCDeviceData* ); void eval_zmat_gga_vxc_uks( XCDeviceData* ); + void eval_zmat_lda_vxc_gks( XCDeviceData* ); + void eval_zmat_gga_vxc_gks( XCDeviceData* ); + void eval_exx_fmat( XCDeviceData* ); void eval_exx_gmat( XCDeviceData*, const BasisSetMap& ); diff --git a/src/xc_integrator/local_work_driver/device/local_device_work_driver_pimpl.hpp b/src/xc_integrator/local_work_driver/device/local_device_work_driver_pimpl.hpp index 6d416777..0c0f1817 100644 --- a/src/xc_integrator/local_work_driver/device/local_device_work_driver_pimpl.hpp +++ b/src/xc_integrator/local_work_driver/device/local_device_work_driver_pimpl.hpp @@ -41,12 +41,16 @@ struct LocalDeviceWorkDriverPIMPL { virtual void eval_uvvar_gga_rks( XCDeviceData* ) = 0; virtual void eval_uvvar_lda_uks( XCDeviceData* ) = 0; virtual void eval_uvvar_gga_uks( XCDeviceData* ) = 0; + virtual void eval_uvvar_lda_gks( XCDeviceData* ) = 0; + virtual void eval_uvvar_gga_gks( XCDeviceData* ) = 0; virtual void eval_kern_exc_vxc_lda( const functional_type&, XCDeviceData* ) = 0; virtual void eval_kern_exc_vxc_gga( const functional_type&, XCDeviceData* ) = 0; virtual void eval_zmat_lda_vxc_rks( XCDeviceData* ) = 0; virtual void eval_zmat_gga_vxc_rks( XCDeviceData* ) = 0; virtual void eval_zmat_lda_vxc_uks( XCDeviceData* ) = 0; virtual void eval_zmat_gga_vxc_uks( XCDeviceData* ) = 0; + virtual void eval_zmat_lda_vxc_gks( XCDeviceData* ) = 0; + virtual void eval_zmat_gga_vxc_gks( XCDeviceData* ) = 0; virtual void inc_exc( XCDeviceData* ) = 0; virtual void inc_nel( XCDeviceData* ) = 0; virtual void inc_vxc( XCDeviceData* ) = 0; diff --git a/src/xc_integrator/local_work_driver/device/scheme1_base.cxx b/src/xc_integrator/local_work_driver/device/scheme1_base.cxx index 5b0380e0..ecc7b33d 100644 --- a/src/xc_integrator/local_work_driver/device/scheme1_base.cxx +++ b/src/xc_integrator/local_work_driver/device/scheme1_base.cxx @@ -288,6 +288,18 @@ void AoSScheme1Base::eval_zmat_gga_vxc_uks( XCDeviceData* ){ } +void AoSScheme1Base::eval_zmat_lda_vxc_gks( XCDeviceData* ){ + + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); + +} + +void AoSScheme1Base::eval_zmat_gga_vxc_gks( XCDeviceData* ){ + + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); + +} + void AoSScheme1Base::eval_collocation( XCDeviceData* _data ) { auto* data = dynamic_cast(_data); @@ -489,6 +501,18 @@ void AoSScheme1Base::eval_uvvar_gga_uks( XCDeviceData* ){ } +void AoSScheme1Base::eval_uvvar_lda_gks( XCDeviceData* ){ + + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); + +} + +void AoSScheme1Base::eval_uvvar_gga_gks( XCDeviceData* ){ + + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); + +} + void AoSScheme1Base::eval_kern_exc_vxc_lda( const functional_type& func, XCDeviceData* _data ) { diff --git a/src/xc_integrator/local_work_driver/device/scheme1_base.hpp b/src/xc_integrator/local_work_driver/device/scheme1_base.hpp index fe49c8c9..1596818c 100644 --- a/src/xc_integrator/local_work_driver/device/scheme1_base.hpp +++ b/src/xc_integrator/local_work_driver/device/scheme1_base.hpp @@ -27,6 +27,11 @@ struct AoSScheme1Base : public detail::LocalDeviceWorkDriverPIMPL { void eval_zmat_lda_vxc_uks( XCDeviceData* ) override final; void eval_zmat_gga_vxc_uks( XCDeviceData* ) override final; + void eval_uvvar_lda_gks( XCDeviceData* ) override final; + void eval_uvvar_gga_gks( XCDeviceData* ) override final; + void eval_zmat_lda_vxc_gks( XCDeviceData* ) override final; + void eval_zmat_gga_vxc_gks( XCDeviceData* ) override final; + void eval_kern_exc_vxc_lda( const functional_type&, XCDeviceData* ) override final; void eval_kern_exc_vxc_gga( const functional_type&, XCDeviceData* ) override final; void inc_exc( XCDeviceData* ) override final; diff --git a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp index 6697c9f6..44bd4414 100644 --- a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp +++ b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp @@ -33,7 +33,7 @@ class IncoreReplicatedXCDeviceIntegrator : void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) override; + value_type* EXC, const IntegratorSettingsEXC& settings) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -41,7 +41,21 @@ class IncoreReplicatedXCDeviceIntegrator : int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) override; + value_type* EXC, const IntegratorSettingsEXC& settings ) override; + + void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, + const value_type* Pz, + int64_t ldpz, + const value_type* Py, + int64_t ldpy, + const value_type* Px, + int64_t ldpx, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, + value_type* EXC, const IntegratorSettingsEXC& settings ) override; void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, @@ -78,6 +92,24 @@ class IncoreReplicatedXCDeviceIntegrator : host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ); + void exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, + const value_type* Pz, int64_t ldpz, + const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, + host_task_iterator task_begin, host_task_iterator task_end, + XCDeviceData& device_data ); + + void exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, + const value_type* Pz, int64_t ldpz, + const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, + value_type* VXC, int64_t ldvxc, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, value_type *N_EL, + host_task_iterator task_begin, host_task_iterator task_end, + XCDeviceData& device_data ); + void eval_exc_grad_local_work_( const basis_type& basis, const value_type* P, int64_t ldp, host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ); diff --git a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp index 947ef739..4ccac8be 100644 --- a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp @@ -19,7 +19,7 @@ template void IncoreReplicatedXCDeviceIntegrator:: eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXC& settings ) { const auto& basis = this->load_balancer_->basis(); @@ -115,11 +115,31 @@ void IncoreReplicatedXCDeviceIntegrator:: int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) { - GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC); + value_type* EXC, const IntegratorSettingsEXC& settings ) { + GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC,settings); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } +template +void IncoreReplicatedXCDeviceIntegrator:: + eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, + const value_type* Pz, + int64_t ldpz, + const value_type* Py, + int64_t ldpy, + const value_type* Px, + int64_t ldpx, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, + value_type* EXC, const IntegratorSettingsEXC& settings ) { + GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,Py,ldpy,Px,ldpx,VXCs,ldvxcs,VXCz,ldvxcz,VXCy,ldvxcy,VXCx,ldvxcx,EXC,settings); + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); +} + + template void IncoreReplicatedXCDeviceIntegrator:: exc_vxc_local_work_( const basis_type& basis, const value_type* P, int64_t ldp, @@ -284,6 +304,36 @@ void IncoreReplicatedXCDeviceIntegrator:: GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } +template +void IncoreReplicatedXCDeviceIntegrator:: + exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, + const value_type* Pz, int64_t ldpz, + const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, + host_task_iterator task_begin, host_task_iterator task_end, + XCDeviceData& device_data ) { + GauXC::util::unused(basis,Ps,ldps,Pz,ldpz,Py,ldpy,Px,ldpx,task_begin,task_end,device_data); + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); +} + +template +void IncoreReplicatedXCDeviceIntegrator:: + exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, + const value_type* Pz, int64_t ldpz, + const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, value_type *N_EL, + host_task_iterator task_begin, host_task_iterator task_end, + XCDeviceData& device_data ) { + + GauXC::util::unused(basis,Ps,ldps,Pz,ldpz,Py,ldpy,Px,ldpx,VXCs,ldvxcs,VXCz,ldvxcz,VXCy,ldvxcy,VXCx,ldvxcx,EXC,N_EL,task_begin,task_end,device_data); + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); +} + + } } diff --git a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp index 85ac8737..cabdbc50 100644 --- a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp +++ b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp @@ -44,7 +44,7 @@ class ShellBatchedReplicatedXCDeviceIntegrator : void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) override; + value_type* EXC, const IntegratorSettingsEXC& settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -52,7 +52,21 @@ class ShellBatchedReplicatedXCDeviceIntegrator : int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) override; + value_type* EXC, const IntegratorSettingsEXC& settings ) override; + + void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, + const value_type* Pz, + int64_t ldpz, + const value_type* Py, + int64_t ldpy, + const value_type* Px, + int64_t ldpx, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, + value_type* EXC, const IntegratorSettingsEXC& settings ) override; void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD ) override; @@ -74,6 +88,17 @@ class ShellBatchedReplicatedXCDeviceIntegrator : host_task_iterator task_begin, host_task_iterator task_end, XCDeviceData& device_data ); + void exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, + const value_type* Pz, int64_t ldpz, + const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, + value_type* VXC, int64_t ldvxc, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, value_type *N_EL, + host_task_iterator task_begin, host_task_iterator task_end, + XCDeviceData& device_data ); + void eval_exc_grad_local_work_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD, host_task_iterator task_begin, host_task_iterator task_end, diff --git a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp index d0f6c122..c5381553 100644 --- a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp @@ -28,7 +28,7 @@ template void ShellBatchedReplicatedXCDeviceIntegrator:: eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXC& settings ) { const auto& basis = this->load_balancer_->basis(); @@ -93,12 +93,33 @@ void ShellBatchedReplicatedXCDeviceIntegrator:: int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC ) { + value_type* EXC, const IntegratorSettingsEXC& settings ) { - GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC); + GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC,settings); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } + +template +void ShellBatchedReplicatedXCDeviceIntegrator:: + eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, + int64_t ldps, + const value_type* Pz, + int64_t ldpz, + const value_type* Py, + int64_t ldpy, + const value_type* Px, + int64_t ldpx, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, + value_type* EXC, const IntegratorSettingsEXC& settings ) { + GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,Py,ldpy,Px,ldpx,VXCs,ldvxcs,VXCz,ldvxcz,VXCy,ldvxcy,VXCx,ldvxcx,EXC,settings); + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); +} + + template void ShellBatchedReplicatedXCDeviceIntegrator:: exc_vxc_local_work_( const basis_type& basis, const value_type* P, int64_t ldp, @@ -206,6 +227,24 @@ void ShellBatchedReplicatedXCDeviceIntegrator:: GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } +template +void ShellBatchedReplicatedXCDeviceIntegrator:: + exc_vxc_local_work_( const basis_type& basis, const value_type* Ps, int64_t ldps, + const value_type* Pz, int64_t ldpz, + const value_type* Py, int64_t ldpy, + const value_type* Px, int64_t ldpx, + value_type* VXCs, int64_t ldvxcs, + value_type* VXCz, int64_t ldvxcz, + value_type* VXCy, int64_t ldvxcy, + value_type* VXCx, int64_t ldvxcx, value_type* EXC, value_type *N_EL, + host_task_iterator task_begin, host_task_iterator task_end, + XCDeviceData& device_data ) { + + GauXC::util::unused(basis,Ps,ldps,Pz,ldpz,Py,ldpy,Px,ldpx,VXCs,ldvxcs,VXCz,ldvxcz,VXCy,ldvxcy,VXCx,ldvxcx,EXC,N_EL,task_begin,task_end,device_data); + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); +} + + template typename ShellBatchedReplicatedXCDeviceIntegrator::incore_device_task ShellBatchedReplicatedXCDeviceIntegrator:: From 16b931c0e95c4ea018a29c1a4ddb1ca4e5119f27 Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 16:51:03 -0800 Subject: [PATCH 20/24] Fixed typo in GPU functions IntegratorSettingsEXC -> IntegratorSettingsXC --- .../device/incore_replicated_xc_device_integrator.hpp | 6 +++--- .../incore_replicated_xc_device_integrator_exc_vxc.hpp | 6 +++--- .../device/shellbatched_replicated_xc_device_integrator.hpp | 6 +++--- ...shellbatched_replicated_xc_device_integrator_exc_vxc.hpp | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp index 44bd4414..f2439ad4 100644 --- a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp +++ b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator.hpp @@ -33,7 +33,7 @@ class IncoreReplicatedXCDeviceIntegrator : void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXC& settings) override; + value_type* EXC, const IntegratorSettingsXC& settings) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -41,7 +41,7 @@ class IncoreReplicatedXCDeviceIntegrator : int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXC& settings ) override; + value_type* EXC, const IntegratorSettingsXC& settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -55,7 +55,7 @@ class IncoreReplicatedXCDeviceIntegrator : value_type* VXCz, int64_t ldvxcz, value_type* VXCy, int64_t ldvxcy, value_type* VXCx, int64_t ldvxcx, - value_type* EXC, const IntegratorSettingsEXC& settings ) override; + value_type* EXC, const IntegratorSettingsXC& settings ) override; void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, diff --git a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp index 4ccac8be..81716ac9 100644 --- a/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/device/incore_replicated_xc_device_integrator_exc_vxc.hpp @@ -19,7 +19,7 @@ template void IncoreReplicatedXCDeviceIntegrator:: eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXC& settings ) { + value_type* EXC, const IntegratorSettingsXC& settings ) { const auto& basis = this->load_balancer_->basis(); @@ -115,7 +115,7 @@ void IncoreReplicatedXCDeviceIntegrator:: int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXC& settings ) { + value_type* EXC, const IntegratorSettingsXC& settings ) { GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC,settings); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); } @@ -134,7 +134,7 @@ void IncoreReplicatedXCDeviceIntegrator:: value_type* VXCz, int64_t ldvxcz, value_type* VXCy, int64_t ldvxcy, value_type* VXCx, int64_t ldvxcx, - value_type* EXC, const IntegratorSettingsEXC& settings ) { + value_type* EXC, const IntegratorSettingsXC& settings ) { GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,Py,ldpy,Px,ldpx,VXCs,ldvxcs,VXCz,ldvxcz,VXCy,ldvxcy,VXCx,ldvxcx,EXC,settings); GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); } diff --git a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp index cabdbc50..e446df35 100644 --- a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp +++ b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator.hpp @@ -44,7 +44,7 @@ class ShellBatchedReplicatedXCDeviceIntegrator : void eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXC& settings ) override; + value_type* EXC, const IntegratorSettingsXC& settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -52,7 +52,7 @@ class ShellBatchedReplicatedXCDeviceIntegrator : int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXC& settings ) override; + value_type* EXC, const IntegratorSettingsXC& settings ) override; void eval_exc_vxc_( int64_t m, int64_t n, const value_type* Ps, int64_t ldps, @@ -66,7 +66,7 @@ class ShellBatchedReplicatedXCDeviceIntegrator : value_type* VXCz, int64_t ldvxcz, value_type* VXCy, int64_t ldvxcy, value_type* VXCx, int64_t ldvxcx, - value_type* EXC, const IntegratorSettingsEXC& settings ) override; + value_type* EXC, const IntegratorSettingsXC& settings ) override; void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* EXC_GRAD ) override; diff --git a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp index c5381553..64f161d8 100644 --- a/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/device/shellbatched_replicated_xc_device_integrator_exc_vxc.hpp @@ -28,7 +28,7 @@ template void ShellBatchedReplicatedXCDeviceIntegrator:: eval_exc_vxc_( int64_t m, int64_t n, const value_type* P, int64_t ldp, value_type* VXC, int64_t ldvxc, - value_type* EXC, const IntegratorSettingsEXC& settings ) { + value_type* EXC, const IntegratorSettingsXC& settings ) { const auto& basis = this->load_balancer_->basis(); @@ -93,7 +93,7 @@ void ShellBatchedReplicatedXCDeviceIntegrator:: int64_t ldpz, value_type* VXCs, int64_t ldvxcs, value_type* VXCz, int64_t ldvxcz, - value_type* EXC, const IntegratorSettingsEXC& settings ) { + value_type* EXC, const IntegratorSettingsXC& settings ) { GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,VXCs,ldvxcs,VXCz,ldvxcz,EXC,settings); GAUXC_GENERIC_EXCEPTION("UKS NOT YET IMPLEMENTED FOR DEVICE"); @@ -114,7 +114,7 @@ void ShellBatchedReplicatedXCDeviceIntegrator:: value_type* VXCz, int64_t ldvxcz, value_type* VXCy, int64_t ldvxcy, value_type* VXCx, int64_t ldvxcx, - value_type* EXC, const IntegratorSettingsEXC& settings ) { + value_type* EXC, const IntegratorSettingsXC& settings ) { GauXC::util::unused(m,n,Ps,ldps,Pz,ldpz,Py,ldpy,Px,ldpx,VXCs,ldvxcs,VXCz,ldvxcz,VXCy,ldvxcy,VXCx,ldvxcx,EXC,settings); GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED FOR DEVICE"); } From 64094a0a3ab22e39030fd9d71b94205174edd82b Mon Sep 17 00:00:00 2001 From: elambros Date: Fri, 17 Nov 2023 20:00:59 -0800 Subject: [PATCH 21/24] Added unittest for GGA GKS NOT WORKING: getting a difference of ~10^-8 in VXC check --- tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin | Bin 0 -> 28464 bytes tests/xc_integrator.cxx | 96 +++++++++++++++++---- 2 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin diff --git a/tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin b/tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin new file mode 100644 index 0000000000000000000000000000000000000000..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)ZUwP!7QJoz!P#IsT&+CiFZQHgS2dNqkW@ZrbMixb4iLTjTb>qI3< zwY;0==?-@Z74zq2cOJITyPbke+;Vm@$OHTdzo3866a0XuqGO#aF0Vj}i4TxFx#}pr zQ+2}E^c9OqWy2al6;({!oV8)oyoq;-faCAq`0|SgI?Az1!tEwe8?#v~BkA#P`9mJy zPxuA>gP!0AJZWW%lHO|+$)PLH1(w%Dkp-;T&yj7f>9-^9d|p-2LiAHwLf%ilNk30b z(>TF25*u{%Q}QxGNaP*)LmuEy_yzrgp5O<(DwV9hV$zDFduGP=8TqTp4hf?h&X;$R zx_dkM@waqTpFS5tDokHs<3If_f%$^GBY(&P{0YCHf6x>BfG77}ZR>CyWwK(=y#4%R za^xez=d1tN7sLrGb+M$@{!DN2z8;d{=?vx><_q$U{2>qUC;Wo`K~L}lUY6k&iG(&; z@}7UBfG4wsKWl-a z0%>b+@_6KtBgFQnqQN8U7c-dGn4g$um@mjX@`pUYpYRL%2R*?Lc*okrUB9kZBozmx z?R@Ymip2c^^BVIL^9=I^c}M<`2lx|yLI0p9_yO-nK%`7de??M9zkqKt`Xl?l04n&r AssI20 literal 0 HcmV?d00001 diff --git a/tests/xc_integrator.cxx b/tests/xc_integrator.cxx index efeb24d6..38289a53 100644 --- a/tests/xc_integrator.cxx +++ b/tests/xc_integrator.cxx @@ -36,10 +36,10 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, using matrix_type = Eigen::MatrixXd; Molecule mol; BasisSet basis; - matrix_type P, Pz, VXC_ref, VXCz_ref, K_ref; + matrix_type P, Pz, Py, Px, VXC_ref, VXCz_ref, VXCy_ref, VXCx_ref, K_ref; double EXC_ref; std::vector EXC_GRAD_ref; - bool has_k = false, has_exc_grad = false, uks = false; + bool has_k = false, has_exc_grad = false, rks = true, uks = false, gks = false; { read_hdf5_record( mol, reference_file, "/MOLECULE" ); read_hdf5_record( basis, reference_file, "/BASIS" ); @@ -48,36 +48,66 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, std::string den="/DENSITY"; std::string den2="/DENSITY_Z"; + std::string den3="/DENSITY_Y"; + std::string den4="/DENSITY_X"; std::string vxc="/VXC"; std::string vxc2="VXC_Z"; - - if (file.exist("/DENSITY_Z")) { + std::string vxc3="VXC_Y"; + std::string vxc4="VXC_X"; + + if (file.exist("/DENSITY_Z")) { rks = false; } + + if (file.exist("/DENSITY_Z") and not file.exist("/DENSITY_Y") and not file.exist("/DENSITY_X")) { den="/DENSITY_SCALAR"; vxc="/VXC_SCALAR"; uks=true; } - + + if (file.exist("/DENSITY_X") and file.exist("/DENSITY_Y") and file.exist("/DENSITY_Z")) { + den="/DENSITY_SCALAR"; + vxc="/VXC_SCALAR"; + gks=true; + } + auto dset = file.getDataSet(den); auto dims = dset.getDimensions(); P = matrix_type( dims[0], dims[1] ); VXC_ref = matrix_type( dims[0], dims[1] ); - if (uks) { + if (not rks) { Pz = matrix_type( dims[0], dims[1] ); VXCz_ref = matrix_type( dims[0], dims[1] ); + } + if (gks) { + Py = matrix_type( dims[0], dims[1] ); + VXCy_ref = matrix_type( dims[0], dims[1] ); + Px = matrix_type( dims[0], dims[1] ); + VXCx_ref = matrix_type( dims[0], dims[1] ); } + dset.read( P.data() ); dset = file.getDataSet(vxc); dset.read( VXC_ref.data() ); - if (uks) { + if (not rks) { dset = file.getDataSet(den2); dset.read( Pz.data() ); dset = file.getDataSet(vxc2); dset.read( VXCz_ref.data() ); } - + + if (gks) { + dset = file.getDataSet(den3); + dset.read( Py.data() ); + dset = file.getDataSet(vxc3); + dset.read( VXCy_ref.data() ); + dset = file.getDataSet(den4); + dset.read( Px.data() ); + dset = file.getDataSet(vxc4); + dset.read( VXCx_ref.data() ); + } + dset = file.getDataSet("/EXC"); dset.read( &EXC_ref ); @@ -97,7 +127,7 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, } if(uks and ex == ExecutionSpace::Device) return; - + if(gks and ex == ExecutionSpace::Device) return; for( auto& sh : basis ) sh.set_shell_tolerance( std::numeric_limits::epsilon() ); @@ -117,7 +147,7 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, mw.modify_weights(lb); // Construct XC Functional - auto Spin = uks ? ExchCXX::Spin::Polarized : ExchCXX::Spin::Unpolarized; + auto Spin = rks ? ExchCXX::Spin::Unpolarized : ExchCXX::Spin::Polarized; functional_type func( ExchCXX::Backend::builtin, func_key, Spin ); // Construct XCIntegrator @@ -126,7 +156,7 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, auto integrator = integrator_factory.get_instance( func, lb ); // Integrate Density - if( check_integrate_den and not uks ) { + if( check_integrate_den and rks) { auto N_EL_ref = std::accumulate( mol.begin(), mol.end(), 0ul, [](const auto& a, const auto &b) { return a + b.Z.get(); }); auto N_EL = integrator.integrate_den( P ); @@ -135,7 +165,7 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, } // Integrate EXC/VXC - if ( not uks ) { + if ( rks ) { auto [ EXC, VXC ] = integrator.eval_exc_vxc( P ); // Check EXC/VXC @@ -149,7 +179,7 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, auto VXC1_diff_nrm = ( VXC1 - VXC_ref ).norm(); CHECK( VXC1_diff_nrm / basis.nbf() < 1e-10 ); } - } else { + } else if (uks) { auto [ EXC, VXC, VXCz ] = integrator.eval_exc_vxc( P, Pz ); // Check EXC/VXC @@ -168,9 +198,40 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, CHECK( VXCz1_diff_nrm / basis.nbf() < 1e-10 ); } + } else if (gks) { + auto [ EXC, VXC, VXCz, VXCy, VXCx ] = integrator.eval_exc_vxc( P, Pz, Py, Px ); + + // Check EXC/VXC + auto VXC_diff_nrm = ( VXC - VXC_ref ).norm(); + auto VXCz_diff_nrm = ( VXCz - VXCz_ref ).norm(); + auto VXCy_diff_nrm = ( VXCy - VXCy_ref ).norm(); + auto VXCx_diff_nrm = ( VXCx - VXCx_ref ).norm(); + + CHECK( EXC == Approx( EXC_ref ) ); + CHECK( VXC_diff_nrm / basis.nbf() < 1e-10 ); + CHECK( VXCz_diff_nrm / basis.nbf() < 1e-10 ); + CHECK( VXCy_diff_nrm / basis.nbf() < 1e-10 ); + CHECK( VXCx_diff_nrm / basis.nbf() < 1e-10 ); + // Check if the integrator propagates state correctly + { + auto [ EXC1, VXC1, VXCz1, VXCy1, VXCx1] = integrator.eval_exc_vxc( P, Pz, Py, Px ); + CHECK( EXC1 == Approx( EXC_ref ) ); + auto VXC1_diff_nrm = ( VXC1 - VXC_ref ).norm(); + auto VXCz1_diff_nrm = ( VXCz1 - VXCz_ref ).norm(); + auto VXCy1_diff_nrm = ( VXCy1 - VXCy_ref ).norm(); + auto VXCx1_diff_nrm = ( VXCx1 - VXCx_ref ).norm(); + CHECK( VXC1_diff_nrm / basis.nbf() < 1e-10 ); + CHECK( VXCz1_diff_nrm / basis.nbf() < 1e-10 ); + CHECK( VXCy1_diff_nrm / basis.nbf() < 1e-10 ); + CHECK( VXCx1_diff_nrm / basis.nbf() < 1e-10 ); + } + } + + + // Check EXC Grad - if( check_grad and has_exc_grad and not uks) { + if( check_grad and has_exc_grad and rks) { auto EXC_GRAD = integrator.eval_exc_grad( P ); using map_type = Eigen::Map; map_type EXC_GRAD_ref_map( EXC_GRAD_ref.data(), mol.size(), 3 ); @@ -180,7 +241,7 @@ void test_xc_integrator( ExecutionSpace ex, const RuntimeEnvironment& rt, } // Check K - if( has_k and check_k and not uks ) { + if( has_k and check_k and rks ) { auto K = integrator.eval_exx( P ); CHECK((K - K.transpose()).norm() < std::numeric_limits::epsilon()); // Symmetric CHECK( (K - K_ref).norm() / basis.nbf() < 1e-7 ); @@ -290,6 +351,11 @@ TEST_CASE( "XC Integrator", "[xc-integrator]" ) { ExchCXX::Functional::BLYP, PruningScheme::Unpruned ); } + //GKS GGA Test + SECTION( "H3 / BLYP / cc-pvdz" ) { + test_integrator(GAUXC_REF_DATA_PATH "/h3_blyp_cc-pvdz_ssf_gks.bin", + ExchCXX::Functional::BLYP, PruningScheme::Unpruned ); + } // sn-LinK Test SECTION( "Benzene / PBE0 / 6-31G(d)" ) { From 0ed6bd06d8d2ebafe356c0946d9f8b3900e345fb Mon Sep 17 00:00:00 2001 From: elambros Date: Mon, 20 Nov 2023 15:04:36 -0800 Subject: [PATCH 22/24] Cleaned up some formatting and added gaurdrail to prevent GKS+mGGA --- ..._replicated_xc_host_integrator_exc_vxc.hpp | 86 ++++++++++--------- 1 file changed, 45 insertions(+), 41 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index 310bf14e..d180f7d9 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -233,6 +233,10 @@ void ReferenceReplicatedXCHostIntegrator:: const bool needs_laplacian = func.is_mgga() ? true : false; // TODO: Needs Laplacian Check + if (func.is_mgga() and is_gks) { + GAUXC_GENERIC_EXCEPTION("GKS NOT YET IMPLEMENTED WITH mGGA FUNCTIONALS!"); + } + // Get basis map BasisSetMap basis_map(basis,mol); @@ -334,8 +338,8 @@ void ReferenceReplicatedXCHostIntegrator:: // TODO: Add check for Laplacian-dependent functionals if ( needs_laplacian ) { host_data.basis_eval .resize( 11 * npts * nbe ); // basis + grad (3) + hess (6) + lapl - host_data.lapl .resize( spin_dim_scal * npts ); - host_data.vlapl .resize( spin_dim_scal * npts ); + host_data.lapl .resize( spin_dim_scal * npts ); + host_data.vlapl .resize( spin_dim_scal * npts ); } else { host_data.basis_eval .resize( 4 * npts * nbe ); // basis + grad (3) } @@ -418,18 +422,18 @@ void ReferenceReplicatedXCHostIntegrator:: mmat_y = mmat_x + npts * nbe; mmat_z = mmat_y + npts * nbe; if ( needs_laplacian ) { - d2basis_xx_eval = dbasis_z_eval + npts * nbe; - d2basis_xy_eval = d2basis_xx_eval + npts * nbe; - d2basis_xz_eval = d2basis_xy_eval + npts * nbe; - d2basis_yy_eval = d2basis_xz_eval + npts * nbe; - d2basis_yz_eval = d2basis_yy_eval + npts * nbe; - d2basis_zz_eval = d2basis_yz_eval + npts * nbe; - lbasis_eval = d2basis_zz_eval + npts * nbe; + d2basis_xx_eval = dbasis_z_eval + npts * nbe; + d2basis_xy_eval = d2basis_xx_eval + npts * nbe; + d2basis_xz_eval = d2basis_xy_eval + npts * nbe; + d2basis_yy_eval = d2basis_xz_eval + npts * nbe; + d2basis_yz_eval = d2basis_yy_eval + npts * nbe; + d2basis_zz_eval = d2basis_yz_eval + npts * nbe; + lbasis_eval = d2basis_zz_eval + npts * nbe; } if(is_uks) { - mmat_x_z = zmat_z + npts * nbe; - mmat_y_z = mmat_x_z + npts * nbe; - mmat_z_z = mmat_y_z + npts * nbe; + mmat_x_z = zmat_z + npts * nbe; + mmat_y_z = mmat_x_z + npts * nbe; + mmat_z_z = mmat_y_z + npts * nbe; } } @@ -445,8 +449,8 @@ void ReferenceReplicatedXCHostIntegrator:: // TODO: Modify gau2grid to compute Laplacian instead of full hessian lwd->eval_collocation_hessian( npts, nshells, nbe, points, basis, shell_list, basis_eval, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, d2basis_xx_eval, - d2basis_xy_eval, d2basis_xz_eval, d2basis_yy_eval, d2basis_yz_eval, - d2basis_zz_eval); + d2basis_xy_eval, d2basis_xz_eval, d2basis_yy_eval, d2basis_yz_eval, + d2basis_zz_eval); blas::lacpy( 'A', nbe, npts, d2basis_xx_eval, nbe, lbasis_eval, nbe ); blas::axpy( nbe * npts, 1., d2basis_yy_eval, 1, lbasis_eval, 1); blas::axpy( nbe * npts, 1., d2basis_zz_eval, 1, lbasis_eval, 1); @@ -486,13 +490,13 @@ void ReferenceReplicatedXCHostIntegrator:: if( func.is_mgga() ) { if (is_rks) { lwd->eval_uvvar_mgga_rks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, - dbasis_z_eval, lbasis_eval, zmat, nbe, mmat_x, mmat_y, mmat_z, - nbe, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); + dbasis_z_eval, lbasis_eval, zmat, nbe, mmat_x, mmat_y, mmat_z, + nbe, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); } else if (is_uks) { lwd->eval_uvvar_mgga_uks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, - dbasis_z_eval, lbasis_eval, zmat, nbe, zmat_z, nbe, - mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe, - den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); + dbasis_z_eval, lbasis_eval, zmat, nbe, zmat_z, nbe, + mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe, + den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); } } else if ( func.is_gga() ) { if(is_rks) { @@ -548,21 +552,21 @@ void ReferenceReplicatedXCHostIntegrator:: if( func.is_mgga() ){ for( int32_t i = 0; i < npts; ++i) { - vtau[spin_dim_scal*i] *= weights[i]; - vgamma[gga_dim_scal*i] *= weights[i]; - if(not is_rks) { - vgamma[gga_dim_scal*i+1] *= weights[i]; - vgamma[gga_dim_scal*i+2] *= weights[i]; - vtau[spin_dim_scal*i+1] *= weights[i]; - } - - // TODO: Add checks for Lapacian-dependent functionals - if( needs_laplacian ) { + vtau[spin_dim_scal*i] *= weights[i]; + vgamma[gga_dim_scal*i] *= weights[i]; + if(not is_rks) { + vgamma[gga_dim_scal*i+1] *= weights[i]; + vgamma[gga_dim_scal*i+2] *= weights[i]; + vtau[spin_dim_scal*i+1] *= weights[i]; + } + + // TODO: Add checks for Lapacian-dependent functionals + if( needs_laplacian ) { vlapl[spin_dim_scal*i] *= weights[i]; if(not is_rks) { vlapl[spin_dim_scal*i+1] *= weights[i]; - } - } + } + } } } @@ -571,17 +575,17 @@ void ReferenceReplicatedXCHostIntegrator:: // Evaluate Z matrix for VXC if( func.is_mgga() ) { if(is_rks) { - lwd->eval_zmat_mgga_vxc_rks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, - dbasis_y_eval, dbasis_z_eval, lbasis_eval, - dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe); - lwd->eval_mmat_mgga_vxc_rks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, - mmat_x, mmat_y, mmat_z, nbe); + lwd->eval_zmat_mgga_vxc_rks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, + dbasis_y_eval, dbasis_z_eval, lbasis_eval, + dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe); + lwd->eval_mmat_mgga_vxc_rks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, + mmat_x, mmat_y, mmat_z, nbe); } else if (is_uks) { - lwd->eval_zmat_mgga_vxc_uks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, - dbasis_y_eval, dbasis_z_eval, lbasis_eval, - dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe, zmat_z, nbe); - lwd->eval_mmat_mgga_vxc_uks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, - mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe); + lwd->eval_zmat_mgga_vxc_uks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, + dbasis_y_eval, dbasis_z_eval, lbasis_eval, + dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe, zmat_z, nbe); + lwd->eval_mmat_mgga_vxc_uks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, + mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe); } } else if( func.is_gga() ) { From 5c7eed72cab2fa56fae635a7b53d1baca6d5da20 Mon Sep 17 00:00:00 2001 From: elambros Date: Mon, 20 Nov 2023 15:10:00 -0800 Subject: [PATCH 23/24] Retabbed to remove leftover tab characters --- ..._replicated_xc_host_integrator_exc_vxc.hpp | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp index d180f7d9..e8ee7383 100644 --- a/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp +++ b/src/xc_integrator/replicated/host/reference_replicated_xc_host_integrator_exc_vxc.hpp @@ -338,8 +338,8 @@ void ReferenceReplicatedXCHostIntegrator:: // TODO: Add check for Laplacian-dependent functionals if ( needs_laplacian ) { host_data.basis_eval .resize( 11 * npts * nbe ); // basis + grad (3) + hess (6) + lapl - host_data.lapl .resize( spin_dim_scal * npts ); - host_data.vlapl .resize( spin_dim_scal * npts ); + host_data.lapl .resize( spin_dim_scal * npts ); + host_data.vlapl .resize( spin_dim_scal * npts ); } else { host_data.basis_eval .resize( 4 * npts * nbe ); // basis + grad (3) } @@ -422,18 +422,18 @@ void ReferenceReplicatedXCHostIntegrator:: mmat_y = mmat_x + npts * nbe; mmat_z = mmat_y + npts * nbe; if ( needs_laplacian ) { - d2basis_xx_eval = dbasis_z_eval + npts * nbe; - d2basis_xy_eval = d2basis_xx_eval + npts * nbe; - d2basis_xz_eval = d2basis_xy_eval + npts * nbe; - d2basis_yy_eval = d2basis_xz_eval + npts * nbe; - d2basis_yz_eval = d2basis_yy_eval + npts * nbe; - d2basis_zz_eval = d2basis_yz_eval + npts * nbe; - lbasis_eval = d2basis_zz_eval + npts * nbe; + d2basis_xx_eval = dbasis_z_eval + npts * nbe; + d2basis_xy_eval = d2basis_xx_eval + npts * nbe; + d2basis_xz_eval = d2basis_xy_eval + npts * nbe; + d2basis_yy_eval = d2basis_xz_eval + npts * nbe; + d2basis_yz_eval = d2basis_yy_eval + npts * nbe; + d2basis_zz_eval = d2basis_yz_eval + npts * nbe; + lbasis_eval = d2basis_zz_eval + npts * nbe; } if(is_uks) { - mmat_x_z = zmat_z + npts * nbe; - mmat_y_z = mmat_x_z + npts * nbe; - mmat_z_z = mmat_y_z + npts * nbe; + mmat_x_z = zmat_z + npts * nbe; + mmat_y_z = mmat_x_z + npts * nbe; + mmat_z_z = mmat_y_z + npts * nbe; } } @@ -446,11 +446,11 @@ void ReferenceReplicatedXCHostIntegrator:: // Evaluate Collocation (+ Grad and Hessian) if( func.is_mgga() ) { if ( needs_laplacian ) { - // TODO: Modify gau2grid to compute Laplacian instead of full hessian + // TODO: Modify gau2grid to compute Laplacian instead of full hessian lwd->eval_collocation_hessian( npts, nshells, nbe, points, basis, shell_list, basis_eval, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, d2basis_xx_eval, - d2basis_xy_eval, d2basis_xz_eval, d2basis_yy_eval, d2basis_yz_eval, - d2basis_zz_eval); + d2basis_xy_eval, d2basis_xz_eval, d2basis_yy_eval, d2basis_yz_eval, + d2basis_zz_eval); blas::lacpy( 'A', nbe, npts, d2basis_xx_eval, nbe, lbasis_eval, nbe ); blas::axpy( nbe * npts, 1., d2basis_yy_eval, 1, lbasis_eval, 1); blas::axpy( nbe * npts, 1., d2basis_zz_eval, 1, lbasis_eval, 1); @@ -490,13 +490,13 @@ void ReferenceReplicatedXCHostIntegrator:: if( func.is_mgga() ) { if (is_rks) { lwd->eval_uvvar_mgga_rks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, - dbasis_z_eval, lbasis_eval, zmat, nbe, mmat_x, mmat_y, mmat_z, - nbe, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); + dbasis_z_eval, lbasis_eval, zmat, nbe, mmat_x, mmat_y, mmat_z, + nbe, den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); } else if (is_uks) { lwd->eval_uvvar_mgga_uks( npts, nbe, basis_eval, dbasis_x_eval, dbasis_y_eval, - dbasis_z_eval, lbasis_eval, zmat, nbe, zmat_z, nbe, - mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe, - den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); + dbasis_z_eval, lbasis_eval, zmat, nbe, zmat_z, nbe, + mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe, + den_eval, dden_x_eval, dden_y_eval, dden_z_eval, gamma, tau, lapl); } } else if ( func.is_gga() ) { if(is_rks) { @@ -552,21 +552,21 @@ void ReferenceReplicatedXCHostIntegrator:: if( func.is_mgga() ){ for( int32_t i = 0; i < npts; ++i) { - vtau[spin_dim_scal*i] *= weights[i]; - vgamma[gga_dim_scal*i] *= weights[i]; - if(not is_rks) { - vgamma[gga_dim_scal*i+1] *= weights[i]; - vgamma[gga_dim_scal*i+2] *= weights[i]; - vtau[spin_dim_scal*i+1] *= weights[i]; - } - - // TODO: Add checks for Lapacian-dependent functionals - if( needs_laplacian ) { + vtau[spin_dim_scal*i] *= weights[i]; + vgamma[gga_dim_scal*i] *= weights[i]; + if(not is_rks) { + vgamma[gga_dim_scal*i+1] *= weights[i]; + vgamma[gga_dim_scal*i+2] *= weights[i]; + vtau[spin_dim_scal*i+1] *= weights[i]; + } + + // TODO: Add checks for Lapacian-dependent functionals + if( needs_laplacian ) { vlapl[spin_dim_scal*i] *= weights[i]; if(not is_rks) { vlapl[spin_dim_scal*i+1] *= weights[i]; - } - } + } + } } } @@ -575,17 +575,17 @@ void ReferenceReplicatedXCHostIntegrator:: // Evaluate Z matrix for VXC if( func.is_mgga() ) { if(is_rks) { - lwd->eval_zmat_mgga_vxc_rks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, - dbasis_y_eval, dbasis_z_eval, lbasis_eval, - dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe); - lwd->eval_mmat_mgga_vxc_rks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, - mmat_x, mmat_y, mmat_z, nbe); + lwd->eval_zmat_mgga_vxc_rks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, + dbasis_y_eval, dbasis_z_eval, lbasis_eval, + dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe); + lwd->eval_mmat_mgga_vxc_rks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, + mmat_x, mmat_y, mmat_z, nbe); } else if (is_uks) { - lwd->eval_zmat_mgga_vxc_uks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, - dbasis_y_eval, dbasis_z_eval, lbasis_eval, - dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe, zmat_z, nbe); - lwd->eval_mmat_mgga_vxc_uks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, - mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe); + lwd->eval_zmat_mgga_vxc_uks( npts, nbe, vrho, vgamma, vlapl, basis_eval, dbasis_x_eval, + dbasis_y_eval, dbasis_z_eval, lbasis_eval, + dden_x_eval, dden_y_eval, dden_z_eval, zmat, nbe, zmat_z, nbe); + lwd->eval_mmat_mgga_vxc_uks( npts, nbe, vtau, vlapl, dbasis_x_eval, dbasis_y_eval, dbasis_z_eval, + mmat_x, mmat_y, mmat_z, nbe, mmat_x_z, mmat_y_z, mmat_z_z, nbe); } } else if( func.is_gga() ) { From 2db7c713779f5a0ed8af38327a241050977b6fc5 Mon Sep 17 00:00:00 2001 From: elambros Date: Mon, 20 Nov 2023 16:17:17 -0800 Subject: [PATCH 24/24] Fixes GKS GGA unittest ref to use builtin backend --- tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin | Bin 28464 -> 28464 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin b/tests/ref_data/h3_blyp_cc-pvdz_ssf_gks.bin index f14482d5873ec25cb5da1c2a9cfb84755b5ecb2d..a9e4bacc48fb18376b3b1850f8ed5289ace6af55 100644 GIT binary patch literal 28464 zcmeHv30w_*|Mn?KvZW9eLiQ}#m-9Q*CR(J0ZV^(cEF~?H+tOmoP6{oAkQQZ$=**c) zX`vK}Qc)KhN{NPx)xhnfac%=DNPu^_`j1DgSx8dOc*7 zWO>||j0{hTC)f56-+qX{Ca!N^gXh?8Eq)*&UhWYuBPH7(NbtCSJYIkC`rhLG|FLeN z*_=5%o+J)iI*P2wF$h@C7U(Y~USct8JG%C&9j$NE*3 z-KOQf-f6Y1smi%EK$nxLq>aX_EnLRR2F-b|uHsNH%I(Cv!?bf~@ z>)-88Ud)6mF0Ws@%G`K?F4qfSdy8N7yBGcDiK_VVn-RZR`4xI8Mr|T@3qo>E!u!aBK*DNs8 zpQ~@ozJ@(^?ls)`oWsHO(_i7Ro7pq}-(5d=D{$L+JV)`e{n;O{AKKS;eD6@8LxBzj zIuz(o;NL?5ocFk+d9aa&O%0hCl_hpRs5SFH9yE6^p)3NUmvY;Gehuc% z*6jU#gQGsTY%w!wTYCG7TwB??iy`gxhyU<=Q-Wn%ov}K1)@9H0?F(Ld+cO?-xA-|v zBBZVEg-`qb4)17RipzL7o*{v5ANSAW5bNmphxPIbkAL4^>_EIkTezp(akklG zHbecV`Xv6~Jh$3{)DEBgg-_rW&L^d6(msJYRsXR*`6S~LpML6nhfn_ClaBMw@6Ut( z>F1sQ>ivt3^G^Fz{ZBvd{4<|)oOjswC-6$g{SJ@Uao+je&*6SEPo&#^&eZ;m`CvCWRFe~-m5wqei-a=u z9`(|^T&kqizSsG=m#M;Rg9GOjw=r^BcB;8~dzp#Kxz2}bGlbXkykBv3y!uyHBG|f| zl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