|
GBTOlib: library for evaluation of molecular integrals in mixed Gaussian / B-spline basis 111
|
Storage of integral blocks. More...

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_mapping) | ri_mapping |
| type(file_mapping) | rv_mapping |
| type(sparse_block_obj), dimension(:), allocatable | blocks |
| integer, dimension(:, :), pointer | ri => null() |
| real(cfp), dimension(:, :), pointer | rv => null() |
Storage of integral blocks.
A class that offers unified way of accessing sparse integral blocks from both a disk-based storage as well as from memory.
|
final |
Finalize the storage object.
Remove any remaining scratch files. The rest will be destructed automatically.
| 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.
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.
| procedure sparse_block_storage_gbl::sparse_block_storage_obj::combine_blocks | ( | class(sparse_block_storage_obj), intent(inout) | this | ) |
Merge blocks and update pointers.
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.
| 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.
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.
| type(sparse_block_obj), dimension(:), allocatable sparse_block_storage_gbl::sparse_block_storage_obj::blocks |
| logical sparse_block_storage_gbl::sparse_block_storage_obj::in_memory = .true. |
| integer, dimension(:, :), pointer sparse_block_storage_gbl::sparse_block_storage_obj::ri => null() |
| integer sparse_block_storage_gbl::sparse_block_storage_obj::ri_fd = 0 |
| type(file_mapping) sparse_block_storage_gbl::sparse_block_storage_obj::ri_mapping |
| integer sparse_block_storage_gbl::sparse_block_storage_obj::rn = 0 |
| real(cfp), dimension(:, :), pointer sparse_block_storage_gbl::sparse_block_storage_obj::rv => null() |
| integer sparse_block_storage_gbl::sparse_block_storage_obj::rv_fd = 0 |
| type(file_mapping) sparse_block_storage_gbl::sparse_block_storage_obj::rv_mapping |