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

#include <PKmanagers.h>

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

Public Member Functions

 PKMgrReorder (std::shared_ptr< PSIO > psio, std::shared_ptr< BasisSet > primary, size_t memory, Options &options)
 Constructor. More...
 
 ~PKMgrReorder () override
 Destructor. More...
 
void form_PK () override
 Sequence of operations to form PK for reorder algo. More...
 
void form_PK_wK () override
 Forming PK for wK integrals. More...
 
void prestripe_files () override
 Pre-striping the PK file. More...
 
void prestripe_files_wK () override
 Pre-striping PK file for wK integrals. More...
 
void allocate_buffers () override
 Allocating the buffers for each thread. More...
 
void allocate_buffers_wK () override
 
void finalize_PK () override
 
- 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...
 
 ~PKMgrDisk () override
 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
 
void initialize () override
 Initialize sequence for Disk algorithms. More...
 
void initialize_wK () override
 
void prepare_JK (std::vector< SharedMatrix > D, std::vector< SharedMatrix > Cl, std::vector< SharedMatrix > Cr) override
 Prepare the JK formation for disk algorithms. More...
 
void batch_sizing ()
 Determining the batch sizes. More...
 
void print_batches () override
 Printing out the batches. More...
 
void write () override
 Write integrals on disk. More...
 
void write_wK () override
 Write wK integrals on disk. More...
 
void open_PK_file ()
 Opening the PK file. More...
 
virtual void close_PK_file (bool keep)
 Closing the files. More...
 
void form_J (std::vector< SharedMatrix > J, std::string exch="", std::vector< SharedMatrix > K=std::vector< SharedMatrix >()) override
 Form J from PK supermatrix, shared_ptr() initialized to null. More...
 
void finalize_JK () override
 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...
 
virtual void compute_integrals (bool wK=false)
 Actually computing the integrals. More...
 
virtual void compute_integrals_wK ()
 Computing integrals for wK. 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

std::vector< char * > label_J_
 
std::vector< char * > label_K_
 
std::vector< char * > label_wK_
 
size_t max_mem_buf_
 

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

Reorder algorithm: we divide the integrals in batches, as large as possible. Then each thread computes one batch of ordered integrals, meaning the thread gets assigned a list of shell quartets to go through to obtain the relevant integrals. Because of this division, some shell quartets will be recomputed several times. For low memory, Yoshimine is recommended and selected automatically by the build_PKManager constructor.

This routine uses OMP multithreading. A dedicated thread generated by AIOHandler handles all disk I/O

Constructor & Destructor Documentation

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

Constructor.

psi::pk::PKMgrReorder::~PKMgrReorder ( )
inlineoverride

Destructor.

Member Function Documentation

void psi::pk::PKMgrReorder::allocate_buffers ( )
overridevirtual

Allocating the buffers for each thread.

Implements psi::pk::PKManager.

void psi::pk::PKMgrReorder::allocate_buffers_wK ( )
overridevirtual

De-allocating buffer space for J/K supermatrices and allocating space for wK. Allows us to use buffers twice as big

Implements psi::pk::PKMgrDisk.

void psi::pk::PKMgrReorder::finalize_PK ( )
overridevirtual

Finalize PK: synchronize AIO writing, delete thread buffers, keep PK file open since we are going to use it immediately

Reimplemented from psi::pk::PKMgrDisk.

void psi::pk::PKMgrReorder::form_PK ( )
overridevirtual

Sequence of operations to form PK for reorder algo.

Implements psi::pk::PKManager.

void psi::pk::PKMgrReorder::form_PK_wK ( )
overridevirtual

Forming PK for wK integrals.

Implements psi::pk::PKManager.

void psi::pk::PKMgrReorder::prestripe_files ( )
overridevirtual

Pre-striping the PK file.

Implements psi::pk::PKMgrDisk.

void psi::pk::PKMgrReorder::prestripe_files_wK ( )
overridevirtual

Pre-striping PK file for wK integrals.

Implements psi::pk::PKMgrDisk.

Member Data Documentation

std::vector<char*> psi::pk::PKMgrReorder::label_J_
private
std::vector<char*> psi::pk::PKMgrReorder::label_K_
private
std::vector<char*> psi::pk::PKMgrReorder::label_wK_
private
size_t psi::pk::PKMgrReorder::max_mem_buf_
private

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