@@ -13,30 +13,33 @@ extern MPI_Comm DIAG_WORLD; // mohan add 2012-01-13
1313
1414class MPICommGroup
1515{
16- public:
17- MPICommGroup (MPI_Comm parent_comm);
18- ~MPICommGroup ();
19- void divide_group_comm (const int & ngroup, const bool assert_even = true );
20- public:
21- bool is_even = false ; // /< whether the group is even
22-
23- MPI_Comm parent_comm = MPI_COMM_NULL; // /< parent communicator
24- int gsize = 0 ; // /< size of parent communicator
25- int grank = 0 ; // /< rank of parent communicator
26-
27- MPI_Comm group_comm = MPI_COMM_NULL; // /< group communicator
28- int ngroups = 0 ; // /< number of groups
29- int nprocs_in_group = 0 ; // /< number of processes in the group
30- int my_group = 0 ; // /< the group index
31- int rank_in_group = 0 ; // /< the rank in the group
32-
33- MPI_Comm inter_comm = MPI_COMM_NULL; // /< inter communicator
34- bool has_inter_comm = false ; // /< whether has inter communicator
35- int & nprocs_in_inter = ngroups; // /< number of processes in the inter communicator
36- int & my_inter = rank_in_group; // /< the rank in the inter communicator
37- int & rank_in_inter = my_group; // /< the inter group index
16+
17+ public:
18+
19+ MPICommGroup (MPI_Comm parent_comm);
20+ ~MPICommGroup ();
21+
22+ void divide_group_comm (const int & ngroup, const bool assert_even = true );
23+
24+ bool is_even = false ; // /< whether the group is even
25+
26+ MPI_Comm parent_comm = MPI_COMM_NULL; // /< parent communicator
27+ int gsize = 0 ; // /< size of parent communicator
28+ int grank = 0 ; // /< rank of parent communicator
29+
30+ MPI_Comm group_comm = MPI_COMM_NULL; // /< group communicator
31+ int ngroups = 0 ; // /< number of groups
32+ int nprocs_in_group = 0 ; // /< number of processes in the group
33+ int my_group = 0 ; // /< the group index
34+ int rank_in_group = 0 ; // /< the rank in the group
35+
36+ MPI_Comm inter_comm = MPI_COMM_NULL; // /< inter communicator
37+ bool has_inter_comm = false ; // /< whether has inter communicator
38+ int & nprocs_in_inter = ngroups; // /< number of processes in the inter communicator
39+ int & my_inter = rank_in_group; // /< the rank in the inter communicator
40+ int & rank_in_inter = my_group; // /< the inter group index
3841};
3942
4043#endif
4144
42- #endif // PARALLEL_COMM_H
45+ #endif // PARALLEL_COMM_H
0 commit comments