LMat_class Module



Contents


Variables

Type Visibility Attributes Name Initial
character(len=*), private, parameter :: nm_grp = "tcdump"
character(len=*), private, parameter :: nm_nInts = "nInts"
character(len=*), private, parameter :: nm_vals = "values"
character(len=*), private, parameter :: nm_indices = "indices"

Abstract Interfaces

abstract interface

  • private function get_elem_t(this, index) result(element)

    Get an element of a lMat. This replaces the old lMatAccess function pointer

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(in) :: this
    integer(kind=int64), intent(in) :: index

    Return Value real(kind=dp)

abstract interface

  • private subroutine dealloc_t(this)

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this

abstract interface

  • private subroutine alloc_t(this, size)

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: size

abstract interface

  • private subroutine set_elem_t(this, index, element)

    Set an element of a lMat

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: index
    real(kind=dp), intent(in) :: element

abstract interface

  • private subroutine read_t(this, filename)

    Read a lMat from a file

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    character(len=*), intent(in) :: filename

abstract interface

  • private subroutine read_op_t(this, indices, entries)

    Read operation on a single block of data read from an hdf5 file

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    integer(kind=int64), intent(inout), allocatable :: indices(:,:)
    integer(kind=int64), intent(inout), allocatable :: entries(:,:)

Derived Types

type, public ::  lMat_t

Abstract base class for lMat_t objects (6-index integrals)

Components

Type Visibility Attributes Name Initial
procedure(lMatInd_t), public, nopass, pointer :: indexFunc => lMatIndSym

Type-Bound Procedures

procedure (get_elem_t) , public :: get_elem
procedure (set_elem_t) , private :: set_elem
procedure (alloc_t) , public :: alloc
procedure (dealloc_t) , public :: safe_dealloc
procedure , public , :: read Subroutine
procedure (read_t) , private :: read_kernel
procedure (read_op_t) , private :: read_op_hdf5
procedure , public , :: lMat_size Function
procedure , public , :: histogram_lMat Subroutine

type, public, extends(lMat_t) ::  dense_lMat_t

Implementation for densely stored 6-index objects

Components

Type Visibility Attributes Name Initial
procedure(lMatInd_t), public, nopass, pointer :: indexFunc => lMatIndSym
type(shared_array_real_t), private :: lMat_vals

Type-Bound Procedures

procedure , public , :: read Subroutine
procedure , public , :: lMat_size Function
procedure , public , :: histogram_lMat Subroutine
procedure , public , :: get_elem => get_elem_dense Function
procedure , private :: set_elem => set_elem_dense Subroutine
procedure , public , :: alloc => alloc_dense Subroutine
procedure , public , :: safe_dealloc => dealloc_dense Subroutine
procedure , private :: read_kernel => read_dense Subroutine
procedure , private :: read_hdf5_dense Subroutine
procedure , private :: read_op_hdf5 => read_op_dense_hdf5 Subroutine

type, public, extends(lMat_t) ::  sparse_lMat_t

Implementation for sparsely stored 6-index objects

Components

Type Visibility Attributes Name Initial
procedure(lMatInd_t), public, nopass, pointer :: indexFunc => lMatIndSym
type(shared_array_real_t), private :: nonzero_vals
type(index_rhash_t), private :: htable

Type-Bound Procedures

procedure , public , :: read Subroutine
procedure , public , :: lMat_size Function
procedure , public , :: histogram_lMat Subroutine
procedure , public , :: get_elem => get_elem_sparse Function
procedure , private :: set_elem => set_elem_sparse Subroutine
procedure , public , :: alloc => alloc_sparse Subroutine
procedure , public , :: safe_dealloc => dealloc_sparse Subroutine
procedure , private :: read_kernel => read_sparse Subroutine
procedure , private :: read_op_hdf5 => read_op_sparse Subroutine
procedure , private :: read_data Subroutine
procedure , private :: count_conflicts Subroutine

type, private ::  lMat_hdf5_read_t

Handler for reading hdf5 tcdump files. Calls the read_op_hdf5 of the calling lMat_t

Components

Type Visibility Attributes Name Initial
integer(kind=hid_t), private :: err
integer(kind=hid_t), private :: file_id
integer(kind=hid_t), private :: plist_id
integer(kind=hid_t), private :: grp_id
integer(kind=hid_t), private :: ds_vals
integer(kind=hid_t), private :: ds_inds
integer(kind=hsize_t), private, allocatable :: offsets(:)
integer(kind=hsize_t), private :: countsEnd

Type-Bound Procedures

procedure , public , :: open Subroutine
procedure , public , :: close Subroutine
procedure , public , :: loop_file Subroutine

Functions

private function lMat_size(this) result(size)

Return the max. index appearing in this lMat_t (i.e. the number of 6-index integrals) @return size The number of 6-index integrals of this object, depending on the symmetry.

Arguments

Type IntentOptional Attributes Name
class(lMat_t), intent(in) :: this

Return Value integer(kind=int64)

private function get_elem_dense(this, index) result(element)

Get an element of the 6-index integrals from the densely stored container @param[in] index position of the element @return element value of the element

Arguments

Type IntentOptional Attributes Name
class(dense_lMat_t), intent(in) :: this
integer(kind=int64), intent(in) :: index

Return Value real(kind=dp)

private function get_elem_sparse(this, index) result(element)

Retrieve an element from the 6-index integrals stored in sparse format @param[in] index contiguous index of the element to be retrieved @return element value of the element with the given contiguous index

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(in) :: this
integer(kind=int64), intent(in) :: index

Return Value real(kind=dp)


Subroutines

private subroutine read(this, filename)

