pic_transpose Interface

public interface pic_transpose

pic_transpose provides a blas-less, threaded alternative to the Fortran transpose intrinsic which will be slow for large matrix sizes. pic_transpose does not assume symmetric matrices

pic_transpose is implemented for (int32, int64, sp, dp) 2d arrays

Usage: call pic_transpose(matrix_to_transpose, result, [optional] threaded, [optional] err)

This subroutine is threaded for performance purposes if threaded is set to true

The result must be shaped (cols, rows) for an input shaped (rows, cols). If it is not, the optional err argument is set to ERROR_VALIDATION; if err is absent the mismatch aborts the program with error stop, which is the historical behaviour. The result is intent(out), so on the error path it is undefined and the caller must not read it.

Note

If this subroutine is called inside a omp threaded region it will run serially because of nested parallelism

Calls

interface~~pic_transpose~~CallsGraph interface~pic_transpose pic_transpose proc~transpose_matrix_dp transpose_matrix_dp interface~pic_transpose->proc~transpose_matrix_dp proc~transpose_matrix_int32 transpose_matrix_int32 interface~pic_transpose->proc~transpose_matrix_int32 proc~transpose_matrix_int64 transpose_matrix_int64 interface~pic_transpose->proc~transpose_matrix_int64 proc~transpose_matrix_sp transpose_matrix_sp interface~pic_transpose->proc~transpose_matrix_sp interface~pic_optional pic_optional proc~transpose_matrix_dp->interface~pic_optional proc~error_raise error_raise proc~transpose_matrix_dp->proc~error_raise proc~transpose_matrix_int32->interface~pic_optional proc~transpose_matrix_int32->proc~error_raise proc~transpose_matrix_int64->interface~pic_optional proc~transpose_matrix_int64->proc~error_raise proc~transpose_matrix_sp->interface~pic_optional proc~transpose_matrix_sp->proc~error_raise proc~optional_char optional_char interface~pic_optional->proc~optional_char proc~optional_dp optional_dp interface~pic_optional->proc~optional_dp proc~optional_int32 optional_int32 interface~pic_optional->proc~optional_int32 proc~optional_int64 optional_int64 interface~pic_optional->proc~optional_int64 proc~optional_logical optional_logical interface~pic_optional->proc~optional_logical proc~optional_sp optional_sp interface~pic_optional->proc~optional_sp proc~error_set error_t%error_set proc~error_raise->proc~error_set

Module Procedures

private subroutine transpose_matrix_int32(A, B, threaded, err)

transpose a matrix of datatype int32

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: A(:,:)
integer(kind=int32), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

private subroutine transpose_matrix_int64(A, B, threaded, err)

transpose a matrix of datatype int64

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: A(:,:)
integer(kind=int64), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

private subroutine transpose_matrix_sp(A, B, threaded, err)

transpose a matrix of datatype sp

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: A(:,:)
real(kind=sp), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop

private subroutine transpose_matrix_dp(A, B, threaded, err)

transpose a matrix of datatype dp

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: A(:,:)
real(kind=dp), intent(out) :: B(:,:)
logical, intent(in), optional :: threaded
type(error_t), intent(inout), optional :: err

set to ERROR_VALIDATION when B is not shaped (cols, rows); B is intent(out) and therefore undefined on that path. When err is absent a mismatch aborts with error stop