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

#include <PK_workers.h>

Inheritance diagram for psi::pk::PKWorker:
psi::pk::PKWrkrInCore psi::pk::PKWrkrIWL psi::pk::PKWrkrReord

Public Member Functions

 PKWorker (std::shared_ptr< BasisSet > primary, SharedSieve sieve, std::shared_ptr< AIOHandler > AIO, int target_file, size_t buf_size)
 Constructor for PKWorker. More...
 
virtual ~PKWorker ()
 Destructor for PKWorker, does nothing. More...
 
std::shared_ptr< AIOHandlerAIO () const
 Accessor functions. More...
 
size_t nbuf () const
 
size_t buf_size () const
 
size_t max_idx () const
 
size_t offset () const
 
int target_file () const
 
unsigned int bufidx () const
 
unsigned int P () const
 
unsigned int Q () const
 
unsigned int R () const
 
unsigned int S () const
 
bool do_wK () const
 
void set_do_wK (bool tmp)
 Set do_wK. More...
 
virtual void initialize_task ()=0
 
void first_quartet (size_t i)
 Set up the first shell quartet to be computed. More...
 
bool more_work ()
 Is there a shell quartet left to compute ? More...
 
void next_quartet ()
 Get the next shell quartet for the current worker. More...
 
virtual void allocate_wK (size_t buf_size, unsigned int buf_per_thread)
 Reallocate the buffer memory for wK. More...
 
virtual void allocate_wK (std::shared_ptr< std::vector< size_t >> pos, int wKfile)
 For IWL, we need different arguments. More...
 
virtual void fill_values (double val, size_t i, size_t j, size_t k, size_t l)=0
 Filling integral values in the relevant buffers. More...
 
virtual void fill_values_wK (double val, size_t i, size_t j, size_t k, size_t l)=0
 Filling integral values in the relevant buffers for wK. More...
 
virtual void write (std::vector< size_t > min_ind, std::vector< size_t > max_ind, size_t pk_pairs)=0
 Writing integral arrays for storage. More...
 
virtual void write_wK (std::vector< size_t > min_ind, std::vector< size_t > max_ind, size_t pk_pairs)
 Writing wK integral arrays for storage. More...
 
virtual void finalize_ints (size_t pk_pairs)
 For in-core: only finalize the integral array. More...
 
virtual void finalize_ints_wK (size_t pk_pairs)
 For in-core: only finalize the wK integral array. More...
 
virtual bool pop_value (unsigned int bufid, double &val, size_t &i, size_t &j, size_t &k, size_t &l)
 Functions specific to disk pre-sorting of integrals. More...
 
virtual bool pop_value_wK (unsigned int bufid, double &val, size_t &i, size_t &j, size_t &k, size_t &l)
 Functions specific to disk pre-sorting of integrals. More...
 
virtual void insert_value (unsigned int bufid, double val, size_t i, size_t j, size_t k, size_t l)
 
virtual void insert_value_wK (unsigned int bufid, double val, size_t i, size_t j, size_t k, size_t l)
 
virtual void flush ()
 Flush a buffer to disk. More...
 
virtual void flush_wK ()
 

Static Public Member Functions

static char * get_label_J (const int batch)
 Get TOC labels for J or K. More...
 
static char * get_label_K (const int batch)
 
static char * get_label_wK (const int batch)
 

Protected Member Functions

void set_nbuf (unsigned int tmp)
 Setter function for nbuf_. More...
 
void set_bufsize (size_t len)
 Setting the buffer size, changes for wK. More...
 
void set_max_idx (size_t tmp)
 Setter function for max_idx. More...
 

Private Member Functions

bool is_shell_relevant ()
 Is the current shell relevant to the current worker ? More...
 
 PKWorker (const PKWorker &other)
 
PKWorkeroperator= (PKWorker &other)
 

Private Attributes

std::shared_ptr< BasisSetprimary_
 Current basis set. More...
 
SharedSieve sieve_
 Current sieve. More...
 
bool do_wK_
 Are we doing wK? More...
 
std::shared_ptr< AIOHandlerAIO_
 AIOHandler. More...
 
int target_file_
 File to write to. More...
 
UniqueAOShellIt shelliter_
 Iterator over basis functions within a shell quartet. More...
 
unsigned int bufidx_
 Current global index of the buffer. More...
 
