Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
multithread_info.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2018 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 DEAL_II_NAMESPACE_OPEN
27 
49 {
50 public:
55  MultithreadInfo() = delete;
56 
66  static unsigned int
67  n_cores();
68 
74  static unsigned int
75  n_threads();
76 
82  static std::size_t
84 
98  static void
100  const unsigned int max_threads = numbers::invalid_unsigned_int);
101 
108  static bool
110 
115  static void
117 
118 private:
124  static unsigned int
125  get_n_cpus();
126 
130  static unsigned int n_max_threads;
131 
136  static const unsigned int n_cpus;
137 };
138 
139 
140 
141 //---------------------------------------------------------------------------
142 DEAL_II_NAMESPACE_CLOSE
143 // end of #ifndef dealii_multithread_info_h
144 #endif
145 //---------------------------------------------------------------------------
static const unsigned int invalid_unsigned_int
Definition: types.h:173
static const unsigned int n_cpus
MultithreadInfo()=delete
static unsigned int n_cores()
static void initialize_multithreading()
static bool is_running_single_threaded()
static unsigned int n_max_threads
static std::size_t memory_consumption()
static void set_thread_limit(const unsigned int max_threads=numbers::invalid_unsigned_int)
static unsigned int n_threads()
static unsigned int get_n_cpus()