FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
abacus-develop/source/source_base/parallel_comm.cpp at develop · maki49/abacus-develop · GitHub
maki49
/
abacus-develop
Public
forked from
deepmodeling/abacus-develop
Notifications
You must be signed in to change notification settings
Fork
1
Star
3
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
abacus-develop
/
source
/
source_base
/
parallel_comm.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (47 loc) · 1.79 KB
Breadcrumbs
abacus-develop
/
source
/
source_base
/
parallel_comm.cpp
Copy path
File metadata and controls
55 lines (47 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#
if
defined __MPI
#
include
"
mpi.h
"
#
include
"
parallel_global.h
"
MPI_Comm
POOL_WORLD
;
//
groups for different plane waves. In this group, only plane waves are different. K-points and bands are the same.
MPI_Comm
KP_WORLD
;
//
groups for differnt k. In this group, only k-points are different. Bands and plane waves are the same.
MPI_Comm
BP_WORLD
;
//
groups for differnt bands. In this group, only bands are different. K-points and plane waves are the same.
MPI_Comm
INT_BGROUP
;
//
internal comm groups for same bands. In this group, only bands are the same. K-points and plane waves are different.
MPI_Comm
GRID_WORLD
;
//
mohan add 2012-01-13
MPI_Comm
DIAG_WORLD
;
//
mohan add 2012-01-13
MPICommGroup::MPICommGroup
(MPI_Comm parent_comm)
: parent_comm(parent_comm)
{
MPI_Comm_size
(parent_comm, &
this
->
gsize
);
MPI_Comm_rank
(parent_comm, &
this
->
grank
);
}
MPICommGroup::~MPICommGroup
()
{
if
(group_comm !=
MPI_COMM_NULL
)
{
MPI_Comm_free
(&group_comm);
}
if
(inter_comm !=
MPI_COMM_NULL
)
{
MPI_Comm_free
(&inter_comm);
}
}
void
MPICommGroup::divide_group_comm
(
const
int
& ngroup,
const
bool
assert_even)
{
this
->
ngroups
= ngroup;
Parallel_Global::divide_mpi_groups
(
this
->
gsize
,
ngroup,
this
->
grank
,
this
->
nprocs_in_group
,
this
->
my_group
,
this
->
rank_in_group
,
assert_even);
MPI_Comm_split
(parent_comm, my_group, rank_in_group, &group_comm);
if
(
this
->
gsize
% ngroup ==
0
)
{
this
->
is_even
=
true
;
}
if
(
this
->
is_even
)
{
MPI_Comm_split
(parent_comm, my_inter, rank_in_inter, &inter_comm);
}
}
#
endif
Back
|
FazBrowse Home
|
New Git URL