MatrixReduceModule Module

Module for reducing matrices across processes.



Contents


Interfaces

public interface ReduceAndComposeMatrixSizes

  • private subroutine ReduceAndComposeMatrixSizes_lsr(matrix, communicator, gathered_matrix, helper)

    The first routine to call, gathers the sizes of the data to be sent.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    integer, intent(inout) :: communicator

    The communicator to send along.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

  • private subroutine ReduceAndComposeMatrixSizes_lsc(matrix, communicator, gathered_matrix, helper)

    The first routine to call, gathers the sizes of the data to be sent.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix
    integer, intent(inout) :: communicator
    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

public interface ReduceAndComposeMatrixData

  • private subroutine ReduceAndComposeMatrixData_lsr(matrix, communicator, gathered_matrix, helper)

    Second function to call, will gather the data and align it one matrix

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    integer, intent(inout) :: communicator

    The communicator to send along.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

  • private subroutine ReduceAndComposeMatrixData_lsc(matrix, communicator, gathered_matrix, helper)

    Second function to call, will gather the data and align it one matrix next to another. @param[in] matrix to send. @param[inout] communicator to send along. @param[inout] gathered_matrix the matrix we are gathering. @param[inout] helper a helper associated with this gather.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix

    The matrix to send.

    integer, intent(inout) :: communicator

    The communicator to send along.

    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

  • private subroutine ReduceAndComposeMatrixCleanup_lsr(matrix, gathered_matrix, helper)

    Third function to call, finishes setting up the matrices.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

  • private subroutine ReduceAndComposeMatrixCleanup_lsc(matrix, gathered_matrix, helper)

    Third function to call, finishes setting up the matrices.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

public interface ReduceAndComposeMatrix

  • private subroutine ReduceAndComposeMatrix_lsr(matrix, gathered_matrix, comm)

    Reduce and sum the matrices in one step. If you use this method, you lose the opportunity for overlapping communication.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    integer, intent(inout) :: comm

    The communicator to send along.

  • private subroutine ReduceAndComposeMatrix_lsc(matrix, gathered_matrix, comm)

    Reduce and sum the matrices in one step. If you use this method, you lose the opportunity for overlapping communication.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    integer, intent(inout) :: comm

    The communicator to send along.

public interface ReduceAndSumMatrixSizes

  • private subroutine ReduceAndSumMatrixSizes_lsr(matrix, communicator, gathered_matrix, helper)

    The first routine to call, gathers the sizes of the data to be sent.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    integer, intent(inout) :: communicator

    The communicator to send along.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

  • private subroutine ReduceAndSumMatrixSizes_lsc(matrix, communicator, gathered_matrix, helper)

    The first routine to call, gathers the sizes of the data to be sent.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix

    The matrix to send.

    integer, intent(inout) :: communicator

    The communicator to send along.

    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

public interface ReduceAndSumMatrixData

  • private subroutine ReduceAndSumMatrixData_lsr(matrix, gathered_matrix, communicator, helper)

    Second routine to call for gathering and summing up the data.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    integer, intent(inout) :: communicator

    The communicator to send along.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

  • private subroutine ReduceAndSumMatrixData_lsc(matrix, gathered_matrix, communicator, helper)

    Second routine to call for gathering and summing up the data.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The matrix we are gathering.

    integer, intent(inout) :: communicator

    The communicator to send along.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

public interface ReduceAndSumMatrixCleanup

  • private subroutine ReduceAndSumMatrixCleanup_lsr(matrix, gathered_matrix, threshold, helper)

    Finally routine to sum up the matrices.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The gathered_matrix the matrix being gathered.

    real(kind=NTREAL), intent(in) :: threshold

    The threshold the threshold for flushing values.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

  • private subroutine ReduceAndSumMatrixCleanup_lsc(matrix, gathered_matrix, threshold, helper)

    Finally routine to sum up the matrices.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The threshold the threshold for flushing values.

    real(kind=NTREAL), intent(in) :: threshold

    The threshold the threshold for flushing values.

    type(ReduceHelper_t), intent(inout) :: helper

    The helper associated with this gather.

public interface ReduceAndSumMatrix

  • private subroutine ReduceAndSumMatrix_lsr(matrix, gathered_matrix, threshold, comm)

    Reduce and sum the matrices in one step. If you use this method, you lose the opportunity for overlapping communication.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsr), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsr), intent(inout) :: gathered_matrix

    The gathered_matrix the matrix being gathered.

    real(kind=NTREAL), intent(in) :: threshold

    The threshold the threshold for flushing values.

    integer, intent(inout) :: comm

    The communicator to send along.

  • private subroutine ReduceAndSumMatrix_lsc(matrix, gathered_matrix, threshold, comm)

    Reduce and sum the matrices in one step. If you use this method, you lose the opportunity for overlapping communication.

    Arguments

    Type IntentOptional AttributesName
    type(Matrix_lsc), intent(in) :: matrix

    The matrix to send.

    type(Matrix_lsc), intent(inout) :: gathered_matrix

    The threshold the threshold for flushing values.

    real(kind=NTREAL), intent(in) :: threshold

    The threshold the threshold for flushing values.

    integer, intent(inout) :: comm

    The communicator to send along.


Derived Types

type, public :: ReduceHelper_t

A data structure to stores internal information about a reduce call.

Components

TypeVisibility AttributesNameInitial
integer, public :: comm_size

Number of processors involved in this gather.

integer, public :: outer_request

A request object for gathering outer indices.

integer, public :: inner_request

A request object for gathering inner indices.

integer, public :: data_request

A request object for gathering data.

integer, public :: error_code

The error code after an MPI call.

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

Number of values to gather from each process.

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

The displacements for where those gathered values should go.


Functions

public function TestReduceSizeRequest(helper) result(request_completed)

Test if a request for the size of the matrices is complete.

Arguments

Type IntentOptional AttributesName
type(ReduceHelper_t), intent(inout) :: helper

The gatherer helper structure.

Return Value logical

True if the request is finished.

public function TestReduceInnerRequest(helper) result(request_completed)

Test if a request for the inner indices of the matrices is complete.

Arguments

Type IntentOptional AttributesName
type(ReduceHelper_t), intent(inout) :: helper

The gatherer helper structure.

Return Value logical

True if the request is finished.

public function TestReduceDataRequest(helper) result(request_completed)

Test if a request for the data of the matrices is complete.

Arguments

Type IntentOptional AttributesName
type(ReduceHelper_t), intent(inout) :: helper

The gatherer helper structure.

Return Value logical

True if the request is finished.