Psi4
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
psi::pk::PKManager Class Referenceabstract

#include <PKmanagers.h>

Inheritance diagram for psi::pk::PKManager:
psi::pk::PKMgrDisk psi::pk::PKMgrInCore psi::pk::PKMgrReorder psi::pk::PKMgrYoshimine

Public Member Functions

 PKManager (std::shared_ptr< BasisSet > primary, size_t memory, Options &options)
 Base constructor. More...
 
virtual ~PKManager ()
 Base destructor, does nothing. More...
 
bool do_wk () const
 Accessor functions for simple data. More...
 
double omega () const
 
double cutoff () const
 
int nthreads () const
 
int nbf () const
 
std::shared_ptr< ERISievesieve () const
 
size_t pk_pairs () const
 
size_t pk_size () const
 
size_t ntasks () const
 
size_t memory () const
 
SharedPKWrkr buffer (int i) const
 
double * D_glob_vecs (int i) const
 
double * JK_glob_vecs (int i) const
 
std::shared_ptr< BasisSetprimary () const
 
bool is_sym (int i) const
 
bool all_sym () const
 
SharedMatrix original_D (int N) const
 
SharedPKWrkr get_buffer ()
 Accessor that returns buffer corresponding to current thread. More...
 
void set_ntasks (size_t tmp)
 
virtual void initialize ()=0
 
virtual void initialize_wK ()=0
 Initialize for wK integrals. More...
 
virtual void form_PK ()=0
 Forming the PK supermatrices. More...
 
virtual void form_PK_wK ()=0
 Forming PK supermatrices for wK. More...
 
virtual void prepare_JK (std::vector< SharedMatrix > D, std::vector< SharedMatrix > Cl, std::vector< SharedMatrix > Cr)=0
 Preparing JK computation. More...
 
virtual void finalize_JK ()=0
 Cleaning up after JK computation. More...
 
virtual void print_batches ()
 Function to print batch sizing information. More...
 
virtual void print_batches_wK ()
 Some printing for wK integrals;. More...
 
virtual void allocate_buffers ()=0
 Allocating the thread buffers. More...
 
virtual void compute_integrals (bool wK=false)
 Actually computing the integrals. More...
 
virtual void compute_integrals_wK ()
 Computing integrals for wK. More...
 
virtual void finalize_PK ()=0
 Deallocating the thread buffers. More...
 
void integrals_buffering (const double *buffer, size_t P, size_t Q, size_t R, size_t S)
 Store the computed integrals in the appropriate buffers. More...
 
void integrals_buffering_wK (const double *buffer, size_t P, size_t Q, size_t R, size_t S)
 Store the computed wK integrals in the appropriate buffers. More...
 
virtual void write ()=0
 Write the buffers of integrals to PK storage. More...
 
virtual void write_wK ()=0
 Write the buffers of wK integrals to PK storage. More...
 
void form_D_vec (std::vector< SharedMatrix > D, std::vector< SharedMatrix > Cl, std::vector< SharedMatrix > Cr)
 
virtual void form_J (std::vector< SharedMatrix > J, std::string exch="", std::vector< SharedMatrix > K=std::vector< SharedMatrix >())=0
 Forming J, shared_ptr() initializes to null. More...
 
void make_J_vec (std::vector< SharedMatrix > J)
 Preparing triangular vector for J/K. More...
 
void get_results (std::vector< SharedMatrix > J, std::string exch)
 Extracting results from vectors to matrix. More...
 
void form_K (std::vector< SharedMatrix > K)
 Forming K. More...
 
virtual void form_wK (std::vector< SharedMatrix > wK)
 Forming wK. More...
 
void finalize_D ()
 Finalize and delete the density matrix vectors. More...
 

Static Public Member Functions

static std::shared_ptr< PKManagerbuild_PKManager (std::shared_ptr< PSIO > psio, std::shared_ptr< BasisSet > primary, size_t memory, Options &options, bool dowK, double omega_in=0)
 build_PKManager Static instance constructor, used to get a proper instance of PKManager through automatic selection and options provided More...
 

Protected Member Functions

void fill_buffer (SharedPKWrkr tmp)
 Setter objects for internal data. More...
 

Private Member Functions

void set_wK (bool dowK)
 Setter functions for internal wK options. More...
 
void set_omega (double omega_in)
 

Private Attributes

Optionsoptions_
 
double cutoff_
 Integral cutoff to apply. More...
 
std::shared_ptr< BasisSetprimary_
 
int nthreads_
 
int nbf_
 Number of basis functions. More...
 
size_t ntasks_
 Number of tasks for integral computation. More...
 
bool do_wK_
 Do wK in addition to regular J and K? More...
 
double omega_
 Value for omeaga. More...
 
std::shared_ptr< ERISievesieve_
 Sieving object for the integrals. More...
 
size_t pk_pairs_
 Size of triangular list of PK pairs. More...
 
