deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+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: Apache-2.0 WITH LLVM-exception OR 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// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_multithread_info_h
14# define dealii_multithread_info_h
15//---------------------------------------------------------------------------
16
17
18# include <deal.II/base/config.h>
19
21# include <deal.II/base/types.h>
22
23# include <memory>
24
25# ifdef DEAL_II_WITH_TASKFLOW
26// forward declaration from <taskflow/taskflow.hpp>
27namespace tf
28{
29 class Executor;
30}
31# endif
32
33
35
56{
57public:
62 MultithreadInfo() = delete;
63
71 static unsigned int
72 n_cores();
73
79 static unsigned int
80 n_threads();
81
87 static std::size_t
89
103 static void
105 const unsigned int max_threads = numbers::invalid_unsigned_int);
106
113 static bool
115
120 static void
122
123
124# ifdef DEAL_II_WITH_TASKFLOW
132 static tf::Executor &
134# endif
135
136private:
140 static unsigned int n_max_threads;
141
142# ifdef DEAL_II_WITH_TASKFLOW
147 static std::unique_ptr<tf::Executor> executor;
148# endif
149};
150
151
152
153//---------------------------------------------------------------------------
155// end of #ifndef dealii_multithread_info_h
156#endif
157//---------------------------------------------------------------------------
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:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
constexpr unsigned int invalid_unsigned_int
Definition types.h:228