Neko 1.99.3
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
scratch_registry Module Reference

Defines a registry for storing and requesting temporary objects This can be used when you have a function that will be called often and you don't want to create temporary objects (work arrays) inside it on each call.

Data Types

type  scratch_registry_t
 

Functions/Subroutines

subroutine scratch_registry_init (this, size, expansion_size, dof)
 Constructor, optionally taking initial registry and expansion size as argument.
 
subroutine scratch_registry_free (this)
 Destructor.
 
subroutine scratch_registry_set_dofmap (this, dof)
 Assign a dofmap to the scratch registry.
 
pure integer function get_n_entries (this)
 Get the number of objects stored in the registry.
 
pure integer function get_n_inuse (this)
 Get the number of objects currently in use.
 
pure integer function get_size (this)
 Get the size of the objects array.
 
pure integer function get_expansion_size (this)
 Get the expansion size.
 
pure logical function get_inuse (this, index)
 Get the inuse status for a given index.
 
subroutine expand (this)
 
subroutine request_host_array (this, v, index, n, clear)
 Get a host_array from the registry by assigning it to a pointer.
 
subroutine request_device_array (this, v, index, n, clear)
 Get a device_array from the registry by assigning it to a pointer.
 
subroutine request_vector (this, v, index, n, clear)
 Get a vector from the registry by assigning it to a pointer.
 
subroutine request_matrix (this, m, index, nrows, ncols, clear)
 Get a matrix from the registry by assigning it to a pointer.
 
subroutine request_field (this, f, index, clear)
 Get a field from the registry by assigning it to a pointer.
 
subroutine relinquish_host_array_single (this, index)
 Relinquish the use of a host_array in the registry.
 
subroutine relinquish_host_array_multiple (this, indices)
 Relinquish the use of multiple host_arrays in the registry.
 
subroutine relinquish_device_array_single (this, index)
 Relinquish the use of a device_array in the registry.
 
subroutine relinquish_device_array_multiple (this, indices)
 Relinquish the use of multiple device_arrays in the registry.
 
subroutine relinquish_vector_single (this, index)
 Relinquish the use of a vector in the registry.
 
subroutine relinquish_vector_multiple (this, indices)
 Relinquish the use of multiple vectors in the registry.
 
subroutine relinquish_matrix_single (this, index)
 Relinquish the use of a matrix in the registry.
 
subroutine relinquish_matrix_multiple (this, indices)
 Relinquish the use of multiple matrices in the registry.
 
subroutine relinquish_field_single (this, index)
 Relinquish the use of a field in the registry.
 
subroutine relinquish_field_multiple (this, indices)
 Relinquish the use of multiple fields in the registry.
 
subroutine relinquish_single (this, index)
 Relinquish the use of an object in the registry.
 
subroutine relinquish_multiple (this, indices)
 Relinquish the use of multiple objects in the registry.
 

Variables

type(scratch_registry_t), target, public neko_scratch_registry
 Global scratch registry.
 

Function/Subroutine Documentation

◆ expand()

