Neko 1.99.9
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_tensor3 (this, t, index, n, m, l, clear)
 Get a tensor3 from the registry by assigning it to a pointer.
 
subroutine request_tensor4 (this, t, index, n, m, l, k, clear)
 Get a tensor4 from the registry by assigning it to a pointer.
 
subroutine request_field_stored_dof (this, f, index, clear)
 Get a field from the registry by assigning it to a pointer.
 
subroutine request_field_free_dof (this, f, index, dof, 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_tensor3_single (this, index)
 Relinquish the use of a tensor3 in the registry.
 
subroutine relinquish_tensor3_multiple (this, indices)
 Relinquish the use of multiple tensor3s in the registry.
 
subroutine relinquish_tensor4_single (this, index)
 Relinquish the use of a tensor4 in the registry.
 
subroutine relinquish_tensor4_multiple (this, indices)
 Relinquish the use of multiple tensor4s 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 294 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 279 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 287 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 251 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 259 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 267 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 809 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 794 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 974 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 959 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 776 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 761 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 875 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 860 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 1002 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 992 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_tensor3_multiple()

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

Definition at line 908 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_tensor3_single()

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

Definition at line 893 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_tensor4_multiple()

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

Definition at line 941 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ relinquish_tensor4_single()

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

Definition at line 926 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 842 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 827 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(c_ptr), intent(inout)  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 385 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_field_free_dof()

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

Definition at line 711 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_field_stored_dof()

subroutine scratch_registry::request_field_stored_dof ( 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 659 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,
real(kind=rp), dimension(:), 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 329 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 491 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_tensor3()

subroutine scratch_registry::request_tensor3 ( class(scratch_registry_t), intent(inout), target  this,
type(tensor3_t), intent(inout), pointer  t,
integer, intent(inout)  index,
integer, intent(in)  n,
integer, intent(in)  m,
integer, intent(in)  l,
logical, intent(in)  clear 
)
private
Parameters
tPointer to the requested tensor3.
indexIndex of the tensor3 in the registry (for relinquishing later).
nNumber of rows of the requested tensor3.
mNumber of columns of the requested tensor3.
lNumber of layers of the requested tensor3.
clearIf true, the tensor3 values are set to zero upon request.

Definition at line 544 of file scratch_registry.f90.

Here is the caller graph for this function:

◆ request_tensor4()

subroutine scratch_registry::request_tensor4 ( class(scratch_registry_t), intent(inout), target  this,
type(tensor4_t), intent(inout), pointer  t,
integer, intent(inout)  index,
integer, intent(in)  n,
integer, intent(in)  m,
integer, intent(in)  l,
integer, intent(in)  k,
logical, intent(in)  clear 
)
private
Parameters
tPointer to the requested tensor4.
indexIndex of the tensor4 in the registry (for relinquishing later).
nNumber of rows of the requested tensor4.
mNumber of columns of the requested tensor4.
lNumber of layers of the requested tensor4.
kNumber of slices of the requested tensor4.
clearIf true, the tensor4 values are set to zero upon request.

Definition at line 603 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 440 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 203 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 180 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 236 of file scratch_registry.f90.

Variable Documentation

◆ neko_scratch_registry

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

Definition at line 168 of file scratch_registry.f90.