Last change
on this file since 778 was
694,
checked in by rlacroix, 9 years ago
|
Fix compilation issues caused by the new "remap" library.
Use our MPI header so that C++ bindings are always disabled.
|
File size:
912 bytes
|
Line | |
---|
1 | #ifndef __MPI_CASCADE_HPP__ |
---|
2 | #define __MPI_CASCADE_HPP__ |
---|
3 | |
---|
4 | #include "mpi.hpp" |
---|
5 | #include <vector> |
---|
6 | #include <cassert> |
---|
7 | #include "misc.hpp" |
---|
8 | |
---|
9 | namespace sphereRemap { |
---|
10 | |
---|
11 | class CCascadeLevel |
---|
12 | { |
---|
13 | public: |
---|
14 | CCascadeLevel(MPI_Comm comm) : comm(comm) |
---|
15 | { |
---|
16 | MPI_Comm_size(comm, &size); |
---|
17 | MPI_Comm_rank(comm, &rank); |
---|
18 | } |
---|
19 | int colour() const { return rank % group_size; }; |
---|
20 | int key() const { return p_colour() + rank/(p_grp_size*group_size)*p_grp_size; } |
---|
21 | |
---|
22 | // perpendicular group |
---|
23 | int p_colour() const { return (rank%group_size + rank/group_size) % p_grp_size; } |
---|
24 | int p_key() const { return colour() + rank/(p_grp_size*group_size)*group_size; } |
---|
25 | |
---|
26 | MPI_Comm comm, pg_comm; |
---|
27 | int rank; |
---|
28 | int size; |
---|
29 | int group_size; // group_size and p_grp_size are interchanged?? FIXME |
---|
30 | int p_grp_size; |
---|
31 | }; |
---|
32 | |
---|
33 | class CMPICascade |
---|
34 | { |
---|
35 | public: |
---|
36 | // |
---|
37 | CMPICascade(int nodes_per_level, MPI_Comm comm); |
---|
38 | |
---|
39 | int num_levels; |
---|
40 | std::vector<CCascadeLevel> level; |
---|
41 | }; |
---|
42 | |
---|
43 | } |
---|
44 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.