dbcsr_mem_methods Module

DBCSR Memory Pool to avoid slow allocations of accelerator memory



Contents


Variables

TypeVisibilityAttributesNameInitial
character(len=*), private, parameter:: moduleN ='dbcsr_mem_methods'
logical, private, parameter:: debug =.FALSE.

Functions

public function dbcsr_mempool_get(memtype, datatype, datasize) result(res)

Picks a suitable data_area from mempool, returns Null() if none found.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_memtype_type) :: memtype
integer, intent(in) :: datatype
integer, intent(in) :: datasize

Return Value type(dbcsr_data_obj)

public function dbcsr_memtype_equal(mt1, mt2) result(res)

Test if two memtypes are equal

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_memtype_type), intent(in) :: mt1
type(dbcsr_memtype_type), intent(in) :: mt2

Return Value logical


Subroutines

private subroutine dbcsr_mempool_create(pool)

Creates a memory pool.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mempool_type), POINTER:: pool

public subroutine dbcsr_mempool_limit_capacity(pool, capacity)

Ensures that mempool has at least the given capacity.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mempool_type), POINTER:: pool
integer, intent(in) :: capacity

public subroutine dbcsr_mempool_add(area)

Adds an unused (refcount==0) data_area to the pool.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_data_obj) :: area

private subroutine mempool_collect_garbage(pool)

Ensures that pool_size < max_size, e.g. that there is a free slot.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mempool_type), POINTER:: pool

public subroutine dbcsr_mempool_destruct(pool)

Finalizes mempool, includes deallocation of all contained data_areas.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mempool_type), POINTER:: pool

public subroutine dbcsr_mempool_clear(pool)

Deallocates all data_areas contained in given mempool.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mempool_type), POINTER:: pool

public subroutine dbcsr_memtype_setup(memtype, acc_hostalloc, acc_devalloc, mpi, acc_stream, oversize_factor, has_pool)

Ensures that given memtype has requested settings.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_memtype_type), intent(inout) :: memtype
logical, intent(in), optional :: acc_hostalloc
logical, intent(in), optional :: acc_devalloc
logical, intent(in), optional :: mpi
type(acc_stream_type), optional :: acc_stream
real(kind=dp), optional :: oversize_factor
logical, intent(in), optional :: has_pool