Reference documentation for deal.II version 8.5.1
multithread_info.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2000 - 2016 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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/base/types.h>
23 #include <deal.II/base/exceptions.h>
24 
25 DEAL_II_NAMESPACE_OPEN
26 
48 {
49 public:
59  static unsigned int n_cores ();
60 
66  static unsigned int n_threads ();
67 
73  static std::size_t memory_consumption ();
74 
88  static void set_thread_limit (const unsigned int max_threads = numbers::invalid_unsigned_int);
89 
96  static bool is_running_single_threaded ();
97 
98 private:
99 
100 
105  MultithreadInfo ();
106 
112  static unsigned int get_n_cpus ();
113 
117  static unsigned int n_max_threads;
118 
123  static const unsigned int n_cpus;
124 };
125 
126 
127 
128 //---------------------------------------------------------------------------
129 DEAL_II_NAMESPACE_CLOSE
130 // end of #ifndef dealii__multithread_info_h
131 #endif
132 //---------------------------------------------------------------------------
static const unsigned int invalid_unsigned_int
Definition: types.h:170
static const unsigned int n_cpus
static unsigned int n_cores()
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()