OpenLB
1.7
Loading...
Searching...
No Matches
src
communication
mpiGroup.hh
Go to the documentation of this file.
1
/* This file is part of the OpenLB library
2
*
3
* Copyright (C) 2022 Adrian Kummerländer, Nicolas Hafen,
4
* Mathias J. Krause
5
* E-mail contact: info@openlb.net
6
* The most recent release of OpenLB can be downloaded at
7
* <http://www.openlb.net/>
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License
11
* as published by the Free Software Foundation; either version 2
12
* of the License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public
20
* License along with this program; if not, write to the Free
21
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22
* Boston, MA 02110-1301, USA.
23
*/
24
25
#ifndef MPI_GROUP_HH
26
#define MPI_GROUP_HH
27
28
#include <stdexcept>
29
30
namespace
olb
{
31
32
// *INDENT-OFF*
33
34
#ifdef PARALLEL_MODE_MPI
35
36
MPI_Group_Wrapper::MPI_Group_Wrapper
()
37
{
38
if
(MPI_Comm_dup(MPI_COMM_WORLD, &_commGroup) != MPI_SUCCESS) {
39
throw
std::runtime_error(
"Unable to duplicate MPI communicator"
);
40
}
41
}
42
43
MPI_Group_Wrapper::~MPI_Group_Wrapper
()
44
{
45
MPI_Comm_free(&_commGroup);
46
}
47
48
MPI_Comm&
MPI_Group_Wrapper::getComm
(){
49
return
_commGroup;
50
}
51
52
#endif
53
54
// *INDENT-ON*
55
56
}
57
58
#endif
olb::MPI_Group_Wrapper::MPI_Group_Wrapper
MPI_Group_Wrapper()
Definition
mpiGroup.hh:36
olb::MPI_Group_Wrapper::~MPI_Group_Wrapper
~MPI_Group_Wrapper()
Definition
mpiGroup.hh:43
olb::MPI_Group_Wrapper::getComm
MPI_Comm & getComm()
Definition
mpiGroup.hh:48
olb
Top level namespace for all of OpenLB.
Definition
boundaryPostProcessors2D.h:34
Generated on Tue Mar 5 2024 09:57:45 for OpenLB by
1.10.0