Reference documentation for deal.II version 9.0.0
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 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:
54  MultithreadInfo () = delete;
55 
65  static unsigned int n_cores ();
66 
72  static unsigned int n_threads ();
73 
79  static std::size_t memory_consumption ();
80 
94  static void set_thread_limit (const unsigned int max_threads = numbers::invalid_unsigned_int);
95 
102  static bool is_running_single_threaded ();
103 
107  static void initialize_multithreading ();
108 
109 private:
110 
116  static unsigned int get_n_cpus ();
117 
121  static unsigned int n_max_threads;
122 
127  static const unsigned int n_cpus;
128 };
129 
130 
131 
132 //---------------------------------------------------------------------------
133 DEAL_II_NAMESPACE_CLOSE
134 // end of #ifndef dealii_multithread_info_h
135 #endif
136 //---------------------------------------------------------------------------
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()