LMat_class Module



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, abstract ::  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, deferred :: get_elem
procedure(set_elem_t), private, deferred :: set_elem
procedure(alloc_t), public, deferred :: alloc
procedure(dealloc_t), public, deferred :: safe_dealloc
procedure, public :: read
procedure(read_t), private, deferred :: read_kernel
procedure(read_op_t), private, deferred :: read_op_hdf5
procedure, public :: lMat_size
procedure, public :: histogram_lMat

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
procedure, public :: lMat_size
procedure, public :: histogram_lMat
procedure, public :: get_elem => get_elem_dense
procedure, private :: set_elem => set_elem_dense
procedure, public :: alloc => alloc_dense
procedure, public :: safe_dealloc => dealloc_dense
procedure, private :: read_kernel => read_dense
procedure, private :: read_hdf5_dense
procedure, private :: read_op_hdf5 => read_op_dense_hdf5

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
procedure, public :: lMat_size
procedure, public :: histogram_lMat
procedure, public :: get_elem => get_elem_sparse
procedure, private :: set_elem => set_elem_sparse
procedure, public :: alloc => alloc_sparse
procedure, public :: safe_dealloc => dealloc_sparse
procedure, private :: read_kernel => read_sparse
procedure, private :: read_op_hdf5 => read_op_sparse
procedure, private :: read_data
procedure, private :: count_conflicts

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
procedure, public :: close
procedure, public :: loop_file

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)

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

Arguments

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

position of the element

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

Arguments

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

contiguous index of the element to be retrieved

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.

Arguments

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

name of the integrals file

private subroutine alloc_dense(this, size)

Allocate the 6-index integrals for the dense storage

Arguments

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

size of the integral container to be allocated

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

Arguments

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

position of the element

real(kind=dp), intent(in) :: element

new value of the element

private subroutine read_dense(this, filename)

Read the 6-index integrals from a file to dense format

Arguments

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

name of the file to read from

private subroutine read_hdf5_dense(this, filename)

Read the integrals from an hdf5 file to dense format

Arguments

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

name of the file to read from

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

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

Arguments

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

number of non-zero integrals

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

Arguments

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

contiguous index of the element (not the one in the sparse array)

real(kind=dp), intent(in) :: element

new value of the element

private subroutine read_sparse(this, filename)

Read the 6-index integrals from a file to sparse format

Arguments

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

name of the file to read from

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.

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

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

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.

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

Arguments

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

name of the file

integer(kind=hsize_t), intent(out) :: nInts

number of integrals stored in the file (normally only nonzeros)

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

Arguments

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

the lMat object to read the data to

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