deal.II version GIT relicensing-2306-ga6fff1538f 2024-12-29 17:30:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
init_finalize.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2023 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_init_finalize_h
16#define dealii_init_finalize_h
17
18#include <deal.II/base/config.h>
19
22
23#include <boost/signals2.hpp>
24
25#include <set>
26
28
34{
38 None = 0,
42 MPI = 1,
46 Kokkos = 2,
50 SLEPc = 4,
54 PETSc = 8,
58 Zoltan = 16,
62 P4EST = 32
63};
64
65
66
73{
74 return static_cast<InitializeLibrary>(static_cast<unsigned int>(f1) |
75 static_cast<unsigned int>(f2));
76}
77
78
79
86{
87 return static_cast<InitializeLibrary>(static_cast<unsigned int>(f1) &
88 static_cast<unsigned int>(f2));
89}
90
91
92
98{
99public:
124 int &argc,
125 char **&argv,
127 const unsigned int max_num_threads = numbers::invalid_unsigned_int);
128
134
139 void
140 finalize();
141
168 static void
169 register_request(MPI_Request &request);
170
174 static void
175 unregister_request(MPI_Request &request);
176
184 struct Signals
185 {
190 boost::signals2::signal<void()> at_mpi_init;
191
198 boost::signals2::signal<void()> at_mpi_finalize;
199 };
200
202
203private:
205
209 static std::set<MPI_Request *> requests;
210
211 bool is_finalized = false;
212
213#ifdef DEAL_II_WITH_PETSC
215#endif
216};
217
219
220#endif
InitializeLibrary libraries
static void unregister_request(MPI_Request &request)
static void register_request(MPI_Request &request)
static std::set< MPI_Request * > requests
bool finalize_petscslepc
static Signals signals
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
InitializeLibrary operator|(const InitializeLibrary f1, const InitializeLibrary f2)
InitializeLibrary operator&(const InitializeLibrary f1, const InitializeLibrary f2)
InitializeLibrary
static const unsigned int invalid_unsigned_int
Definition types.h:220
boost::signals2::signal< void()> at_mpi_init
boost::signals2::signal< void()> at_mpi_finalize