Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ src/xc_integrator/local_work_driver/host/obara_saika/test/*.x
src/xc_integrator/local_work_driver/host/obara_saika/generator/integral*
src/xc_integrator/local_work_driver/host/obara_saika/generator/obara*
src/xc_integrator/local_work_driver/host/obara_saika/generator/*.x
*.swp
4 changes: 2 additions & 2 deletions cmake/gauxc-dep-versions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ set( GAUXC_CUTLASS_REPOSITORY https://github.com/NVIDIA/cutlass.git )
set( GAUXC_CUTLASS_REVISION v2.10.0 )

set( GAUXC_EXCHCXX_REPOSITORY https://github.com/wavefunction91/ExchCXX.git )
set( GAUXC_EXCHCXX_REVISION 21a4700a826ec0beae1311a1d59677393bcb168f )
set( GAUXC_EXCHCXX_REVISION f932a1bd3a0ff9d5b1de4cfe7fe86bfb1f20cb74 )

set( GAUXC_GAU2GRID_REPOSITORY https://github.com/dgasmith/gau2grid.git )
set( GAUXC_GAU2GRID_REVISION v2.0.6 )

set( GAUXC_INTEGRATORXX_REPOSITORY https://github.com/wavefunction91/IntegratorXX.git )
set( GAUXC_INTEGRATORXX_REVISION ea07dedd37e7bd49ea06394eb811599002b34b49 )
set( GAUXC_INTEGRATORXX_REVISION cf2917c64916583cef1081011beab3085b66e352 )

set( GAUXC_HIGHFIVE_REPOSITORY https://github.com/BlueBrain/HighFive.git )
set( GAUXC_HIGHFIVE_REVISION 805f0e13d09b47c4b01d40682621904aa3b31bb8 )
2 changes: 2 additions & 0 deletions include/gauxc/enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace GauXC {
* Generally mapped to equivalent enums in IntegratorXX
*/
enum class RadialQuad {
Becke, ///< Becke radial quadrature
MuraKnowles, ///< Mura-Knowles radial quadrature
MurrayHandyLaming, ///< Murray-Handy-Laming radial quadrature
TreutlerAldrichs ///< Treutler-Aldrichs radial quadrature
Expand All @@ -38,6 +39,7 @@ enum class AtomicGridSizeDefault {
* molecular integration
*/
enum class XCWeightAlg {
NOTPARTITIONED, ///< Not partitioned
Becke, ///< The original Becke weighting scheme
SSF, ///< The Stratmann-Scuseria-Frisch weighting scheme
LKO ///< The Lauqua-Kuessman-Ochsenfeld weighting scheme
Expand Down
6 changes: 6 additions & 0 deletions include/gauxc/load_balancer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <gauxc/xc_task.hpp>
#include <gauxc/util/timer.hpp>
#include <gauxc/runtime_environment.hpp>
#include <gauxc/enums.hpp>

namespace GauXC {

Expand All @@ -27,6 +28,8 @@ namespace detail {
struct LoadBalancerState {
bool modified_weights_are_stored = false;
///< Whether the load balancer currently stores partitioned weights
XCWeightAlg weight_alg = XCWeightAlg::NOTPARTITIONED;
///< Weight partitioning scheme used by this LoadBalancer
};


Expand Down Expand Up @@ -77,6 +80,9 @@ class LoadBalancer {
/// Return internal timing tracker
const util::Timer& get_timings() const;

/// Return the total number of points for local tasks
size_t total_npts() const;

/// Return the maximum number of points for local tasks
size_t max_npts() const;

Expand Down
1 change: 1 addition & 0 deletions include/gauxc/molgrid/defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ namespace GauXC {
double slater_radius_64(AtomicNumber);
double slater_radius_30(AtomicNumber);
double clementi_radius_67(AtomicNumber);
double uff_radius_103(AtomicNumber);
double default_atomic_radius(AtomicNumber);

RadialScale default_mk_radial_scaling_factor( AtomicNumber );
Expand Down
2 changes: 2 additions & 0 deletions include/gauxc/runtime_environment/decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ class DeviceRuntimeEnvironment : public RuntimeEnvironment {
bool owns_memory() const;
DeviceBackend* device_backend() const;

void release_buffer();
void set_buffer(void* m, size_t sz);
};
#endif

Expand Down
5 changes: 0 additions & 5 deletions include/gauxc/shell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ class alignas(256) Shell {
};


#if 0
template <typename T>
inline std::ostream& operator<<( std::ostream& os, const Shell<T>& sh ) {
os << "GauXC::Shell:( O={"
Expand All @@ -234,9 +233,6 @@ inline std::ostream& operator<<( std::ostream& os, const Shell<T>& sh ) {
os << " ";
os << " {l=" << sh.l() << ",sph=" << sh.pure() << "}";
os << std::endl;
os << " {cr=" << sh.cutoff_radius() << ",cv=" << sh.cutoff_val()
<<",mr=" << sh.max_radius() << ",mv=" << sh.max_val() << "}";
os << std::endl;

for(auto i=0ul; i<sh.nprim(); ++i) {
os << " " << sh.alpha()[i];
Expand All @@ -246,6 +242,5 @@ inline std::ostream& operator<<( std::ostream& os, const Shell<T>& sh ) {

return os;
}
#endif

}
14 changes: 13 additions & 1 deletion include/gauxc/xc_integrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class XCIntegrator {
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;
using fxc_contraction_type_rks = matrix_type;
using fxc_contraction_type_uks = std::tuple< matrix_type, matrix_type >;
using dd_psi_type = std::vector< value_type >;
using dd_psi_potential_type = matrix_type;

private:

Expand Down Expand Up @@ -66,11 +70,19 @@ class XCIntegrator {
exc_vxc_type_gks eval_exc_vxc ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&,
const IntegratorSettingsXC& = IntegratorSettingsXC{});

exc_grad_type eval_exc_grad( const MatrixType& );
exc_grad_type eval_exc_grad( const MatrixType&, const IntegratorSettingsXC& = IntegratorSettingsXC{} );
exc_grad_type eval_exc_grad( const MatrixType&, const MatrixType&, const IntegratorSettingsXC& = IntegratorSettingsXC{} );

exx_type eval_exx ( const MatrixType&,
const IntegratorSettingsEXX& = IntegratorSettingsEXX{} );

fxc_contraction_type_rks eval_fxc_contraction ( const MatrixType&, const MatrixType&,
const IntegratorSettingsXC& = IntegratorSettingsXC{} );
fxc_contraction_type_uks eval_fxc_contraction ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&,
const IntegratorSettingsXC& = IntegratorSettingsXC{} );

dd_psi_type eval_dd_psi( const MatrixType&, unsigned );
dd_psi_potential_type eval_dd_psi_potential( const MatrixType&, unsigned );

const util::Timer& get_timings() const;
const LoadBalancer& load_balancer() const;
Expand Down
42 changes: 40 additions & 2 deletions include/gauxc/xc_integrator/impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,16 @@ typename XCIntegrator<MatrixType>::exc_vxc_type_gks

template <typename MatrixType>
typename XCIntegrator<MatrixType>::exc_grad_type
XCIntegrator<MatrixType>::eval_exc_grad( const MatrixType& P ) {
XCIntegrator<MatrixType>::eval_exc_grad( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->eval_exc_grad(P);
return pimpl_->eval_exc_grad(P, ks_settings);
};

template <typename MatrixType>
typename XCIntegrator<MatrixType>::exc_grad_type
XCIntegrator<MatrixType>::eval_exc_grad( const MatrixType& Ps, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->eval_exc_grad(Ps, Pz, ks_settings);
};

template <typename MatrixType>
Expand All @@ -89,6 +96,37 @@ typename XCIntegrator<MatrixType>::exx_type
return pimpl_->eval_exx(P,settings);
};

template <typename MatrixType>
typename XCIntegrator<MatrixType>::fxc_contraction_type_rks
XCIntegrator<MatrixType>::eval_fxc_contraction( const MatrixType& P, const MatrixType& tP,
const IntegratorSettingsXC& ks_settings ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->eval_fxc_contraction(P, tP, ks_settings);
};

template <typename MatrixType>
typename XCIntegrator<MatrixType>::fxc_contraction_type_uks
XCIntegrator<MatrixType>::eval_fxc_contraction( const MatrixType& Ps, const MatrixType& Pz,
const MatrixType& tPs, const MatrixType& tPz, const IntegratorSettingsXC& ks_settings ) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->eval_fxc_contraction(Ps, Pz, tPs, tPz, ks_settings);
};

template <typename MatrixType>
typename XCIntegrator<MatrixType>::dd_psi_type
XCIntegrator<MatrixType>::eval_dd_psi(const MatrixType& P, unsigned max_Ylm) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->eval_dd_psi(P, max_Ylm);
}

template <typename MatrixType>
typename XCIntegrator<MatrixType>::dd_psi_potential_type
XCIntegrator<MatrixType>::eval_dd_psi_potential(const MatrixType& X, unsigned max_Ylm) {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
return pimpl_->eval_dd_psi_potential(X, max_Ylm);
}


template <typename MatrixType>
const util::Timer& XCIntegrator<MatrixType>::get_timings() const {
if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
Expand Down
79 changes: 77 additions & 2 deletions include/gauxc/xc_integrator/replicated/impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,27 @@ typename ReplicatedXCIntegrator<MatrixType>::exc_vxc_type_gks

template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::exc_grad_type
ReplicatedXCIntegrator<MatrixType>::eval_exc_grad_( const MatrixType& P ) {
ReplicatedXCIntegrator<MatrixType>::eval_exc_grad_( const MatrixType& P, const IntegratorSettingsXC& ks_settings ) {

if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();

std::vector<value_type> EXC_GRAD( 3*pimpl_->load_balancer().molecule().natoms() );
pimpl_->eval_exc_grad( P.rows(), P.cols(), P.data(), P.rows(),
EXC_GRAD.data() );
EXC_GRAD.data(), ks_settings );

return EXC_GRAD;

}

template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::exc_grad_type
ReplicatedXCIntegrator<MatrixType>::eval_exc_grad_( const MatrixType& Ps, const MatrixType& Pz, const IntegratorSettingsXC& ks_settings ) {

if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();

std::vector<value_type> EXC_GRAD( 3*pimpl_->load_balancer().molecule().natoms() );
pimpl_->eval_exc_grad( Ps.rows(), Ps.cols(), Ps.data(), Ps.rows(), Pz.data(), Pz.rows(),
EXC_GRAD.data(), ks_settings );

return EXC_GRAD;

Expand All @@ -184,6 +198,67 @@ typename ReplicatedXCIntegrator<MatrixType>::exx_type

return K;

}
template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::fxc_contraction_type_rks
ReplicatedXCIntegrator<MatrixType>::eval_fxc_contraction_( const MatrixType& P,
const MatrixType& tP, const IntegratorSettingsXC& ks_settings ) {

if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
matrix_type FXC( P.rows(), P.cols() );

pimpl_->eval_fxc_contraction( P.rows(), P.cols(), P.data(), P.rows(),
tP.data(), tP.rows(),
FXC.data(), FXC.rows(), ks_settings );

return FXC;
}

template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::fxc_contraction_type_uks
ReplicatedXCIntegrator<MatrixType>::eval_fxc_contraction_( const MatrixType& Ps, const MatrixType& Pz,
const MatrixType& tPs, const MatrixType& tPz, const IntegratorSettingsXC& ks_settings ) {

if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();
matrix_type FXCs( Ps.rows(), Ps.cols() );
matrix_type FXCz( Pz.rows(), Pz.cols() );

pimpl_->eval_fxc_contraction( Ps.rows(), Ps.cols(), Ps.data(), Ps.rows(),
Pz.data(), Pz.rows(),
tPs.data(), tPs.rows(),
tPz.data(), tPz.rows(),
FXCs.data(), FXCs.rows(),
FXCz.data(), FXCz.rows(), ks_settings );

return std::make_tuple( FXCs, FXCz );

}

template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::dd_psi_type
ReplicatedXCIntegrator<MatrixType>::eval_dd_psi_( const MatrixType& P, unsigned max_Ylm ) {

if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();

const size_t natoms = pimpl_->load_balancer().molecule().natoms();
const size_t Ylm_sz = (max_Ylm + 1) * ( max_Ylm + 1);
std::vector<value_type> ddPsi(natoms * Ylm_sz, 0.0);
pimpl_->eval_dd_psi(P.rows(), P.cols(), P.data(), P.rows(), max_Ylm, ddPsi.data(), Ylm_sz);
return ddPsi;
}

template <typename MatrixType>
typename ReplicatedXCIntegrator<MatrixType>::dd_psi_potential_type
ReplicatedXCIntegrator<MatrixType>::eval_dd_psi_potential_( const MatrixType& X, unsigned max_Ylm ) {

if( not pimpl_ ) GAUXC_PIMPL_NOT_INITIALIZED();

const size_t nbf = pimpl_->load_balancer().basis().nbf();
matrix_type Vddx(nbf, nbf);
Vddx.setZero();
pimpl_->eval_dd_psi_potential(X.rows(), X.cols(), X.data(), max_Ylm, Vddx.data());
return Vddx;

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,30 @@ class ReplicatedXCIntegratorImpl {
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,
int64_t ldp, value_type* EXC_GRAD ) = 0;
virtual void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldp,
value_type* EXC_GRAD, const IntegratorSettingsXC& ks_settings ) = 0;
virtual void eval_exc_grad_( int64_t m, int64_t n, const value_type* P, int64_t ldps,
const value_type* Pz, int64_t lpdz, value_type* EXC_GRAD, const IntegratorSettingsXC& ks_settings ) = 0;
virtual void eval_exx_( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* K, int64_t ldk,
const IntegratorSettingsEXX& settings ) = 0;
virtual void eval_fxc_contraction_( int64_t m, int64_t n,
const value_type* P, int64_t ldp,
const value_type* tP, int64_t ldtp,
value_type* FXC, int64_t ldfxc,
const IntegratorSettingsXC& ks_settings )=0;
virtual void eval_fxc_contraction_( int64_t m, int64_t n,
const value_type* Ps, int64_t ldps,
const value_type* Pz, int64_t ldpz,
const value_type* tPs, int64_t ldtps,
const value_type* tPz, int64_t ldtpz,
value_type* FXCs, int64_t ldfxcs,
value_type* FXCz, int64_t ldfxcz,
const IntegratorSettingsXC& ks_settings )=0;
virtual void eval_dd_psi_( int64_t m, int64_t n, const value_type* P, int64_t ldp, unsigned max_Ylm,
value_type* ddPsi, int64_t ldPsi ) = 0;
virtual void eval_dd_psi_potential_( int64_t m, int64_t n, const value_type* X, unsigned max_Ylm,
value_type* Vddx) = 0;

public:

Expand Down Expand Up @@ -130,13 +149,36 @@ class ReplicatedXCIntegratorImpl {
value_type* EXC, const IntegratorSettingsXC& ks_settings );


void eval_exc_grad( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* EXC_GRAD );
void eval_exc_grad( int64_t m, int64_t n, const value_type* P, int64_t ldp,
value_type* EXC_GRAD, const IntegratorSettingsXC& ks_settings );
void eval_exc_grad( int64_t m, int64_t n, const value_type* Ps, int64_t ldps,
const value_type* Pz, int64_t ldpz, value_type* EXC_GRAD, const IntegratorSettingsXC& ks_settings );

void eval_exx( int64_t m, int64_t n, const value_type* P,
int64_t ldp, value_type* K, int64_t ldk,
const IntegratorSettingsEXX& settings );

void eval_fxc_contraction( int64_t m, int64_t n, const value_type* P,
int64_t ldp,
const value_type* tP, int64_t ldtp,
value_type* FXC, int64_t ldfxc,
const IntegratorSettingsXC& ks_settings );

void eval_fxc_contraction( int64_t m, int64_t n, const value_type* Ps,
int64_t ldps,
const value_type* Pz, int64_t ldpz,
const value_type* tPs, int64_t ldtps,
const value_type* tPz, int64_t ldtpz,
value_type* FXCs, int64_t ldfxcs,
value_type* FXCz, int64_t ldfxcz,
const IntegratorSettingsXC& ks_settings );

void eval_dd_psi( int64_t m, int64_t n, const value_type* P,
int64_t ldp, unsigned max_Ylm,
value_type* ddPsi, int64_t ldPsi );
void eval_dd_psi_potential( int64_t m, int64_t n, const value_type* X, unsigned max_Ylm,
value_type* Vddx );

inline const util::Timer& get_timings() const { return timer_; }

inline std::unique_ptr< LocalWorkDriver > release_local_work_driver() {
Expand Down
11 changes: 10 additions & 1 deletion include/gauxc/xc_integrator/replicated_xc_integrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class ReplicatedXCIntegrator : public XCIntegratorImpl<MatrixType> {
using exc_vxc_type_gks = typename XCIntegratorImpl<MatrixType>::exc_vxc_type_gks;
using exc_grad_type = typename XCIntegratorImpl<MatrixType>::exc_grad_type;
using exx_type = typename XCIntegratorImpl<MatrixType>::exx_type;
using fxc_contraction_type_rks = typename XCIntegratorImpl<MatrixType>::fxc_contraction_type_rks;
using fxc_contraction_type_uks = typename XCIntegratorImpl<MatrixType>::fxc_contraction_type_uks;
using dd_psi_type = typename XCIntegratorImpl<MatrixType>::dd_psi_type;
using dd_psi_potential_type = typename XCIntegratorImpl<MatrixType>::dd_psi_potential_type;

private:

Expand All @@ -46,8 +50,13 @@ class ReplicatedXCIntegrator : public XCIntegratorImpl<MatrixType> {
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;
exc_grad_type eval_exc_grad_( const MatrixType&, const IntegratorSettingsXC& ) override;
exc_grad_type eval_exc_grad_( const MatrixType&, const MatrixType&, const IntegratorSettingsXC& ) override;
exx_type eval_exx_ ( const MatrixType&, const IntegratorSettingsEXX& ) override;
fxc_contraction_type_rks eval_fxc_contraction_ ( const MatrixType&, const MatrixType&, const IntegratorSettingsXC& ) override;
fxc_contraction_type_uks eval_fxc_contraction_ ( const MatrixType&, const MatrixType&, const MatrixType&, const MatrixType&, const IntegratorSettingsXC&) override;
dd_psi_type eval_dd_psi_( const MatrixType& , unsigned ) override;
dd_psi_potential_type eval_dd_psi_potential_( const MatrixType& , unsigned ) override;
const util::Timer& get_timings_() const override;
const LoadBalancer& get_load_balancer_() const override;
LoadBalancer& get_load_balancer_() override;
Expand Down
Loading