size_t pk_size_
 Total size of the four-index triangular PK. More...
 
size_t memory_
 Total memory available in doubles. More...
 
std::vector< SharedPKWrkriobuffers_
 Array of IOBuffer_PK for task handling. More...
 
std::vector< double * > D_vec_
 Vector of triangular D matrices. More...
 
std::vector< SharedMatrixD_
 
std::vector< bool > symmetric_
 Vector of booleans, true if corresponding density matrix is symmetric. More...
 
bool all_sym_
 Are all density matrices symmetric? More...
 
std::vector< double * > JK_vec_
 Vector of triangular result J/K matrices. More...
 

Detailed Description

Class PKManager

Manages the different algorithms available for PK and stores data shared by all algorithms.

This class is abstract and specific instances must be obtained by constructing an object corresponding to the desired algorithm, or automatically selected through the static build_PKManager

For more details about each algorithm, see PK_workers.h

Constructor & Destructor Documentation

psi::pk::PKManager::PKManager ( std::shared_ptr< BasisSet primary,
size_t  memory,
Options options 
)

Base constructor.

virtual psi::pk::PKManager::~PKManager ( )
inlinevirtual

Base destructor, does nothing.

Member Function Documentation

bool psi::pk::PKManager::all_sym ( ) const
inline
virtual void psi::pk::PKManager::allocate_buffers ( )
pure virtual

Allocating the thread buffers.

Implemented in psi::pk::PKMgrInCore, psi::pk::PKMgrYoshimine, and psi::pk::PKMgrReorder.

SharedPKWrkr psi::pk::PKManager::buffer ( int  i) const
inline
std::shared_ptr< PKManager > psi::pk::PKManager::build_PKManager ( std::shared_ptr< PSIO psio,
std::shared_ptr< BasisSet primary,
size_t  memory,
Options options,
bool  dowK,
double  omega_in = 0 
)
static

build_PKManager Static instance constructor, used to get a proper instance of PKManager through automatic selection and options provided

Returns
abstract PKmanager object tuned with relevant options
void psi::pk::PKManager::compute_integrals ( bool  wK = false)
virtual

Actually computing the integrals.

Reimplemented in psi::pk::PKMgrYoshimine.

void psi::pk::PKManager::compute_integrals_wK ( )
virtual

Computing integrals for wK.

Reimplemented in psi::pk::PKMgrYoshimine.

double psi::pk::PKManager::cutoff ( ) const
inline
double* psi::pk::PKManager::D_glob_vecs ( int  i) const
inline
bool psi::pk::PKManager::do_wk ( ) const
inline

Accessor functions for simple data.

void psi::pk::PKManager::fill_buffer ( SharedPKWrkr  tmp)
inlineprotected

Setter objects for internal data.

void psi::pk::PKManager::finalize_D ( )

Finalize and delete the density matrix vectors.

virtual void psi::pk::PKManager::finalize_JK ( )
pure virtual

Cleaning up after JK computation.

Implemented in psi::pk::PKMgrInCore, and psi::pk::PKMgrDisk.

virtual void psi::pk::PKManager::finalize_PK ( )
pure virtual

Deallocating the thread buffers.

Implemented in psi::pk::PKMgrInCore, psi::pk::PKMgrReorder, and psi::pk::PKMgrDisk.

void psi::pk::PKManager::form_D_vec ( std::vector< SharedMatrix D,
std::vector< SharedMatrix Cl,
std::vector< SharedMatrix Cr 
)

Actual computation of J and K Prepare the density matrix

virtual void psi::pk::PKManager::form_J ( std::vector< SharedMatrix J,
std::string  exch = "",
std::vector< SharedMatrix K = std::vector< SharedMatrix >() 
)
pure virtual

Forming J, shared_ptr() initializes to null.

Implemented in psi::pk::PKMgrInCore, and psi::pk::PKMgrDisk.

void psi::pk::PKManager::form_K ( std::vector< SharedMatrix K)

Forming K.

virtual void psi::pk::PKManager::form_PK ( )
pure virtual

Forming the PK supermatrices.

Implemented in psi::pk::PKMgrInCore, psi::pk::PKMgrYoshimine, and psi::pk::PKMgrReorder.

virtual void psi::pk::PKManager::form_PK_wK ( )
pure virtual

Forming PK supermatrices for wK.

Implemented in psi::pk::PKMgrInCore, psi::pk::PKMgrYoshimine, and psi::pk::PKMgrReorder.

void psi::pk::PKManager::form_wK ( std::vector< SharedMatrix wK)
virtual

Forming wK.

SharedPKWrkr psi::pk::PKManager::get_buffer ( )

Accessor that returns buffer corresponding to current thread.

void psi::pk::PKManager::get_results ( std::vector< SharedMatrix J,
std::string  exch 
)

Extracting results from vectors to matrix.

virtual void psi::pk::PKManager::initialize ( )
pure virtual

