pic_sum Interface

public interface pic_sum

pic_sum provides a threaded alternative to the sum(array) Fortran intrinsic which will be too slow for large sizes of vectors and matrices. Note that this provides the total sum. As opposed to the blas alternative XASUM which does the absolute sum

pic_sum is implemented for (int32, int64, sp, dp) 1 and 2d arrays

Usage: result = pic_sum(array, [optional] threaded)

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

Note

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

Calls

interface~~pic_sum~~CallsGraph interface~pic_sum pic_sum proc~sum_matrix_dp sum_matrix_dp interface~pic_sum->proc~sum_matrix_dp proc~sum_matrix_int32 sum_matrix_int32 interface~pic_sum->proc~sum_matrix_int32 proc~sum_matrix_int64 sum_matrix_int64 interface~pic_sum->proc~sum_matrix_int64 proc~sum_matrix_sp sum_matrix_sp interface~pic_sum->proc~sum_matrix_sp proc~sum_vector_dp sum_vector_dp interface~pic_sum->proc~sum_vector_dp proc~sum_vector_int32 sum_vector_int32 interface~pic_sum->proc~sum_vector_int32 proc~sum_vector_int64 sum_vector_int64 interface~pic_sum->proc~sum_vector_int64 proc~sum_vector_sp sum_vector_sp interface~pic_sum->proc~sum_vector_sp

Module Procedures

private function sum_vector_int32(vector, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_vector_int64(vector, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_vector_sp(vector, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)

private function sum_vector_dp(vector, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vector(:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)

private function sum_matrix_int32(matrix, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int32)

private function sum_matrix_int64(matrix, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value integer(kind=int64)

private function sum_matrix_sp(matrix, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=sp)

private function sum_matrix_dp(matrix, threaded) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: matrix(:,:)
logical, intent(in), optional :: threaded

Return Value real(kind=dp)