size_t offset_
 Current offset. More...
 
size_t max_idx_
 Current max ijkl index in the buffer. More...
 
size_t buf_size_
 Size of one buffer. More...
 
unsigned int nbuf_
 Number of buffers in the worker. More...
 
bool shells_left_
 Are there any shells left ? More...
 
unsigned int P_
 Indices of the current shell quartet. More...
 
unsigned int Q_
 
unsigned int R_
 
unsigned int S_
 

Detailed Description

PK_worker: Base class for PK workers, objects which take care of storing integrals in the appropriate buffers/files during the various algorithms handling PK supermatrix formation. This class only provides a common implementation for relevant derived workers.

Constructor & Destructor Documentation

psi::pk::PKWorker::PKWorker ( const PKWorker other)
inlineprivate
psi::pk::PKWorker::PKWorker ( std::shared_ptr< BasisSet primary,
SharedSieve  sieve,
std::shared_ptr< AIOHandler AIO,
int  target_file,
size_t  buf_size 
)

Constructor for PKWorker.

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

Destructor for PKWorker, does nothing.

Member Function Documentation

std::shared_ptr< AIOHandler > psi::pk::PKWorker::AIO ( ) const
inline

Accessor functions.

virtual void psi::pk::PKWorker::allocate_wK ( size_t  buf_size,
unsigned int  buf_per_thread 
)
inlinevirtual

Reallocate the buffer memory for wK.

Reimplemented in psi::pk::PKWrkrReord.

virtual void psi::pk::PKWorker::allocate_wK ( std::shared_ptr< std::vector< size_t >>  pos,
int  wKfile 
)
inlinevirtual

For IWL, we need different arguments.

Reimplemented in psi::pk::PKWrkrIWL.

size_t psi::pk::PKWorker::buf_size ( ) const
inline
unsigned int psi::pk::PKWorker::bufidx ( ) const
inline
bool psi::pk::PKWorker::do_wK ( ) const
inline
virtual void psi::pk::PKWorker::fill_values ( double  val,
size_t  i,
size_t  j,
size_t  k,
size_t  l 
)
pure virtual

Filling integral values in the relevant buffers.

Implemented in psi::pk::PKWrkrIWL, psi::pk::PKWrkrInCore, and psi::pk::PKWrkrReord.

virtual void psi::pk::PKWorker::fill_values_wK ( double  val,
size_t  i,
size_t  j,
size_t  k,
size_t  l 
)
pure virtual

Filling integral values in the relevant buffers for wK.

Implemented in psi::pk::PKWrkrIWL, psi::pk::PKWrkrInCore, and psi::pk::PKWrkrReord.

virtual void psi::pk::PKWorker::finalize_ints ( size_t  pk_pairs)
inlinevirtual

For in-core: only finalize the integral array.

Reimplemented in psi::pk::PKWrkrInCore.

virtual void psi::pk::PKWorker::finalize_ints_wK ( size_t  pk_pairs)
inlinevirtual

For in-core: only finalize the wK integral array.

Reimplemented in psi::pk::PKWrkrInCore.

void psi::pk::PKWorker::first_quartet ( size_t  i)

Set up the first shell quartet to be computed.

virtual void psi::pk::PKWorker::flush ( )
inlinevirtual

Flush a buffer to disk.

Reimplemented in psi::pk::PKWrkrIWL.

virtual void psi::pk::PKWorker::flush_wK ( )
inlinevirtual

Reimplemented in psi::pk::PKWrkrIWL.

char * psi::pk::PKWorker::get_label_J ( const int  batch)
static

Get TOC labels for J or K.

char * psi::pk::PKWorker::get_label_K ( const int  batch)
static
char * psi::pk::PKWorker::get_label_wK ( const int  batch)
static
virtual void psi::pk::PKWorker::initialize_task ( )
pure virtual

Get max ijkl index included in current buffer Overloaded by specific derived classes

Implemented in psi::pk::PKWrkrIWL, psi::pk::PKWrkrInCore, and psi::pk::PKWrkrReord.

virtual void psi::pk::PKWorker::insert_value ( unsigned int  bufid,
double  val,
size_t  i,
size_t  j,
size_t  k,
size_t  l 
)
inlinevirtual

Reimplemented in psi::pk::PKWrkrIWL.

