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...
 
virtual ~PKMgrReorder ()
 Destructor. More...
 
virtual void form_PK ()
 Sequence of operations to form PK for reorder algo. More...
 
virtual void form_PK_wK ()
 Forming PK for wK integrals. More...
 
virtual void prestripe_files ()
 Pre-striping the PK file. More...
 
virtual void prestripe_files_wK ()
 Pre-striping PK file for wK integrals. More...
 
virtual void allocate_buffers ()
 Allocating the buffers for each thread. More...
 
virtual void allocate_buffers_wK ()
 
virtual void finalize_PK ()
 
- 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 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...
 
virtual void write ()
 Write integrals on disk. More...
 
virtual void write_wK ()
 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...
 
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...
 
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.

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

Destructor.

Member Function Documentation

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

Allocating the buffers for each thread.

Implements psi::pk::PKManager.

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

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 ( )
virtual

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 ( )
virtual

Sequence of operations to form PK for reorder algo.

Implements psi::pk::PKManager.

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

Forming PK for wK integrals.

Implements psi::pk::PKManager.

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

Pre-striping the PK file.

Implements psi::pk::PKMgrDisk.

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

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: