MPQC  3.0.0-alpha
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions
sc::DistArray4 Class Reference

DistArray4 contains a set of one or more distributed dense 4-index arrays. More...

#include <math/distarray4/distarray4.h>

Inheritance diagram for sc::DistArray4:
Inheritance graph
[legend]

List of all members.

Public Types

typedef unsigned int tbint_type
 Types of two-body operators that DistArray4 understands.

Public Member Functions

 DistArray4 (int num_te_types, int ni, int nj, int nx, int ny, DistArray4Storage storage=DistArray4Storage_XY)
 DistArray4 (StateIn &)
void save_data_state (StateOut &)
 Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them.
virtual Ref< DistArray4clone (const DistArray4Dimensions &dim=DistArray4Dimensions::default_dim())=0
 how to clone.
int num_te_types () const
 The number of types of integrals that are being handled together.
int ni () const
 Rank of index space i.
int nj () const
 Rank of index space j.
int nx () const
 Rank of index space x.
int ny () const
 Rank of index space y.
const DistArray4Storage & storage () const
 physical storage of the integrals. The default storage is XY. Storage is not mutable.
size_t blocksize () const
 Size of each block of the integrals of one type, in double words.
size_t blksize () const
virtual void activate ()
 call this before operations on this object can begin
virtual void deactivate ()
 call this after operations on this object are finished. May destroy data (see data_persistent()).
virtual bool data_persistent () const =0
 if this returns false, call to deactivate may destroy data
virtual const double * retrieve_pair_block (int i, int j, tbint_type oper_type, double *buf=0) const =0
 Retrieves an ij block of integrals.
virtual void retrieve_pair_subblock (int i, int j, tbint_type oper_type, int xstart, int xfence, int ystart, int yfence, double *buf) const =0
 Retrieves a rectangular subblock of ij block of integrals.
virtual void release_pair_block (int i, int j, tbint_type oper_type) const =0
 Releases the buffer that holds ij block of integrals. If it was allocated by DistArray4, it will be freed.
virtual void store_pair_block (int i, int j, tbint_type oper_type, const double *ints)=0
 Stores an ij pair block of integrals.
virtual void store_pair_subblock (int i, int j, tbint_type oper_type, int xstart, int xfence, int ystart, int yfence, const double *ints)=0
 Stores an rectangular subblock of ij block of integrals.
int ij_index (int i, int j) const
virtual bool is_avail (int i, int j) const =0
 Can this block be accessed via retrieve_pair_block from this task?
virtual bool is_local (int i, int j) const =0
 Is this block stored locally? If true, this implies that it can be retrieved efficiently (compare to is_avail).
virtual bool has_access (int proc) const =0
 Does this task have access to all blocks?
int tasks_with_access (std::vector< int > &twa_map) const
 Returns the total number of tasks with access to integrals.
const Ref< MessageGrp > & msg () const

Static Public Attributes

static const unsigned int max_num_te_types = 14

Protected Member Functions

size_t nxy () const
bool active () const
int ntasks () const
 total number of tasks
int me () const
 rank of this task
int classdebug () const
 return debug level for this class

Detailed Description

DistArray4 contains a set of one or more distributed dense 4-index arrays.

These 4-index quantities are typically AO or MO integrals. Since integrals are typically computed in sets -- for example, R12 methods require integrals of operators 1/r12, r12, [t1,r12], and [t2,r12] at the same time -- several sets of integrals are held together. The data can then be described as (ijxy)^O where i, j, x, and, y are indices with ranges [0,ni), [0,nj), etc. and O labels the operator type and ranges from 0 to num_te_types. The data is stored and accessed as follows: each ij block is a set of num_te_types base-0 contiguous 2-dimensional array with dimensions nx and ny. How blocks are stored and accessed is determined in the derived class. It is also possible to have the physical storage to be xy or yx.

See also:
DistArray4::storage()