virtual void psi::pk::PKWorker::insert_value_wK ( unsigned int  bufid,
double  val,
size_t  i,
size_t  j,
size_t  k,
size_t  l 
)
inlinevirtual

Reimplemented in psi::pk::PKWrkrIWL.

bool psi::pk::PKWorker::is_shell_relevant ( )
private

Is the current shell relevant to the current worker ?

size_t psi::pk::PKWorker::max_idx ( ) const
inline
bool psi::pk::PKWorker::more_work ( )
inline

Is there a shell quartet left to compute ?

size_t psi::pk::PKWorker::nbuf ( ) const
inline
void psi::pk::PKWorker::next_quartet ( )

Get the next shell quartet for the current worker.

size_t psi::pk::PKWorker::offset ( ) const
inline
PKWorker& psi::pk::PKWorker::operator= ( PKWorker other)
inlineprivate
unsigned int psi::pk::PKWorker::P ( ) const
inline
virtual bool psi::pk::PKWorker::pop_value ( unsigned int  bufid,
double &  val,
size_t &  i,
size_t &  j,
size_t &  k,
size_t &  l 
)
inlinevirtual

Functions specific to disk pre-sorting of integrals.

Reimplemented in psi::pk::PKWrkrIWL.

virtual bool psi::pk::PKWorker::pop_value_wK ( unsigned int  bufid,
double &  val,
size_t &  i,
size_t &  j,
size_t &  k,
size_t &  l 
)
inlinevirtual

Functions specific to disk pre-sorting of integrals.

Reimplemented in psi::pk::PKWrkrIWL.

unsigned int psi::pk::PKWorker::Q ( ) const
inline
unsigned int psi::pk::PKWorker::R ( ) const
inline
unsigned int psi::pk::PKWorker::S ( ) const
inline
void psi::pk::PKWorker::set_bufsize ( size_t  len)
inlineprotected

Setting the buffer size, changes for wK.

void psi::pk::PKWorker::set_do_wK ( bool  tmp)
inline

Set do_wK.

void psi::pk::PKWorker::set_max_idx ( size_t  tmp)
inlineprotected

Setter function for max_idx.

void psi::pk::PKWorker::set_nbuf ( unsigned int  tmp)
inlineprotected

Setter function for nbuf_.

int psi::pk::PKWorker::target_file ( ) const
inline
virtual void psi::pk::PKWorker::write ( std::vector< size_t >  min_ind,
std::vector< size_t >  max_ind,
size_t  pk_pairs 
)
pure virtual

Writing integral arrays for storage.

Implemented in psi::pk::PKWrkrIWL, psi::pk::PKWrkrInCore, and psi::pk::PKWrkrReord.

virtual void psi::pk::PKWorker::write_wK ( std::vector< size_t >  min_ind,
std::vector< size_t >  max_ind,
size_t  pk_pairs 
)
inlinevirtual

Writing wK integral arrays for storage.

Reimplemented in psi::pk::PKWrkrReord.

Member Data Documentation

std::shared_ptr<AIOHandler> psi::pk::PKWorker::AIO_
private
size_t psi::pk::PKWorker::buf_size_
private

Size of one buffer.

unsigned int psi::pk::PKWorker::bufidx_
private

Current global index of the buffer.

bool psi::pk::PKWorker::do_wK_
private

Are we doing wK?

size_t psi::pk::PKWorker::max_idx_
private

Current max ijkl index in the buffer.

unsigned int psi::pk::PKWorker::nbuf_
private

Number of buffers in the worker.

size_t psi::pk::PKWorker::offset_
private

Current offset.

unsigned int psi::pk::PKWorker::P_
private

Indices of the current shell quartet.

std::shared_ptr<BasisSet> psi::pk::PKWorker::primary_
private

Current basis set.

unsigned int psi::pk::PKWorker::Q_
private
unsigned int psi::pk::PKWorker::R_
private
unsigned int psi::pk::PKWorker::S_
private
UniqueAOShellIt psi::pk::PKWorker::shelliter_
private

Iterator over basis functions within a shell quartet.

bool psi::pk::PKWorker::shells_left_
private

Are there any shells left ?

SharedSieve psi::pk::PKWorker::sieve_
private

Current sieve.

int psi::pk::PKWorker::target_file_
private

File to write to.


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