PermutationModule Module

Module for load balancing the matrix multiplication calculation.



Contents


Derived Types

type, public :: Permutation_t

A data structure for storing permutations.

Components

TypeVisibility AttributesNameInitial
integer, public, DIMENSION(:), ALLOCATABLE:: index_lookup

For each row/column, what index does it correspond to in the unperturbed matrix.

integer, public, DIMENSION(:), ALLOCATABLE:: reverse_index_lookup

For each row/column in the unperturbed, what index does it correspond to in this matrix.


Subroutines

public subroutine ConstructDefaultPermutation(this, matrix_dimension)

Constructs a permutation that preserves the original order.

Arguments

Type IntentOptional AttributesName
type(Permutation_t), intent(inout) :: this

The permutation to construct.

integer, intent(in) :: matrix_dimension

The dimension of the matrix.

public subroutine ConstructReversePermutation(this, matrix_dimension)

Constructs a permutation that reverses the original order.

Arguments

Type IntentOptional AttributesName
type(Permutation_t), intent(inout) :: this

A permutation that reverses the original order.

integer, intent(in) :: matrix_dimension

The size of the matrix.

public subroutine ConstructRandomPermutation(this, matrix_dimension, process_grid_in)

Constructs a permutation that has a random order. Implements Knuth shuffle.

Arguments

Type IntentOptional AttributesName
type(Permutation_t), intent(inout) :: this

A permutation that reverses the original order.

integer, intent(in) :: matrix_dimension

The size of the matrix.

type(ProcessGrid_t), intent(inout), optional :: process_grid_in

A permutation should be shared amongst these processes. This is to synchronize random number across processes.

public subroutine ConstructLimitedRandomPermutation(this, actual_matrix_dimension, logical_matrix_dimension, process_grid_in)

Constructs a permutation that has a random order, but there is no permutation from beyond the actual matrix dimension.

Arguments

Type IntentOptional AttributesName
type(Permutation_t), intent(inout) :: this

The permutation to construct.

integer, intent(in) :: actual_matrix_dimension

Actual size of the matrix.

integer, intent(in) :: logical_matrix_dimension

Padded size of the matrix.

type(ProcessGrid_t), intent(inout), optional :: process_grid_in

A permutation should be shared amongst these processes. This is to synchronize random number across processes.

public subroutine DestructPermutation(this)

Destruct a permutation object.

Arguments

Type IntentOptional AttributesName
type(Permutation_t), intent(inout) :: this

The permutation to destruct.