Psi4
Public Member Functions | Private Attributes | List of all members
psi::pk::PKMgrYoshimine Class Reference

#include <PKmanagers.h>

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

Public Member Functions

 PKMgrYoshimine (std::shared_ptr< PSIO > psio, std::shared_ptr< BasisSet > primary, size_t memory, Options &options)
 Constructor. More...
 
virtual ~PKMgrYoshimine ()
 Destructor. More...
 
virtual void prestripe_files ()
 Pre-striping the IWL pre-sorted bucket files. More...
 
virtual void prestripe_files_wK ()
 Pre-striping for IWL wK pre-sorted files. More...
 
virtual void form_PK ()
 Gather all steps to form PK. More...
 
virtual void form_PK_wK ()
 Steps to form the supermatrix for wK. More...
 
virtual void allocate_buffers ()
 Allocating the buffers for each thread. More...
 
virtual void allocate_buffers_wK ()
 Allocating buffers for wK integrals. More...
 
virtual void compute_integrals (bool wK=false)
 Computing the integrals. More...
 
virtual void compute_integrals_wK ()
 computing wK integrals More...
 
virtual void write ()
 Writing of the last partially filled buffers. More...
 
virtual void write_wK ()
 Writing of the last partially filled buffers for wK. More...
 
void sort_ints (bool wK=false)
 Reading and sorting integrals to generate PK file. More...
 
void sort_ints_wK ()
 Reading and sorting wK integrals for PK file. More...
 
void close_iwl_buckets ()
 Close the IWL bucket files. More...
 
void close_iwl_buckets_wK ()
 Close the IWL bucket file for wK. More...
 
void generate_J_PK (double *twoel_ints, size_t max_size)
 Generate the J PK supermatrix from IWL integrals. More...
 
void generate_K_PK (double *twoel_ints, size_t max_size)
 Generate the K PK supermatrix from IWL integrals. More...
 
void generate_wK_PK (double *twoel_ints, size_t max_size)
 Generate the wK PK supermatrix from IWL integrals. More...
 
- Public Member Functions inherited from psi::pk::PKMgrDisk
 PKMgrDisk (std::shared_ptr< PSIO > psio, std::shared_ptr< BasisSet > primary, size_t memory, Options &options)
 Constructor for PKMgrDisk. More...
 
virtual ~PKMgrDisk ()
 Destructor for PKMgrDisk, does nothing. More...
 
void set_writing (bool tmp)
 Setter/Getter functions. More...
 
bool writing () const
 
int pk_file () const
 
std::vector< size_t > & batch_ind_min ()
 
std::vector< size_t > & batch_ind_max ()
 
std::vector< size_t > & batch_pq_min ()
 
std::vector< size_t > & batch_pq_max ()
 
std::vector< int > & batch_for_pq ()
 
std::shared_ptr< AIOHandlerAIO () const
 
std::shared_ptr< PSIOpsio () const
 
virtual void finalize_PK ()
 Finalize the PK file formation. More...
 
virtual void initialize ()
 Initialize sequence for Disk algorithms. More...
 
virtual void initialize_wK ()
 
virtual void prepare_JK (std::vector< SharedMatrix > D, std::vector< SharedMatrix > Cl, std::vector< SharedMatrix > Cr)
 Prepare the JK formation for disk algorithms. More...
 
void batch_sizing ()
 Determining the batch sizes. More...
 
virtual void print_batches ()
 Printing out the batches. More...
 
void open_PK_file ()
 Opening the PK file. More...
 
virtual void close_PK_file (bool keep)
 Closing the files. More...
 
virtual void form_J (std::vector< SharedMatrix > J, std::string exch="", std::vector< SharedMatrix > K=std::vector< SharedMatrix >())
 Form J from PK supermatrix, shared_ptr() initialized to null. More...
 
virtual void finalize_JK ()
 Finalize JK matrix formation. More...
 
- Public Member Functions inherited from psi::pk::PKManager
 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 print_batches_wK ()
 Some printing for wK integrals;. 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...
 
void form_D_vec (std::vector< SharedMatrix > D, std::vector< SharedMatrix > Cl, std::vector< SharedMatrix > Cr)
 
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...
 

Private Attributes

int iwl_file_J_
 Files of pre-sorted IWL integral buckets. More...
 
int iwl_file_K_
 
