Reference documentation for deal.II version GIT relicensing-437-g81ec864850 2024-04-19 07:30:02+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
multithread_info.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2000 - 2021 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_multithread_info_h
16# define dealii_multithread_info_h
17//---------------------------------------------------------------------------
18
19
20# include <deal.II/base/config.h>
21
23# include <deal.II/base/types.h>
24
25# include <memory>
26
27# ifdef DEAL_II_WITH_TASKFLOW
28// forward declaration from <taskflow/taskflow.hpp>
29namespace tf
30{
31 class Executor;
32}
33# endif
34
35
37
58{
59public:
64 MultithreadInfo() = delete;
65
73 static unsigned int
74 n_cores();
75
81 static unsigned int
82 n_threads();
83
89 static std::size_t
91
105 static void
107 const unsigned int max_threads = numbers::invalid_unsigned_int);
108
115 static bool
117
122 static void
124
125
126# ifdef DEAL_II_WITH_TASKFLOW
134 static tf::Executor &
136# endif
137
138private:
142 static unsigned int n_max_threads;
143
144# ifdef DEAL_II_WITH_TASKFLOW
149 static std::unique_ptr<tf::Executor> executor;
150# endif
151};
152
153
154
155//---------------------------------------------------------------------------
157// end of #ifndef dealii_multithread_info_h
158#endif
159//---------------------------------------------------------------------------
static unsigned int n_max_threads
MultithreadInfo()=delete
static bool is_running_single_threaded()
static std::unique_ptr< tf::Executor > executor
static void initialize_multithreading()
static unsigned int n_cores()
static unsigned int n_threads()
static void set_thread_limit(const unsigned int max_threads=numbers::invalid_unsigned_int)
static std::size_t memory_consumption()
static tf::Executor & get_taskflow_executor()
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
static const unsigned int invalid_unsigned_int
Definition types.h:220