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
fleur
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Anoop Chandran
fleur
Commits
f20d075c
Commit
f20d075c
authored
Jul 13, 2019
by
Daniel Wortmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started modifying mpi-type, adjusted k-loops
parent
ea09cca8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
38 deletions
+31
-38
eigen/eigen.F90
eigen/eigen.F90
+3
-3
eigen_soc/eigenso.F90
eigen_soc/eigenso.F90
+5
-21
hybrid/hybrid.F90
hybrid/hybrid.F90
+2
-2
mpi/setupMPI.F90
mpi/setupMPI.F90
+16
-8
types/types_mpi.F90
types/types_mpi.F90
+5
-4
No files found.
eigen/eigen.F90
View file @
f20d075c
...
@@ -74,7 +74,7 @@ CONTAINS
...
@@ -74,7 +74,7 @@ CONTAINS
INTEGER
,
INTENT
(
IN
)
::
eig_id
INTEGER
,
INTENT
(
IN
)
::
eig_id
! Local Scalars
! Local Scalars
INTEGER
jsp
,
nk
,
nred
,
ne_all
,
ne_found
INTEGER
jsp
,
nk
,
nred
,
ne_all
,
ne_found
,
nk_i
INTEGER
ne
,
lh0
INTEGER
ne
,
lh0
INTEGER
isp
,
i
,
j
,
err
INTEGER
isp
,
i
,
j
,
err
LOGICAL
l_wu
,
l_file
,
l_real
,
l_zref
LOGICAL
l_wu
,
l_file
,
l_real
,
l_zref
...
@@ -132,8 +132,8 @@ CONTAINS
...
@@ -132,8 +132,8 @@ CONTAINS
unfoldingBuffer
=
CMPLX
(
0.0
,
0.0
)
unfoldingBuffer
=
CMPLX
(
0.0
,
0.0
)
DO
jsp
=
1
,
MERGE
(
1
,
input
%
jspins
,
noco
%
l_noco
)
DO
jsp
=
1
,
MERGE
(
1
,
input
%
jspins
,
noco
%
l_noco
)
k_loop
:
DO
nk
=
mpi
%
n_start
,
kpts
%
nkpt
,
mpi
%
n_stride
k_loop
:
DO
nk
_i
=
1
,
size
(
mpi
%
k_list
)
nk
=
mpi
%
k_list
(
i
)
! Set up lapw list
! Set up lapw list
CALL
lapw
%
init
(
input
,
noco
,
kpts
,
atoms
,
sym
,
nk
,
cell
,
l_zref
,
mpi
)
CALL
lapw
%
init
(
input
,
noco
,
kpts
,
atoms
,
sym
,
nk
,
cell
,
l_zref
,
mpi
)
call
timestart
(
"Setup of H&S matrices"
)
call
timestart
(
"Setup of H&S matrices"
)
...
...
eigen_soc/eigenso.F90
View file @
f20d075c
...
@@ -60,9 +60,9 @@ CONTAINS
...
@@ -60,9 +60,9 @@ CONTAINS
! ..
! ..
! ..
! ..
! .. Local Scalars ..
! .. Local Scalars ..
INTEGER
i
,
j
,
nk
,
jspin
,
n
,
l
INTEGER
i
,
j
,
nk
,
nk_i
,
jspin
,
n
,
l
! INTEGER n_loc,n_plus,i_plus,
! INTEGER n_loc,n_plus,i_plus,
INTEGER
n
_end
,
n
sz
,
nmat
,
n_stride
INTEGER
nsz
,
nmat
,
n_stride
LOGICAL
l_socvec
!,l_all
LOGICAL
l_socvec
!,l_all
INTEGER
wannierspin
INTEGER
wannierspin
TYPE
(
t_usdus
)
::
usdus
TYPE
(
t_usdus
)
::
usdus
...
@@ -129,25 +129,9 @@ CONTAINS
...
@@ -129,25 +129,9 @@ CONTAINS
CALL
timestop
(
"eigenso: spnorb"
)
CALL
timestop
(
"eigenso: spnorb"
)
!
!
!---> loop over k-points: each can be a separate task
!---> loop over k-points: each can be a separate task
!
!DO nk_i=1,SIZE(mpi%k_list)
!n_loc = INT(kpts%nkpt/mpi%isize)
nk
=
mpi
%
k_list
(
nk_i
)
!n_plus = kpts%nkpt - mpi%isize*n_loc
!DO nk = mpi%n_start,n_end,n_stride
!i_plus = -1
!IF (mpi%irank.LT.n_plus) i_plus = 0
!n_end = (mpi%irank+1)+(n_loc+i_plus)*mpi%isize
!
#if defined(CPP_MPI)
n_stride
=
kpts
%
nkpt
/
mpi
%
n_groups
#else
n_stride
=
1
#endif
n_end
=
kpts
%
nkpt
!write(*,'(4i12)') mpi%irank, mpi%n_groups, n_stride, mpi%n_start
!
!---> start loop k-pts
!
! DO nk = mpi%irank+1,n_end,mpi%isize
DO
nk
=
mpi
%
n_start
,
n_end
,
n_stride
CALL
lapw
%
init
(
input
,
noco
,
kpts
,
atoms
,
sym
,
nk
,
cell
,
.FALSE.
,
mpi
)
CALL
lapw
%
init
(
input
,
noco
,
kpts
,
atoms
,
sym
,
nk
,
cell
,
.FALSE.
,
mpi
)
ALLOCATE
(
zso
(
lapw
%
nv
(
1
)
+
atoms
%
nlotot
,
2
*
DIMENSION
%
neigd
,
wannierspin
))
ALLOCATE
(
zso
(
lapw
%
nv
(
1
)
+
atoms
%
nlotot
,
2
*
DIMENSION
%
neigd
,
wannierspin
))
zso
(:,:,:)
=
CMPLX
(
0.0
,
0.0
)
zso
(:,:,:)
=
CMPLX
(
0.0
,
0.0
)
...
...
hybrid/hybrid.F90
View file @
f20d075c
...
@@ -127,8 +127,8 @@ CONTAINS
...
@@ -127,8 +127,8 @@ CONTAINS
call
timestop
(
"HF_setup"
)
call
timestop
(
"HF_setup"
)
DO
nk
=
1
,
kpts
%
nkpt
DO
nk
=
mpi
%
n_start
,
kpts
%
nkpt
,
mpi
%
n_stride
!
DO nk = mpi%n_start,kpts%nkpt,mpi%n_stride
CALL
lapw
%
init
(
input
,
noco
,
kpts
,
atoms
,
sym
,
nk
,
cell
,
l_zref
)
CALL
lapw
%
init
(
input
,
noco
,
kpts
,
atoms
,
sym
,
nk
,
cell
,
l_zref
)
CALL
hsfock
(
nk
,
atoms
,
hybrid
,
lapw
,
DIMENSION
,
kpts
,
jsp
,
input
,
hybdat
,
eig_irr
,
sym
,
cell
,&
CALL
hsfock
(
nk
,
atoms
,
hybrid
,
lapw
,
DIMENSION
,
kpts
,
jsp
,
input
,
hybdat
,
eig_irr
,
sym
,
cell
,&
noco
,
results
,
iterHF
,
MAXVAL
(
hybrid
%
nobd
),
xcpot
,
mpi
)
noco
,
results
,
iterHF
,
MAXVAL
(
hybrid
%
nobd
),
xcpot
,
mpi
)
...
...
mpi/setupMPI.F90
View file @
f20d075c
...
@@ -16,7 +16,7 @@ CONTAINS
...
@@ -16,7 +16,7 @@ CONTAINS
INTEGER
,
INTENT
(
in
)
::
nkpt
INTEGER
,
INTENT
(
in
)
::
nkpt
TYPE
(
t_mpi
),
INTENT
(
inout
)
::
mpi
TYPE
(
t_mpi
),
INTENT
(
inout
)
::
mpi
integer
::
omp
=
-1
INTEGER
::
omp
=
-1
,
i
!$ omp=omp_get_max_threads()
!$ omp=omp_get_max_threads()
if
(
mpi
%
irank
==
0
)
THEN
if
(
mpi
%
irank
==
0
)
THEN
...
@@ -39,12 +39,14 @@ CONTAINS
...
@@ -39,12 +39,14 @@ CONTAINS
IF
(
mpi
%
isize
==
1
)
THEN
IF
(
mpi
%
isize
==
1
)
THEN
!give some info on available parallelisation
!give some info on available parallelisation
CALL
priv_dist_info
(
nkpt
)
CALL
priv_dist_info
(
nkpt
)
mpi
%
n_start
=
1
mpi
%
n_stride
=
1
mpi
%
n_rank
=
0
mpi
%
n_rank
=
0
mpi
%
n_size
=
1
mpi
%
n_size
=
1
mpi
%
n_groups
=
1
mpi
%
sub_comm
=
mpi
%
mpi_comm
mpi
%
sub_comm
=
mpi
%
mpi_comm
IF
(
ALLOCATED
(
kpts
%
k_list
))
DEALLOCATE
(
mpi
%
k_List
,
mpi
%
ev_list
))
ALLOCATE
(
mpi
%
k_list
(
kpts
%
nkpts
))
mpi
%
k_list
=
[(
i
,
i
=
1
,
kpts
%
nkpts
)]
ALLOCATE
(
mpi
%
ev_list
(
neigd
))
mpi
%
ev_list
=
[(
i
,
i
=
1
,
neigd
)]
END
IF
END
IF
#ifdef CPP_MPI
#ifdef CPP_MPI
!Distribute the work
!Distribute the work
...
@@ -107,13 +109,16 @@ CONTAINS
...
@@ -107,13 +109,16 @@ CONTAINS
IF
((
MOD
(
mpi
%
isize
,
n_members
)
==
0
)
.AND.
(
MOD
(
nkpt
,
n_members
)
==
0
)
)
EXIT
IF
((
MOD
(
mpi
%
isize
,
n_members
)
==
0
)
.AND.
(
MOD
(
nkpt
,
n_members
)
==
0
)
)
EXIT
n_members
=
n_members
-
1
n_members
=
n_members
-
1
ENDDO
ENDDO
mpi
%
n_groups
=
nkpt
/
n_members
ALLOCATE
(
mpi
%
k_list
(
nkpt
/
n_members
))
mpi
%
k_list
=
[(
nk
,
nk
=
nkpt
/
n_members
,
nkpt
,
n_members
)]
!mpi%n_groups = nkpt/n_members
mpi
%
n_size
=
mpi
%
isize
/
n_members
mpi
%
n_size
=
mpi
%
isize
/
n_members
mpi
%
n_stride
=
n_members
!
mpi%n_stride = n_members
IF
(
mpi
%
irank
==
0
)
THEN
IF
(
mpi
%
irank
==
0
)
THEN
WRITE
(
*
,
*
)
'k-points in parallel: '
,
n_members
WRITE
(
*
,
*
)
'k-points in parallel: '
,
n_members
WRITE
(
*
,
*
)
"pe's per k-point: "
,
mpi
%
n_size
WRITE
(
*
,
*
)
"pe's per k-point: "
,
mpi
%
n_size
WRITE
(
*
,
*
)
'# of k-point loops: '
,
mpi
%
n_group
s
WRITE
(
*
,
*
)
'# of k-point loops: '
,
nkpt
/
n_member
s
ENDIF
ENDIF
END
SUBROUTINE
priv_distribute_k
END
SUBROUTINE
priv_distribute_k
...
@@ -128,7 +133,7 @@ CONTAINS
...
@@ -128,7 +133,7 @@ CONTAINS
LOGICAL
::
compact
! Deside how to distribute k-points
LOGICAL
::
compact
! Deside how to distribute k-points
compact
=
.true.
compact
=
.true.
n_members
=
nkpt
/
mpi
%
n_groups
n_members
=
mpi
%
isize
/
mpi
%
n_size
! now, we make the groups
! now, we make the groups
...
@@ -188,6 +193,9 @@ CONTAINS
...
@@ -188,6 +193,9 @@ CONTAINS
!write (*,"(a,i0,100i4)") "MPI:",mpi%sub_comm,mpi%irank,mpi%n_groups,mpi%n_size,n,i_mygroup
!write (*,"(a,i0,100i4)") "MPI:",mpi%sub_comm,mpi%irank,mpi%n_groups,mpi%n_size,n,i_mygroup
CALL
MPI_COMM_RANK
(
mpi
%
SUB_COMM
,
mpi
%
n_rank
,
ierr
)
CALL
MPI_COMM_RANK
(
mpi
%
SUB_COMM
,
mpi
%
n_rank
,
ierr
)
ALLOCATE
(
mpi
%
ev_list
(
neig
/
mpi
%
n_size
+1
))
mpi
%
ev_list
=
[(
i
,
i
=
mpi
%
irank
+1
,
neig
,
mpi
%
n_size
)]
#endif
#endif
END
SUBROUTINE
priv_create_comm
END
SUBROUTINE
priv_create_comm
...
...
types/types_mpi.F90
View file @
f20d075c
...
@@ -5,14 +5,15 @@
...
@@ -5,14 +5,15 @@
!--------------------------------------------------------------------------------
!--------------------------------------------------------------------------------
MODULE
m_types_mpi
MODULE
m_types_mpi
TYPE
t_mpi
TYPE
t_mpi
!k-point parallelism
INTEGER
::
mpi_comm
!< replaces MPI_COMM_WORLD
INTEGER
::
mpi_comm
!< replaces MPI_COMM_WORLD
INTEGER
::
irank
!< rank of task in mpi_comm
INTEGER
::
irank
!< rank of task in mpi_comm
INTEGER
::
isize
!< no of tasks in mpi_comm
INTEGER
::
isize
!< no of tasks in mpi_comm
INTEGER
::
n_start
!< no of first k-point to calculate on this PE
INTEGER
,
ALLOCATABLE
::
k_list
(:)
INTEGER
::
n_stride
!< stride for k-loops
!Eigenvalue parallelism
INTEGER
::
n_size
!< PE per kpoint, i.e. "isize" for eigenvalue parallelization
INTEGER
::
n_groups
!< No of k-loops per PE
INTEGER
::
sub_comm
!< Sub-Communicator for eigenvalue parallelization (all PE working on same k-point)
INTEGER
::
sub_comm
!< Sub-Communicator for eigenvalue parallelization (all PE working on same k-point)
INTEGER
::
n_rank
!< rank in sub_comm
INTEGER
::
n_rank
!< rank in sub_comm
INTEGER
::
n_size
!< PE per kpoint, i.e. "isize" for eigenvalue parallelization
INTEGER
,
ALLOCATABLE
::
ev_list
(:)
END
TYPE
t_mpi
END
TYPE
t_mpi
END
MODULE
m_types_mpi
END
MODULE
m_types_mpi
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