Reference documentation for deal.II version 9.3.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\}}\)
multithread_info.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2020 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_multithread_info_h
17 # define dealii_multithread_info_h
18 //---------------------------------------------------------------------------
19 
20 
21 # include <deal.II/base/config.h>
22 
23 # include <deal.II/base/exceptions.h>
24 # include <deal.II/base/types.h>
25 
26 # include <memory>
27 
28 // forward declaration from <taskflow/taskflow.hpp>
29 namespace tf
30 {
31  class Executor;
32 }
33 
35 
56 {
57 public:
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
104  set_thread_limit(
105  const unsigned int max_threads = numbers::invalid_unsigned_int);
106 
113  static bool
114  is_running_single_threaded();
115 
120  static void
121  initialize_multithreading();
122 
123 
124 private:
128  static unsigned int n_max_threads;
129 };
130 
131 
132 
133 //---------------------------------------------------------------------------
135 // end of #ifndef dealii_multithread_info_h
136 #endif
137 //---------------------------------------------------------------------------
static const unsigned int invalid_unsigned_int
Definition: types.h:196
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:395
static unsigned int n_max_threads
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:394
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)