int iwl_file_wK_
 
size_t ints_per_buf_
 Number of integrals per buckets. More...
 
size_t iwl_int_size_
 Total size of one IWL buffer on disk in bytes. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from psi::pk::PKManager
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 inherited from psi::pk::PKManager
void fill_buffer (SharedPKWrkr tmp)
 Setter objects for internal data. More...
 

Detailed Description

Yoshimine sorting algoritm: the integrals are divided in N batches that can individually fit in memory. Then, all integrals are computed only once, and sorted in N little buffers, one for each batch. As soon as a buffer is full, it gets dumped onto one of N temporary files on disk in IWL format.

Once all integrals are computed and pre-sorted in the N IWL files, each file is read and its integrals sorted, then written onto the PK files.

This routine takes advantage of OMP parallelization, then each thread has N little buffers. All disk writing is handled by a dedicated thread generated by AIOHandler

Constructor & Destructor Documentation

psi::pk::PKMgrYoshimine::PKMgrYoshimine ( std::shared_ptr< PSIO psio,
std::shared_ptr< BasisSet primary,
size_t  memory,
Options options 
)

Constructor.

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

Destructor.

Member Function Documentation

void psi::pk::PKMgrYoshimine::allocate_buffers ( )
virtual

Allocating the buffers for each thread.

Implements psi::pk::PKManager.

void psi::pk::PKMgrYoshimine::allocate_buffers_wK ( )
virtual

Allocating buffers for wK integrals.

Implements psi::pk::PKMgrDisk.

void psi::pk::PKMgrYoshimine::close_iwl_buckets ( )

Close the IWL bucket files.

void psi::pk::PKMgrYoshimine::close_iwl_buckets_wK ( )

Close the IWL bucket file for wK.

void psi::pk::PKMgrYoshimine::compute_integrals ( bool  wK = false)
virtual

Computing the integrals.

Reimplemented from psi::pk::PKManager.

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

computing wK integrals

Reimplemented from psi::pk::PKManager.

void psi::pk::PKMgrYoshimine::form_PK ( )
virtual

Gather all steps to form PK.

Implements psi::pk::PKManager.

void psi::pk::PKMgrYoshimine::form_PK_wK ( )
virtual

Steps to form the supermatrix for wK.

Implements psi::pk::PKManager.

void psi::pk::PKMgrYoshimine::generate_J_PK ( double *  twoel_ints,
size_t  max_size 
)

Generate the J PK supermatrix from IWL integrals.

void psi::pk::PKMgrYoshimine::generate_K_PK ( double *  twoel_ints,
size_t  max_size 
)

Generate the K PK supermatrix from IWL integrals.

void psi::pk::PKMgrYoshimine::generate_wK_PK ( double *  twoel_ints,
size_t  max_size 
)

Generate the wK PK supermatrix from IWL integrals.

void psi::pk::PKMgrYoshimine::prestripe_files ( )
virtual

Pre-striping the IWL pre-sorted bucket files.

Implements psi::pk::PKMgrDisk.

void psi::pk::PKMgrYoshimine::prestripe_files_wK ( )
virtual

Pre-striping for IWL wK pre-sorted files.

Implements psi::pk::PKMgrDisk.

void psi::pk::PKMgrYoshimine::sort_ints ( bool  wK = false)

Reading and sorting integrals to generate PK file.

void psi::pk::PKMgrYoshimine::sort_ints_wK ( )

Reading and sorting wK integrals for PK file.

void psi::pk::PKMgrYoshimine::write ( )
virtual

Writing of the last partially filled buffers.

Reimplemented from psi::pk::PKMgrDisk.

void psi::pk::PKMgrYoshimine::write_wK ( )
virtual

Writing of the last partially filled buffers for wK.

Reimplemented from psi::pk::PKMgrDisk.

Member Data Documentation

size_t psi::pk::PKMgrYoshimine::ints_per_buf_
private

Number of integrals per buckets.

int psi::pk::PKMgrYoshimine::iwl_file_J_
private

Files of pre-sorted IWL integral buckets.

int psi::pk::PKMgrYoshimine::iwl_file_K_
private
int psi::pk::PKMgrYoshimine::iwl_file_wK_
private
size_t psi::pk::PKMgrYoshimine::iwl_int_size_
private

Total size of one IWL buffer on disk in bytes.


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