GBTOlib: library for evaluation of molecular integrals in mixed Gaussian / B-spline basis 111
Loading...
Searching...
No Matches
sparse_block_storage_gbl::sparse_block_storage_obj Type Reference

Storage of integral blocks. More...

Collaboration diagram for sparse_block_storage_gbl::sparse_block_storage_obj:

Public Member Functions

procedure reset (this, nblocks, scratch)
 Initialize block storage.
procedure add_block (this, iblk, nnz, wi, wv)
 Store a single integral block.
procedure combine_blocks (this)
 Merge blocks and update pointers.
final destruct (this)
 Finalize the storage object.

Public Attributes

logical in_memory = .true.
integer rn = 0
integer ri_fd = 0
integer rv_fd = 0
type(file_mappingri_mapping
type(file_mappingrv_mapping
type(sparse_block_obj), dimension(:), allocatable blocks
integer, dimension(:, :), pointer ri => null()
real(cfp), dimension(:, :), pointer rv => null()

Detailed Description

Storage of integral blocks.

Authors
J Benda
Date
2025

A class that offers unified way of accessing sparse integral blocks from both a disk-based storage as well as from memory.

Constructor & Destructor Documentation

◆ destruct()

final sparse_block_storage_gbl::sparse_block_storage_obj::destruct ( type(sparse_block_storage_obj), intent(inout) this)
final

Finalize the storage object.

Authors
J Benda
Date
2025

Remove any remaining scratch files. The rest will be destructed automatically.

Member Function/Subroutine Documentation

◆ add_block()

procedure sparse_block_storage_gbl::sparse_block_storage_obj::add_block ( class(sparse_block_storage_obj), intent(inout) this,
integer, intent(in) iblk,
integer, intent(in) nnz,
integer, dimension(:), intent(in) wi,
real(cfp), dimension(:), intent(in) wv )

Store a single integral block.

Authors
J Benda
Date
2025

Copy data from the provided array to the integral storage (to memory if no scratch files are used, or to disk). The writing to the files is protected by a OpenMP critical section. This might be a huge bottleneck, because in theory multiple threads should be able to write to the file at once. However, for that we would need to carefully fiddle with the file pointer. This is left for a future optimization.

◆ combine_blocks()

procedure sparse_block_storage_gbl::sparse_block_storage_obj::combine_blocks ( class(sparse_block_storage_obj), intent(inout) this)

Merge blocks and update pointers.

Authors
J Benda
Date
2025

Update the pointers thisRi and thisRv to point to a storage with consecutive data from the individual integral blocks provided before. This is trivial in case of the disk storage, where the pointers are simply set up to point to the memory mapping of the scratch files. In case of operation without the scratch files, an annonymous mapping is created (for consistent, unified treatment), which is not backed up by any file, and filled with the block data stored in memory.

◆ reset()

procedure sparse_block_storage_gbl::sparse_block_storage_obj::reset ( class(sparse_block_storage_obj), intent(inout) this,
integer, intent(in) nblocks,
character(len=*), intent(in) scratch )

Initialize block storage.

Authors
J Benda
Date
2025

If non-empty scratch is given, this subroutine will create two binary files for the arrays Ri and Rv. Otherwise, a memory-only slot array is set up for later use.

Member Data Documentation

◆ blocks

type(sparse_block_obj), dimension(:), allocatable sparse_block_storage_gbl::sparse_block_storage_obj::blocks

◆ in_memory

logical sparse_block_storage_gbl::sparse_block_storage_obj::in_memory = .true.

◆ ri

integer, dimension(:, :), pointer sparse_block_storage_gbl::sparse_block_storage_obj::ri => null()

◆ ri_fd

integer sparse_block_storage_gbl::sparse_block_storage_obj::ri_fd = 0

◆ ri_mapping

type(file_mapping) sparse_block_storage_gbl::sparse_block_storage_obj::ri_mapping

◆ rn

integer sparse_block_storage_gbl::sparse_block_storage_obj::rn = 0

◆ rv

real(cfp), dimension(:, :), pointer sparse_block_storage_gbl::sparse_block_storage_obj::rv => null()

◆ rv_fd

integer sparse_block_storage_gbl::sparse_block_storage_obj::rv_fd = 0

◆ rv_mapping

type(file_mapping) sparse_block_storage_gbl::sparse_block_storage_obj::rv_mapping

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