Pure virtual initialize function: contains batch sizing and file opening if needed, allocation of thread buffers

Implemented in psi::pk::PKMgrInCore, and psi::pk::PKMgrDisk.

virtual void psi::pk::PKManager::initialize_wK ( )
pure virtual

Initialize for wK integrals.

Implemented in psi::pk::PKMgrInCore, and psi::pk::PKMgrDisk.

void psi::pk::PKManager::integrals_buffering ( const double *  buffer,
size_t  P,
size_t  Q,
size_t  R,
size_t  S 
)

Store the computed integrals in the appropriate buffers.

void psi::pk::PKManager::integrals_buffering_wK ( const double *  buffer,
size_t  P,
size_t  Q,
size_t  R,
size_t  S 
)

Store the computed wK integrals in the appropriate buffers.

bool psi::pk::PKManager::is_sym ( int  i) const
inline
double* psi::pk::PKManager::JK_glob_vecs ( int  i) const
inline
void psi::pk::PKManager::make_J_vec ( std::vector< SharedMatrix J)

Preparing triangular vector for J/K.

size_t psi::pk::PKManager::memory ( ) const
inline
int psi::pk::PKManager::nbf ( ) const
inline
size_t psi::pk::PKManager::ntasks ( ) const
inline
int psi::pk::PKManager::nthreads ( ) const
inline
double psi::pk::PKManager::omega ( ) const
inline
SharedMatrix psi::pk::PKManager::original_D ( int  N) const
inline
size_t psi::pk::PKManager::pk_pairs ( ) const
inline
size_t psi::pk::PKManager::pk_size ( ) const
inline
virtual void psi::pk::PKManager::prepare_JK ( std::vector< SharedMatrix D,
std::vector< SharedMatrix Cl,
std::vector< SharedMatrix Cr 
)
pure virtual

Preparing JK computation.

Implemented in psi::pk::PKMgrInCore, and psi::pk::PKMgrDisk.

std::shared_ptr< BasisSet > psi::pk::PKManager::primary ( ) const
inline
void psi::pk::PKManager::print_batches ( )
virtual

Function to print batch sizing information.

Reimplemented in psi::pk::PKMgrInCore, and psi::pk::PKMgrDisk.

virtual void psi::pk::PKManager::print_batches_wK ( )
inlinevirtual

Some printing for wK integrals;.

void psi::pk::PKManager::set_ntasks ( size_t  tmp)
inline
void psi::pk::PKManager::set_omega ( double  omega_in)
inlineprivate
void psi::pk::PKManager::set_wK ( bool  dowK)
inlineprivate

Setter functions for internal wK options.

std::shared_ptr< ERISieve > psi::pk::PKManager::sieve ( ) const
inline
virtual void psi::pk::PKManager::write ( )
pure virtual

Write the buffers of integrals to PK storage.

Implemented in psi::pk::PKMgrInCore, psi::pk::PKMgrYoshimine, and psi::pk::PKMgrDisk.

virtual void psi::pk::PKManager::write_wK ( )
pure virtual

Write the buffers of wK integrals to PK storage.

Implemented in psi::pk::PKMgrInCore, psi::pk::PKMgrYoshimine, and psi::pk::PKMgrDisk.

Member Data Documentation

bool psi::pk::PKManager::all_sym_
private

Are all density matrices symmetric?

double psi::pk::PKManager::cutoff_
private

Integral cutoff to apply.

std::vector<SharedMatrix> psi::pk::PKManager::D_
private

Vector of original D matrices. We keep it around for building exchange in non-symmetric cases.

std::vector<double*> psi::pk::PKManager::D_vec_
private

Vector of triangular D matrices.

bool psi::pk::PKManager::do_wK_
private

Do wK in addition to regular J and K?

std::vector<SharedPKWrkr> psi::pk::PKManager::iobuffers_
private

Array of IOBuffer_PK for task handling.

std::vector<double*> psi::pk::PKManager::JK_vec_
private

Vector of triangular result J/K matrices.

size_t psi::pk::PKManager::memory_
private

Total memory available in doubles.

int psi::pk::PKManager::nbf_
private

Number of basis functions.

size_t psi::pk::PKManager::ntasks_
private

Number of tasks for integral computation.

int psi::pk::PKManager::nthreads_
private
double psi::pk::PKManager::omega_
private

Value for omeaga.

Options& psi::pk::PKManager::options_
private
size_t psi::pk::PKManager::pk_pairs_
private

Size of triangular list of PK pairs.

size_t psi::pk::PKManager::pk_size_
private

Total size of the four-index triangular PK.

std::shared_ptr<BasisSet> psi::pk::PKManager::primary_
private
std::shared_ptr<ERISieve> psi::pk::PKManager::sieve_
private

Sieving object for the integrals.

std::vector< bool > psi::pk::PKManager::symmetric_
private

Vector of booleans, true if corresponding density matrix is symmetric.


The documentation for this class was generated from the following files: