Commit 16b9fbf6 authored by Andreas Marek's avatar Andreas Marek

Some intendation

parent e7048c99
......@@ -52,68 +52,68 @@
#include "../general/sanity.F90"
subroutine ssymm_matrix_allreduce_&
subroutine ssymm_matrix_allreduce_&
&PRECISION &
(obj, n, a, lda, ldb, comm)
!-------------------------------------------------------------------------------
! symm_matrix_allreduce: Does an mpi_allreduce for a symmetric matrix A.
! On entry, only the upper half of A needs to be set
! On exit, the complete matrix is set
!-------------------------------------------------------------------------------
use elpa_abstract_impl
use precision
implicit none
class(elpa_abstract_impl_t), intent(inout) :: obj
integer(kind=ik) :: n, lda, ldb, comm
!-------------------------------------------------------------------------------
! symm_matrix_allreduce: Does an mpi_allreduce for a symmetric matrix A.
! On entry, only the upper half of A needs to be set
! On exit, the complete matrix is set
!-------------------------------------------------------------------------------
use elpa_abstract_impl
use precision
implicit none
class(elpa_abstract_impl_t), intent(inout) :: obj
integer(kind=ik) :: n, lda, ldb, comm
#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: a(lda,*)
real(kind=REAL_DATATYPE) :: a(lda,*)
#else
real(kind=REAL_DATATYPE) :: a(lda,ldb)
real(kind=REAL_DATATYPE) :: a(lda,ldb)
#endif
integer(kind=ik) :: i, nc, mpierr
real(kind=REAL_DATATYPE) :: h1(n*n), h2(n*n)
integer(kind=ik) :: i, nc, mpierr
real(kind=REAL_DATATYPE) :: h1(n*n), h2(n*n)
call obj%timer%start("symm_matrix_allreduce" // PRECISION_SUFFIX)
call obj%timer%start("symm_matrix_allreduce" // PRECISION_SUFFIX)
nc = 0
do i=1,n
h1(nc+1:nc+i) = a(1:i,i)
nc = nc+i
enddo
nc = 0
do i=1,n
h1(nc+1:nc+i) = a(1:i,i)
nc = nc+i
enddo
#ifdef WITH_MPI
call obj%timer%start("mpi_communication")
call mpi_allreduce(h1, h2, nc, MPI_REAL_PRECISION, MPI_SUM, comm, mpierr)
call obj%timer%stop("mpi_communication")
nc = 0
do i=1,n
a(1:i,i) = h2(nc+1:nc+i)
a(i,1:i-1) = - a(1:i-1,i)
nc = nc+i
enddo
call obj%timer%start("mpi_communication")
call mpi_allreduce(h1, h2, nc, MPI_REAL_PRECISION, MPI_SUM, comm, mpierr)
call obj%timer%stop("mpi_communication")
nc = 0
do i=1,n
a(1:i,i) = h2(nc+1:nc+i)
a(i,1:i-1) = - a(1:i-1,i)
nc = nc+i
enddo
#else /* WITH_MPI */
! h2=h1
nc = 0
do i=1,n
a(1:i,i) = h1(nc+1:nc+i)
a(i,1:i-1) = - a(1:i-1,i)
nc = nc+i
enddo
nc = 0
do i=1,n
a(1:i,i) = h1(nc+1:nc+i)
a(i,1:i-1) = - a(1:i-1,i)
nc = nc+i
enddo
#endif /* WITH_MPI */
! nc = 0
! do i=1,n
! a(1:i,i) = h2(nc+1:nc+i)
! a(i,1:i-1) = a(1:i-1,i)
! nc = nc+i
! enddo
! nc = 0
! do i=1,n
! a(1:i,i) = h2(nc+1:nc+i)
! a(i,1:i-1) = a(1:i-1,i)
! nc = nc+i
! enddo
call obj%timer%stop("symm_matrix_allreduce" // PRECISION_SUFFIX)
call obj%timer%stop("symm_matrix_allreduce" // PRECISION_SUFFIX)
end subroutine ssymm_matrix_allreduce_&
&PRECISION
end subroutine ssymm_matrix_allreduce_&
&PRECISION
......@@ -61,93 +61,93 @@
#ifdef SKEW_SYMMETRIC_BUILD
subroutine ssymm_matrix_allreduce_&
subroutine ssymm_matrix_allreduce_&
#else
subroutine symm_matrix_allreduce_&
subroutine symm_matrix_allreduce_&
#endif
&PRECISION &
(obj, n, a, lda, ldb, comm)
!-------------------------------------------------------------------------------
! symm_matrix_allreduce: Does an mpi_allreduce for a symmetric matrix A.
! On entry, only the upper half of A needs to be set
! On exit, the complete matrix is set
!-------------------------------------------------------------------------------
use elpa_abstract_impl
use precision
implicit none
class(elpa_abstract_impl_t), intent(inout) :: obj
integer(kind=ik) :: n, lda, ldb, comm
!-------------------------------------------------------------------------------
! symm_matrix_allreduce: Does an mpi_allreduce for a symmetric matrix A.
! On entry, only the upper half of A needs to be set
! On exit, the complete matrix is set
!-------------------------------------------------------------------------------
use elpa_abstract_impl
use precision
implicit none
class(elpa_abstract_impl_t), intent(inout) :: obj
integer(kind=ik) :: n, lda, ldb, comm
#ifdef USE_ASSUMED_SIZE
real(kind=REAL_DATATYPE) :: a(lda,*)
real(kind=REAL_DATATYPE) :: a(lda,*)
#else
real(kind=REAL_DATATYPE) :: a(lda,ldb)
real(kind=REAL_DATATYPE) :: a(lda,ldb)
#endif
integer(kind=ik) :: i, nc
integer(kind=MPI_KIND) :: mpierr
real(kind=REAL_DATATYPE) :: h1(n*n), h2(n*n)
integer(kind=ik) :: i, nc
integer(kind=MPI_KIND) :: mpierr
real(kind=REAL_DATATYPE) :: h1(n*n), h2(n*n)
call obj%timer%start("&
&ROUTINE_NAME&
&" // &
&PRECISION_SUFFIX&
)
call obj%timer%start("&
&ROUTINE_NAME&
&" // &
&PRECISION_SUFFIX&
)
nc = 0
do i=1,n
h1(nc+1:nc+i) = a(1:i,i)
nc = nc+i
enddo
nc = 0
do i=1,n
h1(nc+1:nc+i) = a(1:i,i)
nc = nc+i
enddo
#ifdef WITH_MPI
call obj%timer%start("mpi_communication")
call mpi_allreduce(h1, h2, int(nc,kind=MPI_KIND), MPI_REAL_PRECISION, MPI_SUM, &
int(comm,kind=MPI_KIND), mpierr)
call obj%timer%stop("mpi_communication")
nc = 0
do i=1,n
a(1:i,i) = h2(nc+1:nc+i)
call obj%timer%start("mpi_communication")
call mpi_allreduce(h1, h2, int(nc,kind=MPI_KIND), MPI_REAL_PRECISION, MPI_SUM, &
int(comm,kind=MPI_KIND), mpierr)
call obj%timer%stop("mpi_communication")
nc = 0
do i=1,n
a(1:i,i) = h2(nc+1:nc+i)
#ifdef SKEW_SYMMETRIC_BUILD
a(i,1:i-1) = - a(1:i-1,i)
a(i,1:i-1) = - a(1:i-1,i)
#else
a(i,1:i-1) = a(1:i-1,i)
a(i,1:i-1) = a(1:i-1,i)
#endif
nc = nc+i
enddo
nc = nc+i
enddo
#else /* WITH_MPI */
! h2=h1
nc = 0
do i=1,n
a(1:i,i) = h1(nc+1:nc+i)
nc = 0
do i=1,n
a(1:i,i) = h1(nc+1:nc+i)
#ifdef SKEW_SYMMETRIC_BUILD
a(i,1:i-1) = - a(1:i-1,i)
a(i,1:i-1) = - a(1:i-1,i)
#else
a(i,1:i-1) = a(1:i-1,i)
a(i,1:i-1) = a(1:i-1,i)
#endif
nc = nc+i
enddo
nc = nc+i
enddo
#endif /* WITH_MPI */
! nc = 0
! do i=1,n
! a(1:i,i) = h2(nc+1:nc+i)
! a(i,1:i-1) = a(1:i-1,i)
! nc = nc+i
! enddo
! nc = 0
! do i=1,n
! a(1:i,i) = h2(nc+1:nc+i)
! a(i,1:i-1) = a(1:i-1,i)
! nc = nc+i
! enddo
call obj%timer%stop("&
&ROUTINE_NAME&
&" // &
&PRECISION_SUFFIX&
)
call obj%timer%stop("&
&ROUTINE_NAME&
&" // &
&PRECISION_SUFFIX&
)
#ifdef SKEW_SYMMETRIC_BUILD
end subroutine ssymm_matrix_allreduce_&
end subroutine ssymm_matrix_allreduce_&
#else
end subroutine symm_matrix_allreduce_&
end subroutine symm_matrix_allreduce_&
#endif
&PRECISION
&PRECISION
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment