TUV-x
Loading...
Searching...
No Matches
musica_map Module Reference

Utility for mapping among arrays. More...

Data Types

interface  map_t
 Map between arrays. More...
 
interface  pair_t
 Matched pair. More...
 

Functions/Subroutines

type(map_t) function constructor (config, from_labels, to_labels)
 Constructs a map_t object.
 
subroutine apply (this, from, to)
 Transfers data from source to destination array based on map.
 
integer function pack_size (this, comm)
 Returns the size of a binary buffer required to pack the map.
 
subroutine mpi_pack (this, buffer, position, comm)
 Packs the map onto a character buffer.
 
subroutine mpi_unpack (this, buffer, position, comm)
 Unpacks a map from a character buffer.
 
subroutine print_map (this, from_labels, to_labels, out_unit)
 Prints the map details to a specified output unit.
 
subroutine add_default_matches (this, from_labels, to_labels, always)
 Adds default matches by name to the map.
 
subroutine validate (this, config, from_labels, to_labels)
 Validates the map based on user-selected options.
 
type(pair_t) function pair_constructor (config, from_labels, to_labels)
 Constructor of pair_t objects.
 
integer function pair_pack_size (this, comm)
 Returns the size of a binary buffer required to pack the pair.
 
subroutine pair_mpi_pack (this, buffer, position, comm)
 Packs the pair onto a character buffer.
 
subroutine pair_mpi_unpack (this, buffer, position, comm)
 Unpacks a pair from a character buffer.
 

Detailed Description

Utility for mapping among arrays.

Function/Subroutine Documentation

◆ add_default_matches()

subroutine musica_map::add_default_matches ( class(map_t), intent(inout) this,
type(string_t), dimension(:), intent(in) from_labels,
type(string_t), dimension(:), intent(in) to_labels,
logical, intent(in) always )
private

Adds default matches by name to the map.

If the always option is set to false, only unmatched source elements are included in the default matching

Parameters
[in,out]thisMap
[in]from_labelsSource array element labels
[in]to_labelsDestination array element labels
[in]alwaysFlag indicating whether to always add default matches, or only do so for unmatched source elements

◆ apply()

subroutine musica_map::apply ( class(map_t), intent(in) this,
real(kind=dk), dimension(:), intent(in) from,
real(kind=dk), dimension(:), intent(out) to )
private

Transfers data from source to destination array based on map.

Parameters
[in]thisMap
[in]fromSource array
[out]toDestination array

◆ constructor()

type(map_t) function musica_map::constructor ( type(config_t), intent(inout) config,
type(string_t), dimension(:), intent(in) from_labels,
type(string_t), dimension(:), intent(in) to_labels )
private

Constructs a map_t object.

Parameters
[in,out]configMap configuration
[in]from_labelsSource array element labels
[in]to_labelsDestination array element labels

◆ mpi_pack()

subroutine musica_map::mpi_pack ( class(map_t), intent(in) this,
character, dimension(:), intent(inout) buffer,
integer, intent(inout) position,
integer, intent(in) comm )
private

Packs the map onto a character buffer.

Parameters
[in]thisMap to pack
[in,out]bufferMemory buffer
[in,out]positionCurrent buffer position
[in]commMPI communicator

◆ mpi_unpack()

subroutine musica_map::mpi_unpack ( class(map_t), intent(out) this,
character, dimension(:), intent(inout) buffer,
integer, intent(inout) position,
integer, intent(in) comm )
private

Unpacks a map from a character buffer.

Parameters
[out]thisMap to unpack
[in,out]bufferMemory buffer
[in,out]positionCurrent buffer position
[in]commMPI communicator

◆ pack_size()

integer function musica_map::pack_size ( class(map_t), intent(in) this,
integer, intent(in) comm )
private

Returns the size of a binary buffer required to pack the map.

Parameters
[in]thisMap to pack
[in]commMPI communicator

◆ pair_constructor()

type(pair_t) function musica_map::pair_constructor ( type(config_t), intent(inout) config,
type(string_t), dimension(:), intent(in) from_labels,
type(string_t), dimension(:), intent(in) to_labels )
private

Constructor of pair_t objects.

Parameters
[in,out]configMatched pair configuration
[in]from_labelsSource array element labels
[in]to_labelsDestination array element labels

◆ pair_mpi_pack()

subroutine musica_map::pair_mpi_pack ( class(pair_t), intent(in) this,
character, dimension(:), intent(inout) buffer,
integer, intent(inout) position,
integer, intent(in) comm )
private

Packs the pair onto a character buffer.

Parameters
[in]thisPair to pack
[in,out]bufferMemory buffer
[in,out]positionCurrent buffer position
[in]commMPI communicator

◆ pair_mpi_unpack()

subroutine musica_map::pair_mpi_unpack ( class(pair_t), intent(out) this,
character, dimension(:), intent(inout) buffer,
integer, intent(inout) position,
integer, intent(in) comm )
private

Unpacks a pair from a character buffer.

Parameters
[out]thisPair to unpack
[in,out]bufferMemory buffer
[in,out]positionCurrent buffer position
[in]commMPI communicator

◆ pair_pack_size()

integer function musica_map::pair_pack_size ( class(pair_t), intent(in) this,
integer, intent(in) comm )
private

Returns the size of a binary buffer required to pack the pair.

Parameters
[in]thisPair to pack
[in]commMPI communicator

◆ print_map()

subroutine musica_map::print_map ( class(map_t), intent(in) this,
type(string_t), dimension(:), intent(in) from_labels,
type(string_t), dimension(:), intent(in) to_labels,
integer, intent(in) out_unit )
private

Prints the map details to a specified output unit.

Parameters
[in]thisMap
[in]from_labelsSource array element labels
[in]to_labelsDestination array element labels
[in]out_unitOutput unit

◆ validate()

subroutine musica_map::validate ( class(map_t), intent(in) this,
type(config_t), intent(inout) config,
type(string_t), dimension(:), intent(in) from_labels,
type(string_t), dimension(:), intent(in) to_labels )
private

Validates the map based on user-selected options.

Parameters
[in]thisMap
[in,out]configMap configuration
[in]from_labelsSource array element labels
[in]to_labelsDestination array element labels