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

#include <PK_workers.h>

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

Public Member Functions

 PKWrkrIWL (std::shared_ptr< BasisSet > primary, SharedSieve sieve, std::shared_ptr< AIOHandler > AIOp, int targetfile, int K_file, size_t buf_size, std::vector< int > &bufforpq, std::shared_ptr< std::vector< size_t >> pos)
 Constructor. More...
 
 ~PKWrkrIWL ()
 Destructor. More...
 
virtual void allocate_wK (std::shared_ptr< std::vector< size_t >> pos, int wKfile)
 Preparing for wK pre-sorting to file. More...
 
virtual void fill_values (double val, size_t i, size_t j, size_t k, size_t l)
 Filling integrals in the appropriate buffers. More...
 
virtual void fill_values_wK (double val, size_t i, size_t j, size_t k, size_t l)
 Filling wK integrals in the appropriate buffers. More...
 
virtual bool pop_value (size_t bufid, double &val, size_t &i, size_t &j, size_t &k, size_t &l)
 Popping a value from a buffer to finalize writing. More...
 
virtual void insert_value (size_t bufid, double val, size_t i, size_t j, size_t k, size_t l)
 Inserting a value back into a buffer. More...
 
virtual bool pop_value_wK (size_t bufid, double &val, size_t &i, size_t &j, size_t &k, size_t &l)
 Popping a wK value from a buffer to finalize writing. More...
 
virtual void insert_value_wK (size_t bufid, double val, size_t i, size_t j, size_t k, size_t l)
 Inserting a wK value back into a buffer. More...
 
virtual void flush ()
 Flushing all buffers for current worker. More...
 
virtual void flush_wK ()
 Flushing all wK buffers for current worker. More...
 
virtual void initialize_task ()
 Functions that are not used here. More...
 
virtual void write (std::vector< size_t > min_ind, std::vector< size_t > max_ind, size_t pk_pairs)
 Writing integral arrays for storage. More...
 
- Public Member Functions inherited from 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. 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
 
size_t bufidx () const
 
size_t P () const
 
size_t Q () const
 
size_t R () const
 
size_t S () const
 
bool do_wK () const
 
void set_do_wK (bool tmp)
 Set do_wK. More...
 
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, size_t buf_per_thread)
 Reallocate the buffer memory for wK. 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...
 

Private Attributes

int K_file_
 File for K IWL batches. More...
 
int wK_file_
 File for wK IWL batches. More...
 
std::vector< int > buf_for_pq_
 Vector mapping pq index to a bucket. More...
 
std::vector< IWLAsync_PK * > IWL_J_
 Vectors of IWL buffers for storage in the proper pre-sorting bucket. More...
 
std::vector< IWLAsync_PK * > IWL_K_
 
std::vector< IWLAsync_PK * > IWL_wK_
 
std::shared_ptr< std::vector
< size_t > > 
addresses_
 
std::shared_ptr< std::vector
< size_t > > 
addresses_wK_
 

Additional Inherited Members

- Static Public Member Functions inherited from psi::pk::PKWorker
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 inherited from psi::pk::PKWorker
void set_nbuf (size_t 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...
 

Detailed Description

Class for Yoshimine pre-sorting to obtain the PK supermatrix. This class uses little buckets to pre-sort the integrals for each thread. No communication between threads and asynchronous writing to disk.

Constructor & Destructor Documentation

psi::pk::PKWrkrIWL::PKWrkrIWL ( std::shared_ptr< BasisSet primary,
SharedSieve  sieve,
std::shared_ptr< AIOHandler AIOp,
int  targetfile,
int  K_file,
size_t  buf_size,
std::vector< int > &  bufforpq,
std::shared_ptr< std::vector< size_t >>  pos 
)

Constructor.

psi::pk::PKWrkrIWL::~PKWrkrIWL ( )

Destructor.

Member Function Documentation

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

Preparing for wK pre-sorting to file.

Reimplemented from psi::pk::PKWorker.

void psi::pk::PKWrkrIWL::fill_values ( double  val,
size_t  i,
size_t  j,
size_t  k,
size_t  l 
)
virtual

Filling integrals in the appropriate buffers.

Implements psi::pk::PKWorker.

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

Filling wK integrals in the appropriate buffers.

Implements psi::pk::PKWorker.

void psi::pk::PKWrkrIWL::flush ( )
virtual

Flushing all buffers for current worker.

Reimplemented from psi::pk::PKWorker.

void psi::pk::PKWrkrIWL::flush_wK ( )
virtual

Flushing all wK buffers for current worker.

Reimplemented from psi::pk::PKWorker.

virtual void psi::pk::PKWrkrIWL::initialize_task ( )
inlinevirtual

Functions that are not used here.

Implements psi::pk::PKWorker.

void psi::pk::PKWrkrIWL::insert_value ( size_t  bufid,
double  val,
size_t  i,
size_t  j,
size_t  k,
size_t  l 
)
virtual

Inserting a value back into a buffer.

Reimplemented from psi::pk::PKWorker.

void psi::pk::PKWrkrIWL::insert_value_wK ( size_t  bufid,
double  val,
size_t  i,
size_t  j,
size_t  k,
size_t  l 
)
virtual

Inserting a wK value back into a buffer.

Reimplemented from psi::pk::PKWorker.

bool psi::pk::PKWrkrIWL::pop_value ( size_t  bufid,
double &  val,
size_t &  i,
size_t &  j,
size_t &  k,
size_t &  l 
)
virtual

Popping a value from a buffer to finalize writing.

Reimplemented from psi::pk::PKWorker.

bool psi::pk::PKWrkrIWL::pop_value_wK ( size_t  bufid,
double &  val,
size_t &  i,
size_t &  j,
size_t &  k,
size_t &  l 
)
virtual

Popping a wK value from a buffer to finalize writing.

Reimplemented from psi::pk::PKWorker.

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

Writing integral arrays for storage.

Implements psi::pk::PKWorker.

Member Data Documentation

std::shared_ptr<std::vector<size_t> > psi::pk::PKWrkrIWL::addresses_
private

Pointer to array with addresses in bytes where the next write should go for each bucket on file.

std::shared_ptr<std::vector<size_t> > psi::pk::PKWrkrIWL::addresses_wK_
private
std::vector< int > psi::pk::PKWrkrIWL::buf_for_pq_
private

Vector mapping pq index to a bucket.

std::vector< IWLAsync_PK* > psi::pk::PKWrkrIWL::IWL_J_
private

Vectors of IWL buffers for storage in the proper pre-sorting bucket.

std::vector< IWLAsync_PK* > psi::pk::PKWrkrIWL::IWL_K_
private
std::vector< IWLAsync_PK* > psi::pk::PKWrkrIWL::IWL_wK_
private
int psi::pk::PKWrkrIWL::K_file_
private

File for K IWL batches.

int psi::pk::PKWrkrIWL::wK_file_
private

File for wK IWL batches.


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