Public interface of DistArray4 is designed to accomodate the needs of the TwoBodyMOIntsTransform objects. Parallel AO->MO integral transforms are performed in single or multiple passes. In the latter case all (jxy)^O integrals are produces for a particular subrange of i. These integrals are contained in a MemoryGrp object. The contents of the MemoryGrp object is "stored" in accumulator using store_memorygrp(Ref<MemoryGrp>& mem, int ni), where ni is the size of the subrange of i produced in this pass. After all batches have been stored, the content of DistArray4 needs to be "committed" using commit. After that blocks of MO integrals can be accessed using retrieve_pair_block.


Member Function Documentation

virtual Ref<DistArray4> sc::DistArray4::clone ( const DistArray4Dimensions dim = DistArray4Dimensions::default_dim()) [pure virtual]

how to clone.

optional dim allows to obtain an object of the same type but different size. the default is to obtain an object of the same size.

Implemented in sc::DistArray4_MPIIOFile_Ind, sc::DistArray4_Node0File, sc::DistArray4_MPIIOFile, and sc::DistArray4_MemoryGrp.

virtual const double* sc::DistArray4::retrieve_pair_block ( int  i,
int  j,
tbint_type  oper_type,
double *  buf = 0 
) const [pure virtual]

Retrieves an ij block of integrals.

Note that it comes stored according to storage(). No locking is performed.

Parameters:
bufspecifies the buffer in which to write the data (if not provided, will allocate dynamically). this buffer will be used by subsequent retrieve_pair_block() requests until release_pair_block() is called.

Implemented in sc::DistArray4_MPIIOFile_Ind, sc::DistArray4_Node0File, and sc::DistArray4_MemoryGrp.

Referenced by sc::R12IntEval::compute_tbint_tensor(), and sc::R12IntEval::contract_tbint_tensors_to_obtensor().

virtual void sc::DistArray4::retrieve_pair_subblock ( int  i,
int  j,
tbint_type  oper_type,
int  xstart,
int  xfence,
int  ystart,
int  yfence,
double *  buf 
) const [pure virtual]

Retrieves a rectangular subblock of ij block of integrals.

See also:
retrieve_pair_block()

Implemented in sc::DistArray4_MPIIOFile_Ind, sc::DistArray4_Node0File, and sc::DistArray4_MemoryGrp.

void sc::DistArray4::save_data_state ( StateOut ) [virtual]

Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them.

This must be implemented by the derived class if the class has data.

Reimplemented from sc::SavableState.

Reimplemented in sc::DistArray4_MPIIOFile_Ind, sc::DistArray4_MPIIOFile, sc::DistArray4_Node0File, and sc::DistArray4_MemoryGrp.

virtual void sc::DistArray4::store_pair_block ( int  i,
int  j,
tbint_type  oper_type,
const double *  ints 
) [pure virtual]

Stores an ij pair block of integrals.

It is assumed to be stored according to storage(). It must also be "local", i.e. is_local(i,j) must be true. No locking is performed.

Implemented in sc::DistArray4_MPIIOFile_Ind, sc::DistArray4_Node0File, and sc::DistArray4_MemoryGrp.

virtual void sc::DistArray4::store_pair_subblock ( int  i,
int  j,
tbint_type  oper_type,
int  xstart,
int  xfence,
int  ystart,
int  yfence,
const double *  ints 
) [pure virtual]

Stores an rectangular subblock of ij block of integrals.

Most efficient if the block is contiguous, i.e. yfence - ystart = ny().

See also:
store_pair_block()

Implemented in sc::DistArray4_MPIIOFile_Ind, sc::DistArray4_Node0File, and sc::DistArray4_MemoryGrp.

int sc::DistArray4::tasks_with_access ( std::vector< int > &  twa_map) const

Returns the total number of tasks with access to integrals.

If task i has access to the integrals, then twa_map[i] is its index among the tasks with access, -1 otherwise.

Referenced by sc::R12IntEval::compute_tbint_tensor(), and sc::R12IntEval::contract_tbint_tensors_to_obtensor().


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

Generated at Sat Jul 7 2012 11:52:58 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.0.