Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
elpa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
15
Issues
15
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
elpa
elpa
Commits
aca10b77
Commit
aca10b77
authored
Jul 27, 2020
by
Andreas Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some intendation
parent
3d56cd57
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
53 deletions
+51
-53
src/elpa2/elpa2_herm_matrix_allreduce_complex_template.F90
src/elpa2/elpa2_herm_matrix_allreduce_complex_template.F90
+51
-53
No files found.
src/elpa2/elpa2_herm_matrix_allreduce_complex_template.F90
View file @
aca10b77
...
...
@@ -52,68 +52,66 @@
#include "../general/sanity.F90"
subroutine
herm_matrix_allreduce_
&
&
PRECISION
&
(
obj
,
n
,
a
,
lda
,
ldb
,
comm
)
!-------------------------------------------------------------------------------
! herm_matrix_allreduce: Does an mpi_allreduce for a hermitian 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
complex
(
kind
=
COMPLEX_DATATYPE
)
::
a
(
lda
,
ldb
)
integer
(
kind
=
ik
)
::
i
,
nc
integer
(
kind
=
MPI_KIND
)
::
mpierr
complex
(
kind
=
COMPLEX_DATATYPE
)
::
h1
(
n
*
n
),
h2
(
n
*
n
)
call
obj
%
timer
%
start
(
"herm_matrix_allreduce"
//
PRECISION_SUFFIX
)
nc
=
0
do
i
=
1
,
n
h1
(
nc
+1
:
nc
+
i
)
=
a
(
1
:
i
,
i
)
nc
=
nc
+
i
enddo
subroutine
herm_matrix_allreduce_
&
&
PRECISION
&
(
obj
,
n
,
a
,
lda
,
ldb
,
comm
)
!-------------------------------------------------------------------------------
! herm_matrix_allreduce: Does an mpi_allreduce for a hermitian 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
complex
(
kind
=
COMPLEX_DATATYPE
)
::
a
(
lda
,
ldb
)
integer
(
kind
=
ik
)
::
i
,
nc
integer
(
kind
=
MPI_KIND
)
::
mpierr
complex
(
kind
=
COMPLEX_DATATYPE
)
::
h1
(
n
*
n
),
h2
(
n
*
n
)
call
obj
%
timer
%
start
(
"herm_matrix_allreduce"
//
PRECISION_SUFFIX
)
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_COMPLEX_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
)
a
(
i
,
1
:
i
-1
)
=
conjg
(
a
(
1
:
i
-1
,
i
))
nc
=
nc
+
i
enddo
call
obj
%
timer
%
start
(
"mpi_communication"
)
call
mpi_allreduce
(
h1
,
h2
,
int
(
nc
,
kind
=
MPI_KIND
),
MPI_COMPLEX_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
)
a
(
i
,
1
:
i
-1
)
=
conjg
(
a
(
1
:
i
-1
,
i
))
nc
=
nc
+
i
enddo
#else /* WITH_MPI */
! h2(1:nc) = h1(1:nc)
nc
=
0
do
i
=
1
,
n
a
(
1
:
i
,
i
)
=
h1
(
nc
+1
:
nc
+
i
)
a
(
i
,
1
:
i
-1
)
=
conjg
(
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
)
=
conjg
(
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) = conjg(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) = conjg(a(1:i-1,i))
! nc = nc+i
! enddo
call
obj
%
timer
%
stop
(
"herm_matrix_allreduce"
//
PRECISION_SUFFIX
)
call
obj
%
timer
%
stop
(
"herm_matrix_allreduce"
//
PRECISION_SUFFIX
)
end
subroutine
herm_matrix_allreduce_
&
&
PRECISION
end
subroutine
herm_matrix_allreduce_
&
&
PRECISION
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment