| 1 | /*
|
|---|
| 2 | * vmg - a versatile multigrid solver
|
|---|
| 3 | * Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
|
|---|
| 4 | *
|
|---|
| 5 | * vmg is free software: you can redistribute it and/or modify
|
|---|
| 6 | * it under the terms of the GNU General Public License as published by
|
|---|
| 7 | * the Free Software Foundation, either version 3 of the License, or
|
|---|
| 8 | * (at your option) any later version.
|
|---|
| 9 | *
|
|---|
| 10 | * vmg is distributed in the hope that it will be useful,
|
|---|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 13 | * GNU General Public License for more details.
|
|---|
| 14 | *
|
|---|
| 15 | * You should have received a copy of the GNU General Public License
|
|---|
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | /**
|
|---|
| 20 | * @file datatypes_global.hpp
|
|---|
| 21 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 22 | * @date Mon Jan 2 18:45:22 2012
|
|---|
| 23 | *
|
|---|
| 24 | * @brief Saves MPI datatypes for global grid communication.
|
|---|
| 25 | *
|
|---|
| 26 | */
|
|---|
| 27 |
|
|---|
| 28 | #ifndef DATATYPES_GLOBAL_HPP_
|
|---|
| 29 | #define DATATYPES_GLOBAL_HPP_
|
|---|
| 30 |
|
|---|
| 31 | #include <vector>
|
|---|
| 32 |
|
|---|
| 33 | #include "comm/mpi/datatype.hpp"
|
|---|
| 34 |
|
|---|
| 35 | namespace VMG
|
|---|
| 36 | {
|
|---|
| 37 |
|
|---|
| 38 | namespace MPI
|
|---|
| 39 | {
|
|---|
| 40 |
|
|---|
| 41 | class DatatypesGlobal
|
|---|
| 42 | {
|
|---|
| 43 | public:
|
|---|
| 44 | DatatypesGlobal() {}
|
|---|
| 45 | ~DatatypesGlobal() {}
|
|---|
| 46 |
|
|---|
| 47 | typedef std::vector<Datatype>::iterator iterator;
|
|---|
| 48 | typedef std::vector<Datatype>::const_iterator const_iterator;
|
|---|
| 49 | typedef std::vector<Datatype>::reverse_iterator reverse_iterator;
|
|---|
| 50 | typedef std::vector<Datatype>::const_reverse_iterator const_reverse_iterator;
|
|---|
| 51 |
|
|---|
| 52 | std::vector<Datatype>& Send() {return send;}
|
|---|
| 53 | const std::vector<Datatype>& Send() const {return send;}
|
|---|
| 54 |
|
|---|
| 55 | std::vector<Datatype>& Receive() {return recv;}
|
|---|
| 56 | const std::vector<Datatype>& Receive() const {return recv;}
|
|---|
| 57 |
|
|---|
| 58 | std::string ToString() const;
|
|---|
| 59 |
|
|---|
| 60 | private:
|
|---|
| 61 | std::vector<Datatype> send, recv;
|
|---|
| 62 | };
|
|---|
| 63 |
|
|---|
| 64 | std::ostream& operator<<(std::ostream& out, const DatatypesGlobal& dt_global);
|
|---|
| 65 |
|
|---|
| 66 | }
|
|---|
| 67 |
|
|---|
| 68 | }
|
|---|
| 69 |
|
|---|
| 70 | #endif /* DATATYPES_GLOBAL_HPP_ */
|
|---|