Changeset ac6d04 for src/comm/mpi/key.hpp
- Timestamp:
- Apr 10, 2012, 1:55:49 PM (14 years ago)
- Children:
- a40eea
- Parents:
- d24c2f
- File:
-
- 1 edited
-
src/comm/mpi/key.hpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/comm/mpi/key.hpp
rd24c2f rac6d04 33 33 public: 34 34 KeyStorage(const Grid& grid) : 35 begin(grid.Global(). BeginLocal()),36 end(grid.Global(). EndLocal()),35 begin(grid.Global().LocalBegin()), 36 end(grid.Global().LocalEnd()), 37 37 size_local(grid.Local().SizeTotal()), 38 size_global(grid.Global().SizeGlobal()) 38 size_global(grid.Global().GlobalSize()), 39 level(grid.Level()) 39 40 {} 40 41 41 KeyStorage(const Index& begin, const Index& end, const Index& size_local, const Index& size_global) : 42 KeyStorage(const Index& begin, const Index& end, 43 const Index& size_local, const Index& size_global, 44 const int& level) : 42 45 begin(begin), 43 46 end(end), 44 47 size_local(size_local), 45 size_global(size_global) 48 size_global(size_global), 49 level(level) 46 50 {} 47 51 … … 50 54 end(other.end), 51 55 size_local(other.size_local), 52 size_global(other.size_global) 56 size_global(other.size_global), 57 level(other.level) 53 58 {} 54 59 … … 60 65 this->end == other.end && 61 66 this->size_local == other.size_local && 62 this->size_global == other.size_global; 67 this->size_global == other.size_global && 68 this->level == other.level; 63 69 } 64 70 … … 71 77 { 72 78 if (this->begin < other.begin) return true; 73 else if (this->begin != other.begin) return false; 74 else if (this->end < other.end) return true; 75 else if (this->end != other.end) return false; 76 else if (this->size_local < other.size_local) return true; 77 else if (this->size_local != other.size_local) return false; 78 else if (this->size_global < other.size_global) return true; 79 else return false; 79 if (this->begin != other.begin) return false; 80 if (this->end < other.end) return true; 81 if (this->end != other.end) return false; 82 if (this->size_local < other.size_local) return true; 83 if (this->size_local != other.size_local) return false; 84 if (this->size_global < other.size_global) return true; 85 if (this->size_global != other.size_global) return false; 86 if (this->level < other.level) return true; 87 return false; 80 88 } 81 89 82 90 private: 83 91 const Index begin, end, size_local, size_global; 84 const void* ptr;92 const int level; 85 93 }; 86 94 … … 107 115 } 108 116 109 KeySorted(const Index& begin, const Index& end, const Index& size_local, const Index& size_global) 110 { 111 keys.push_back(KeyStorage(begin, end, size_local, size_global)); 117 KeySorted(const Index& begin, const Index& end, 118 const Index& size_local, const Index& size_global, 119 const int& level) 120 { 121 keys.push_back(KeyStorage(begin, end, size_local, size_global, level)); 112 122 } 113 123 … … 134 144 }; 135 145 146 147 /* 148 * direction: 0 - from multigrid to temporary grid 149 * 1 - from temporary grid to multigrid 150 * for single grid datatypes always 0 151 */ 136 152 class KeyUnsorted { 137 153 public: … … 142 158 for (i=other.keys.begin(); i!=other.keys.end(); ++i) 143 159 this->keys.push_back(*i); 144 } 145 146 KeyUnsorted(const Grid& grid) 160 this->direction = other.direction; 161 } 162 163 KeyUnsorted(const Grid& grid, const int& direction) 147 164 { 148 165 keys.push_back(KeyStorage(grid)); 149 } 150 151 KeyUnsorted(const Grid& grid_1, const Grid& grid_2) 166 this->direction = direction; 167 } 168 169 KeyUnsorted(const Grid& grid_1, const Grid& grid_2, const int& direction) 152 170 { 153 171 keys.push_back(KeyStorage(grid_1)); 154 172 keys.push_back(KeyStorage(grid_2)); 155 } 156 157 KeyUnsorted(const Index& begin, const Index& end, const Index& size_local, const Index& size_global) 158 { 159 keys.push_back(KeyStorage(begin, end, size_local, size_global)); 173 this->direction = direction; 174 } 175 176 KeyUnsorted(const Index& begin, const Index& end, 177 const Index& size_local, const Index& size_global, 178 const int& level, const int& direction) 179 { 180 keys.push_back(KeyStorage(begin, end, size_local, size_global, level)); 181 this->direction = direction; 160 182 } 161 183 … … 175 197 } 176 198 199 if (this->direction < other.direction) return true; 200 177 201 return false; 178 202 } … … 180 204 private: 181 205 std::list<KeyStorage> keys; 206 int direction; 182 207 }; 183 208
Note:
See TracChangeset
for help on using the changeset viewer.
