Reference documentation for deal.II version 9.6.0
\(\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// Copyright (C) 2023 - 2024 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE.md at
12// the top level directory of deal.II.
13//
14// ---------------------------------------------------------------------
15
16#ifndef dealii_init_finalize_h
17#define dealii_init_finalize_h
18
19#include <deal.II/base/config.h>
20
23
24#include <boost/signals2.hpp>
25
26#include <set>
27
29
35{
39 None = 0,
43 MPI = 1,
47 Kokkos = 2,
51 SLEPc = 4,
55 PETSc = 8,
59 Zoltan = 16,
63 P4EST = 32
64};
65
66
67
74{
75 return static_cast<InitializeLibrary>(static_cast<unsigned int>(f1) |
76 static_cast<unsigned int>(f2));
77}
78
79
80
87{
88 return static_cast<InitializeLibrary>(static_cast<unsigned int>(f1) &
89 static_cast<unsigned int>(f2));
90}
91
92
93
99{
100public:
125 int &argc,
126 char **&argv,
128 const unsigned int max_num_threads = numbers::invalid_unsigned_int);
129
135
140 void
141 finalize();
142
169 static void
170 register_request(MPI_Request &request);
171
175 static void
176 unregister_request(MPI_Request &request);
177
185 struct Signals
186 {
191 boost::signals2::signal<void()> at_mpi_init;
192
199 boost::signals2::signal<void()> at_mpi_finalize;
200 };
201
203
204private:
206
210 static std::set<MPI_Request *> requests;
211
212 bool is_finalized = false;
213
214#ifdef DEAL_II_WITH_PETSC
216#endif
217};
218
220
221#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
InitFinalize(int &argc, char **&argv, const InitializeLibrary &libraries, const unsigned int max_num_threads=numbers::invalid_unsigned_int)
static Signals signals
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
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