ThunderEgg  1.0.0
Communicator.h
Go to the documentation of this file.
1 /***************************************************************************
2  * ThunderEgg, a library for solvers on adaptively refined block-structured
3  * Cartesian grids.
4  *
5  * Copyright (c) 2021 Scott Aiton
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <https://www.gnu.org/licenses/>.
19  ***************************************************************************/
20 
21 #ifndef THUNDEREGG_COMMUNICATOR_H
22 #define THUNDEREGG_COMMUNICATOR_H
23 
29 #include <mpi.h>
30 
31 namespace ThunderEgg {
37 {
38 private:
42  MPI_Comm comm = MPI_COMM_NULL;
43 
44 public:
48  Communicator() = default;
52  ~Communicator();
58  Communicator(const Communicator& other);
65  Communicator& operator=(const Communicator& other);
66  Communicator(Communicator&& other);
73  explicit Communicator(MPI_Comm comm);
79  MPI_Comm getMPIComm() const;
85  int getSize() const;
91  int getRank() const;
92 };
93 } // namespace ThunderEgg
94 #endif
RuntimeError.h
RuntimeError struct.
ThunderEgg::Communicator::~Communicator
~Communicator()
Destroy the Communicator object.
ThunderEgg::Communicator::getMPIComm
MPI_Comm getMPIComm() const
Get the raw MPI_Comm object.
ThunderEgg::Communicator::Communicator
Communicator()=default
Construct a new Communicator with a null communicator.
ThunderEgg::Communicator::getRank
int getRank() const
Get the rank of this processor.
ThunderEgg
The ThunderEgg namespace.
Definition: BiLinearGhostFiller.h:31
ThunderEgg::Communicator::getSize
int getSize() const
Get the size of the communicator.
ThunderEgg::Communicator
wrapper arount MPI_Comm, provides proper copy operators. Classes that have a communicator are meant t...
Definition: Communicator.h:36
ThunderEgg::Communicator::operator=
Communicator & operator=(const Communicator &other)
Copy the communcator object.