Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
55 lines (47 loc) · 1.79 KB

File metadata and controls

55 lines (47 loc) · 1.79 KB
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.