| Line | |
|---|
| 1 | #ifndef DATATYPES_LOCAL_HPP_
|
|---|
| 2 | #define DATATYPES_LOCAL_HPP_
|
|---|
| 3 |
|
|---|
| 4 | #include <vector>
|
|---|
| 5 |
|
|---|
| 6 | #include "comm/mpi/datatype.hpp"
|
|---|
| 7 |
|
|---|
| 8 | namespace VMG
|
|---|
| 9 | {
|
|---|
| 10 |
|
|---|
| 11 | class Grid;
|
|---|
| 12 |
|
|---|
| 13 | namespace Particle
|
|---|
| 14 | {
|
|---|
| 15 | class LinkedCellList;
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | namespace MPI
|
|---|
| 19 | {
|
|---|
| 20 |
|
|---|
| 21 | class DatatypesLocal
|
|---|
| 22 | {
|
|---|
| 23 | public:
|
|---|
| 24 | DatatypesLocal(const Grid& grid, const MPI_Comm& comm)
|
|---|
| 25 | {
|
|---|
| 26 | InitDatatypesLocal(grid, comm, true);
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | DatatypesLocal(const VMG::Particle::LinkedCellList& grid, const MPI_Comm& comm)
|
|---|
| 30 | {
|
|---|
| 31 | InitDatatypesLocal(grid, comm, false);
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 | ~DatatypesLocal() {}
|
|---|
| 35 |
|
|---|
| 36 | std::vector<Datatype>& Halo() {return _halo;}
|
|---|
| 37 | std::vector<Datatype>& NB() {return _nb;}
|
|---|
| 38 |
|
|---|
| 39 | const std::vector<Datatype>& Halo() const {return _halo;}
|
|---|
| 40 | const std::vector<Datatype>& NB() const {return _nb;}
|
|---|
| 41 |
|
|---|
| 42 | const std::vector<Index>& Offset() const {return _offset;}
|
|---|
| 43 |
|
|---|
| 44 | private:
|
|---|
| 45 | template <class T>
|
|---|
| 46 | void InitDatatypesLocal(const T& grid, const MPI_Comm& comm, const bool& alloc_buffer);
|
|---|
| 47 |
|
|---|
| 48 | std::vector<Datatype> _halo, _nb;
|
|---|
| 49 | std::vector<Index> _offset;
|
|---|
| 50 | };
|
|---|
| 51 |
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | }
|
|---|
| 55 |
|
|---|
| 56 | #endif /* DATATYPES_LOCAL_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.