Last change
on this file since 1556 was
855,
checked in by mhnguyen, 8 years ago
|
Fixing a bug during compilation on PGI
+) Remove some codes which contain mismatch-type error
Test
+) On Curie with compiler Intel.
+) All tests pass
|
File size:
1.5 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file policy.hpp |
---|
3 | \author Ha NGUYEN |
---|
4 | \since 06 Oct 2015 |
---|
5 | \date 06 Oct 2015 |
---|
6 | |
---|
7 | \brief Some useful policies for templated classes |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef __XIOS_POLICY_HPP__ |
---|
11 | #define __XIOS_POLICY_HPP__ |
---|
12 | |
---|
13 | #include <vector> |
---|
14 | #include "mpi.hpp" |
---|
15 | |
---|
16 | namespace xios |
---|
17 | { |
---|
18 | //class DivideCommByTwo |
---|
19 | //{ |
---|
20 | //protected: |
---|
21 | // void computeMPICommLevel(const MPI_Comm& mpiCommRoot, int levels); |
---|
22 | // |
---|
23 | //protected: |
---|
24 | // std::vector<MPI_Comm> commLevel_; |
---|
25 | //private: |
---|
26 | // // Divide MPI communicator on each level recursively |
---|
27 | // void divideMPICommLevel(const MPI_Comm& mpiCommLevel, int level); |
---|
28 | //}; |
---|
29 | |
---|
30 | class DivideAdaptiveComm |
---|
31 | { |
---|
32 | protected: |
---|
33 | DivideAdaptiveComm(const MPI_Comm& mpiComm); |
---|
34 | |
---|
35 | void computeMPICommLevel(); |
---|
36 | const std::vector<int>& getGroupBegin() { return groupBegin_; } |
---|
37 | const std::vector<int>& getNbInGroup() { return nbInGroup_; } |
---|
38 | const std::vector<std::vector<int> >& getGroupParentsBegin() { return groupParentsBegin_; } |
---|
39 | const std::vector<std::vector<int> >& getNbInGroupParents() { return nbInGroupParents_; } |
---|
40 | int getNbLevel() { return level_; } |
---|
41 | |
---|
42 | protected: |
---|
43 | const MPI_Comm& internalComm_; |
---|
44 | std::vector<std::vector<int> > groupParentsBegin_; |
---|
45 | std::vector<std::vector<int> > nbInGroupParents_; |
---|
46 | |
---|
47 | int level_; |
---|
48 | std::vector<int> groupBegin_; //! Rank beginning of a group |
---|
49 | std::vector<int> nbInGroup_; //! Number of process in each group |
---|
50 | bool computed_; |
---|
51 | // std::vector<std::vector<int> > child_; /*!< List of child rank for each level */ |
---|
52 | // std::vector<int> nbChild_; /*!< Number of child for each level */ |
---|
53 | }; |
---|
54 | |
---|
55 | } |
---|
56 | |
---|
57 | #endif // __XIOS_POLICY_HPP__ |
---|
Note: See
TracBrowser
for help on using the repository browser.