subroutine scratch_registry::expand ( class(scratch_registry_t), intent(inout this)
private

Definition at line 264 of file scratch_registry.f90.

◆ get_expansion_size()

pure integer function scratch_registry::get_expansion_size ( class(scratch_registry_t), intent(in this)
private

Definition at line 249 of file scratch_registry.f90.

◆ get_inuse()

pure logical function scratch_registry::get_inuse ( class(scratch_registry_t), intent(in), target  this,
integer, intent(in index 
)
private

Definition at line 257 of file scratch_registry.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_n_entries()

pure integer function scratch_registry::get_n_entries ( class(scratch_registry_t), intent(in this)
private

Definition at line 221 of file scratch_registry.f90.

◆ get_n_inuse()

pure integer function scratch_registry::get_n_inuse ( class(scratch_registry_t), intent(in this)
private

Definition at line 229 of file scratch_registry.f90.

◆ get_size()

pure integer function scratch_registry::get_size ( class(scratch_registry_t), intent(in this)
private

Definition at line 237 of file scratch_registry.f90.

◆ relinquish_device_array_multiple()

subroutine scratch_registry::relinquish_device_array_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the device_arrays to free

Definition at line 597 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_device_array_single()

subroutine scratch_registry::relinquish_device_array_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the device_array to free

Definition at line 582 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_field_multiple()

subroutine scratch_registry::relinquish_field_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the fields to free

Definition at line 696 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_field_single()

subroutine scratch_registry::relinquish_field_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the field to free

Definition at line 681 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_host_array_multiple()

subroutine scratch_registry::relinquish_host_array_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the host_arrays to free

Definition at line 564 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_host_array_single()

subroutine scratch_registry::relinquish_host_array_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the host_array to free

Definition at line 549 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_matrix_multiple()

subroutine scratch_registry::relinquish_matrix_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the matrices to free

Definition at line 663 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_matrix_single()

subroutine scratch_registry::relinquish_matrix_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the matrix to free

Definition at line 648 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_multiple()

subroutine scratch_registry::relinquish_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the objects to free

Definition at line 724 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_single()

subroutine scratch_registry::relinquish_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the object to free

Definition at line 714 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_vector_multiple()

subroutine scratch_registry::relinquish_vector_multiple ( class(scratch_registry_t), intent(inout), target  this,
integer, dimension(:), intent(inout indices 
)
private
Parameters
indicesThe indices of the vectors to free

Definition at line 630 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_vector_single()

subroutine scratch_registry::relinquish_vector_single ( class(scratch_registry_t), intent(inout), target  this,
integer, intent(inout index 
)
private
Parameters
indexThe index of the vector to free

Definition at line 615 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_device_array()

subroutine scratch_registry::request_device_array ( class(scratch_registry_t), intent(inout), target  this,
type(device_array_t), intent(inout), pointer  v,
integer, intent(inout index,
integer, intent(in n,
logical, intent(in clear 
)
private
Parameters
vPointer to the requested device_array.
indexIndex of the device_array in the registry (for relinquishing later).
nSize of the requested device_array.
clearIf true, the device_array values are set to zero upon request.

Definition at line 348 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_field()

subroutine scratch_registry::request_field ( class(scratch_registry_t), intent(inout), target  this,
type(field_t), intent(inout), pointer  f,
integer, intent(inout index,
logical, intent(in clear 
)
private
Parameters
fPointer to the requested field.
indexIndex of the field in the registry (for relinquishing later).
clearIf true, the field values are set to zero upon request.

Definition at line 500 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_host_array()

subroutine scratch_registry::request_host_array ( class(scratch_registry_t), intent(inout), target  this,
type(host_array_t), intent(inout), pointer  v,
integer, intent(inout index,
integer, intent(in n,
logical, intent(in clear 
)
private
Parameters
vPointer to the requested host_array.
indexIndex of the host array in the registry (for relinquishing later).
nSize of the requested host_array.
clearIf true, the host_array values are set to zero upon request.

Definition at line 298 of file scratch_registry.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ request_matrix()

subroutine scratch_registry::request_matrix ( class(scratch_registry_t), intent(inout), target  this,
type(matrix_t), intent(inout), pointer  m,
integer, intent(inout index,
integer, intent(in nrows,
integer, intent(in ncols,
logical, intent(in clear 
)
private
Parameters
mPointer to the requested matrix.
indexIndex of the matrix in the registry (for relinquishing later).
nrowsNumber of rows of the requested matrix.
ncolsNumber of columns of the requested matrix.
clearIf true, the matrix values are set to zero upon request.

Definition at line 449 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_vector()

subroutine scratch_registry::request_vector ( class(scratch_registry_t), intent(inout), target  this,
type(vector_t), intent(inout), pointer  v,
integer, intent(inout index,
integer, intent(in n,
logical, intent(in clear 
)
private
Parameters
vPointer to the requested vector.
indexIndex of the vector in the registry (for relinquishing later).
nSize of the requested vector.
clearIf true, the vector values are set to zero upon request.

Definition at line 398 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ scratch_registry_free()

subroutine scratch_registry::scratch_registry_free ( class(scratch_registry_t), intent(inout this)
private

Definition at line 173 of file scratch_registry.f90.

◆ scratch_registry_init()

subroutine scratch_registry::scratch_registry_init ( class(scratch_registry_t), intent(inout this,
integer, intent(in), optional  size,
integer, intent(in), optional  expansion_size,
type(dofmap_t), intent(in), optional, target  dof 
)
private
Parameters
sizeInitial size of the registry
expansion_sizeSize to expand the registry by when needed
dofDofmap to associate with the scratch registry
Note
If no DOF map is provided here, it must be set later using scratch_registry_t::set_dofmap before requesting fields.

Definition at line 150 of file scratch_registry.f90.

◆ scratch_registry_set_dofmap()

subroutine scratch_registry::scratch_registry_set_dofmap ( class(scratch_registry_t), intent(inout this,
type(dofmap_t), intent(in), target  dof 
)
private
Parameters
dofDofmap to assign
Note
First check if a dofmap is already assigned, and throw an error, unless it's the same dofmap.

Definition at line 206 of file scratch_registry.f90.

Variable Documentation

◆ neko_scratch_registry

type(scratch_registry_t), target, public scratch_registry::neko_scratch_registry

Definition at line 138 of file scratch_registry.f90.