Read in the 6-index integrals from disk and histogram the integrals. The file itself only has to store the nonzero integrals, either in ASCII or in HDF5 format. For conventions in the HDF5 format, please refer to the developer’s guide. @param[in] filename name of the integrals file

Arguments

Type IntentOptional Attributes Name
class(lMat_t), intent(inout) :: this
character(len=*), intent(in) :: filename

private subroutine alloc_dense(this, size)

Allocate the 6-index integrals for the dense storage @param[in] size size of the integral container to be allocated

Arguments

Type IntentOptional Attributes Name
class(dense_lMat_t), intent(inout) :: this
integer(kind=int64), intent(in) :: size

private subroutine dealloc_dense(this)

Deallocate the 6-index integrals (dense)

Arguments

Type IntentOptional Attributes Name
class(dense_lMat_t), intent(inout) :: this

private subroutine set_elem_dense(this, index, element)

Set an element in the dense 6-index integrals to a new value @param[in] index position of the element @param[in] element new value of the element

Arguments

Type IntentOptional Attributes Name
class(dense_lMat_t), intent(inout) :: this
integer(kind=int64), intent(in) :: index
real(kind=dp), intent(in) :: element

private subroutine read_dense(this, filename)

Read the 6-index integrals from a file to dense format @param[in] filename name of the file to read from

Arguments

Type IntentOptional Attributes Name
class(dense_lMat_t), intent(inout) :: this
character(len=*), intent(in) :: filename

private subroutine read_hdf5_dense(this, filename)

Read the integrals from an hdf5 file to dense format @param[in] filename name of the file to read from

Arguments

Type IntentOptional Attributes Name
class(dense_lMat_t), intent(inout) :: this
character(len=*), intent(in) :: filename

private subroutine read_op_dense_hdf5(this, indices, entries)

This is the operation to be performed on each block of data read from an hdf5 file both arguments may or may not be still allocated upon return @param[in,out] indices chunk of indices read in from the file @param[in,out] entries chunk of corresponding values

Arguments

Type IntentOptional Attributes Name
class(dense_lMat_t), intent(inout) :: this
integer(kind=int64), intent(inout), allocatable :: indices(:,:)
integer(kind=int64), intent(inout), allocatable :: entries(:,:)

private subroutine alloc_sparse(this, size)

Allocate memory for the sparse storage of the 6-index integrals @param[in] size number of non-zero integrals

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this
integer(kind=int64), intent(in) :: size

private subroutine dealloc_sparse(this)

Deallocate memory used for the sparse storage of the 6-index integrals

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this

private subroutine set_elem_sparse(this, index, element)

Set an element to the sparsely stored 6-index integrals. This requires the hash table to be set up and CANNOT be done once htable%finalize_setup has been called @param[in] index contiguous index of the element (not the one in the sparse array) @param[in] element new value of the element

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this
integer(kind=int64), intent(in) :: index
real(kind=dp), intent(in) :: element

private subroutine read_sparse(this, filename)

Read the 6-index integrals from a file to sparse format @param[in] filename name of the file to read from

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this
character(len=*), intent(in) :: filename

private subroutine read_op_sparse(this, indices, entries)

This is the operation to be performed for sparse storage on each block of data read from an hdf5 file both arguments may or may not be still allocated upon return. @param[in,out] indices chunk of indices read in from the file @param[in,out] entries chunk of corresponding values

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this
integer(kind=int64), intent(inout), allocatable :: indices(:,:)
integer(kind=int64), intent(inout), allocatable :: entries(:,:)

private subroutine count_conflicts(this, indices)

Loop through a chunk of indices and count the number of hash conflicts. This is required for setting up the hash table @param[in] indices chunk combined 6-index values for the 6-index integrals

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this
integer(kind=int64), intent(in) :: indices(:)

private subroutine read_data(this, indices, entries)

Add the (combined) indices and the corresponding integral values to the sparse storage @param[in] indices chunk of combined 6-index values @param[in] entries corresponding values of the 6-index integrals

Arguments

Type IntentOptional Attributes Name
class(sparse_lMat_t), intent(inout) :: this
integer(kind=int64), intent(in) :: indices(:)
integer(kind=int64), intent(in) :: entries(:)

private subroutine gather_block(data_block, tmp)

Gather a chunk of data on node-root. @param[in] data_block on each proc, the data from this proc to be gathered @param[out] tmp on return, on node-root the gathered data from all procs on this node, empty on all other procs. Guaranteed to be allocated on return (of size 0 on other than node-root).

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: data_block(:)
integer(kind=int64), intent(out), allocatable :: tmp(:)

private subroutine histogram_lMat(this)

Generate a histogram of the 6-index integrals and write it to stdout

Arguments

Type IntentOptional Attributes Name
class(lMat_t), intent(in) :: this

private subroutine open(this, filename, nInts)

Open an hdf5 file containing 6-index integrals @param[in] filename name of the file @param[out] nInts number of integrals stored in the file (normally only nonzeros)

Arguments

Type IntentOptional Attributes Name
class(lMat_hdf5_read_t) :: this
character(len=*), intent(in) :: filename
integer(kind=hsize_t), intent(out) :: nInts

private subroutine loop_file(this, lMat)

Apply the read_op_hdf5 of an lMat to the data in the currently opened file The file will be read chunkwise and the read_op_hdf5 operation applied per chunk @param[in] lMat the lMat object to read the data to

Arguments

Type IntentOptional Attributes Name
class(lMat_hdf5_read_t), intent(inout) :: this
class(lMat_t), intent(inout) :: lMat

private subroutine close(this)

Close the currently opened hdf5 file - requires a previous call to open()

Arguments

Type IntentOptional Attributes Name
class(lMat_hdf5_read_t) :: this