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

#include <PK_workers.h>

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

Public Member Functions

 PKWrkrInCore (std::shared_ptr< BasisSet > primary, SharedSieve sieve, size_t buf_size, size_t lastbuf, double *Jbuf, double *Kbuf, double *wKbuf, int nworkers)
 
virtual void fill_values (double val, size_t i, size_t j, size_t k, size_t l)
 Filling values in the relevant part of the buffer. More...
 
virtual void fill_values_wK (double val, size_t i, size_t j, size_t k, size_t l)
 Filling values in the relevant part of the buffer for wK. More...
 
virtual void finalize_ints (size_t pk_pairs)
 Finalize the buffer: divide by two diagonal elements. More...
 
virtual void finalize_ints_wK (size_t pk_pairs)
 Finalize the buffer for wK: divide by two diagonal elements. More...
 
virtual void write (std::vector< size_t > min_ind, std::vector< size_t > max_ind, size_t pk_pairs)
 Function write is never used. 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 allocate_wK (std::shared_ptr< std::vector< size_t >> pos, int wKfile)
 For IWL, we need different arguments. 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 bool pop_value (size_t 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 (size_t 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 (size_t bufid, double val, size_t i, size_t j, size_t k, size_t l)
 
virtual void insert_value_wK (size_t 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 ()
 

Private Member Functions

virtual void initialize_task ()
 

Private Attributes

int nworkers_
 
size_t pk_size_
 
size_t last_buf_
 
double * J_buf0_
 
double * K_buf0_
 
double * wK_buf0_
 
double * J_bufp_
 
double * K_bufp_
 
double * wK_bufp_
 

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 PKWrkInCore: Computes all integrals for PK supermatrix and stores them in core. To avoid atomic access to the giant array storing the matrix, it is subdivided in nthreads_ buffers. Integrals are appropriately reordered such that each thread computes the shell quartets needed for its part of the buffer. There are only nthreads tasks so this algorithm likely suffers from load imbalance, although preliminary tests in Vtune seem fine.

Constructor & Destructor Documentation

psi::pk::PKWrkrInCore::PKWrkrInCore ( std::shared_ptr< BasisSet primary,
SharedSieve  sieve,
size_t  buf_size,
size_t  lastbuf,
double *  Jbuf,
double *  Kbuf,
double *  wKbuf,
int  nworkers 
)

Member Function Documentation

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

Filling values in the relevant part of the buffer.

Implements psi::pk::PKWorker.

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

Filling values in the relevant part of the buffer for wK.

Implements psi::pk::PKWorker.

void psi::pk::PKWrkrInCore::finalize_ints ( size_t  pk_pairs)
virtual

Finalize the buffer: divide by two diagonal elements.

Reimplemented from psi::pk::PKWorker.

void psi::pk::PKWrkrInCore::finalize_ints_wK ( size_t  pk_pairs)
virtual

Finalize the buffer for wK: divide by two diagonal elements.

Reimplemented from psi::pk::PKWorker.

void psi::pk::PKWrkrInCore::initialize_task ( )
privatevirtual

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

Implements psi::pk::PKWorker.

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

Function write is never used.

Implements psi::pk::PKWorker.

Member Data Documentation

double* psi::pk::PKWrkrInCore::J_buf0_
private
double* psi::pk::PKWrkrInCore::J_bufp_
private
double* psi::pk::PKWrkrInCore::K_buf0_
private
double* psi::pk::PKWrkrInCore::K_bufp_
private
size_t psi::pk::PKWrkrInCore::last_buf_
private
int psi::pk::PKWrkrInCore::nworkers_
private
size_t psi::pk::PKWrkrInCore::pk_size_
private
double* psi::pk::PKWrkrInCore::wK_buf0_
private
double* psi::pk::PKWrkrInCore::wK_bufp_
private

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