m_allocator Module


Uses

  • module~~m_allocator~~UsesGraph module~m_allocator m_allocator iso_fortran_env iso_fortran_env module~m_allocator->iso_fortran_env module~m_common m_common module~m_allocator->module~m_common module~m_field m_field module~m_allocator->module~m_field module~m_mesh m_mesh module~m_allocator->module~m_mesh module~m_field->module~m_common module~m_mesh->iso_fortran_env module~m_mesh->module~m_common module~m_mesh->module~m_field module~m_mesh_content m_mesh_content module~m_mesh->module~m_mesh_content mpi mpi module~m_mesh->mpi module~m_mesh_content->module~m_common

Used by

  • module~~m_allocator~~UsedByGraph module~m_allocator m_allocator module~m_base_backend m_base_backend module~m_base_backend->module~m_allocator module~m_base_case m_base_case module~m_base_case->module~m_allocator module~m_base_case->module~m_base_backend module~m_solver m_solver module~m_base_case->module~m_solver module~m_case_channel m_case_channel module~m_case_channel->module~m_allocator module~m_case_channel->module~m_base_backend module~m_case_channel->module~m_base_case module~m_case_channel->module~m_solver module~m_case_generic m_case_generic module~m_case_generic->module~m_allocator module~m_case_generic->module~m_base_backend module~m_case_generic->module~m_base_case module~m_case_generic->module~m_solver module~m_case_tgv m_case_tgv module~m_case_tgv->module~m_allocator module~m_case_tgv->module~m_base_backend module~m_case_tgv->module~m_base_case module~m_case_tgv->module~m_solver module~m_cuda_allocator m_cuda_allocator module~m_cuda_allocator->module~m_allocator module~m_cuda_backend m_cuda_backend module~m_cuda_backend->module~m_allocator module~m_cuda_backend->module~m_base_backend module~m_cuda_backend->module~m_cuda_allocator module~m_cuda_poisson_fft m_cuda_poisson_fft module~m_cuda_backend->module~m_cuda_poisson_fft module~m_omp_backend m_omp_backend module~m_omp_backend->module~m_allocator module~m_omp_backend->module~m_base_backend module~m_solver->module~m_allocator module~m_solver->module~m_base_backend module~m_time_integrator m_time_integrator module~m_solver->module~m_time_integrator module~m_vector_calculus m_vector_calculus module~m_solver->module~m_vector_calculus module~m_time_integrator->module~m_allocator module~m_time_integrator->module~m_base_backend module~m_vector_calculus->module~m_allocator module~m_vector_calculus->module~m_base_backend program~xcompact xcompact program~xcompact->module~m_allocator program~xcompact->module~m_base_backend program~xcompact->module~m_base_case program~xcompact->module~m_case_channel program~xcompact->module~m_case_generic program~xcompact->module~m_case_tgv program~xcompact->module~m_cuda_allocator program~xcompact->module~m_cuda_backend program~xcompact->module~m_omp_backend module~m_cuda_poisson_fft->module~m_cuda_allocator

Interfaces

public interface allocator_t

  • public function allocator_init(mesh, sz) result(allocator)

    Arguments

    Type IntentOptional Attributes Name
    type(mesh_t), intent(inout), target :: mesh
    integer, intent(in) :: sz

    Return Value type(allocator_t)


Derived Types

type, public ::  allocator_t

An instance of type allocator_t is responsible for the maintenance of a linked list of instances of equal size m_allocator objects:

Read more…

Components

Type Visibility Attributes Name Initial
integer, public :: ngrid
integer, public :: next_id = 0

The id for the next allocated block. This counter is incremented each time a new block is allocated.

type(mesh_t), public, pointer :: mesh

The pointer to the first block on the list. Non associated if the list is empty

class(field_t), public, pointer :: first => null()

Constructor

public function allocator_init (mesh, sz)

Type-Bound Procedures

procedure, public :: get_block
procedure, public :: release_block
procedure, public :: create_block
procedure, public :: get_block_ids
procedure, public :: destroy
procedure, public :: compute_padded_dims

Functions

public function allocator_init(mesh, sz) result(allocator)

Arguments

Type IntentOptional Attributes Name
type(mesh_t), intent(inout), target :: mesh
integer, intent(in) :: sz

Return Value type(allocator_t)

public function create_block(self, next) result(ptr)

Allocate memory for a new block and return a pointer to a new m_allocator object.

Arguments

Type IntentOptional Attributes Name
class(allocator_t), intent(inout) :: self
type(field_t), intent(in), pointer :: next

Return Value class(field_t), pointer

public function get_block(self, dir, data_loc) result(handle)

Return a pointer to the first available memory block, i.e. the current head of the block list. If the list is empty, allocate a new block with create_block first.

Read more…

Arguments

Type IntentOptional Attributes Name
class(allocator_t), intent(inout) :: self
integer, intent(in) :: dir
integer, intent(in), optional :: data_loc

Return Value class(field_t), pointer

public function get_block_ids(self)

Utility function that returns a array made of the id of the block currently in the block list. Return the array [0] if block list is empty.

Arguments

Type IntentOptional Attributes Name
class(allocator_t), intent(inout) :: self

Return Value integer, allocatable, (:)


Subroutines

public subroutine compute_padded_dims(self, sz)

Arguments

Type IntentOptional Attributes Name
class(allocator_t), intent(inout) :: self
integer, intent(in) :: sz

public subroutine release_block(self, handle)

Release memory block pointed to by HANDLE to the block list. It is pushed to the front of the block list, in other words it is made the head block.

Arguments

Type IntentOptional Attributes Name
class(allocator_t), intent(inout) :: self
class(field_t), pointer :: handle

public subroutine destroy(self)

Go through the block list from head to tail, deallocating each memory block in turn. Deallocation of a m_allocator object automatically deallocates its internal allocatable data array.

Arguments

Type IntentOptional Attributes Name
class(allocator_t), intent(inout) :: self