Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
multithread_info.h
1 // ---------------------------------------------------------------------
2 // @f$Id: multithread_info.h 31076 2013-10-02 17:52:30Z heister @f$
3 //
4 // Copyright (C) 2000 - 2013 by the deal.II authors
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 #ifndef __deal2__multithread_info_h
18 #define __deal2__multithread_info_h
19 //---------------------------------------------------------------------------
20 
21 
22 #include <deal.II/base/config.h>
23 #include <deal.II/base/types.h>
25 
27 
51 {
52 public:
65  MultithreadInfo ();
66 
80  const unsigned int n_cpus;
81 
92  unsigned int n_default_threads DEAL_II_DEPRECATED;
93 
94  /*
95  * Returns the number of threads to use. This is governed by the number
96  * of cores the system has (n_cpus) and can be further restricted by
97  * set_thread_limit().
98  */
99  unsigned int n_threads() const;
100 
117  static std::size_t memory_consumption ();
118 
131  void set_thread_limit(const unsigned int max_threads = numbers::invalid_unsigned_int);
132 
133 
144  DeclException0(ExcProcNotPresent);
145 
146 private:
147 
158  static unsigned int get_n_cpus();
159 
163  unsigned int n_max_threads;
164 };
165 
166 
167 
176 
177 
178 
179 
180 //---------------------------------------------------------------------------
181 DEAL_II_NAMESPACE_CLOSE
182 // end of #ifndef __deal2__multithread_info_h
183 #endif
184 //---------------------------------------------------------------------------
static const unsigned int invalid_unsigned_int
Definition: types.h:191
const unsigned int n_cpus
DeclException0(ExcProcNotPresent)
static std::size_t memory_consumption()
bool is_running_single_threaded()
unsigned int n_max_threads
static unsigned int get_n_cpus()
unsigned int n_default_threads DEAL_II_DEPRECATED
void set_thread_limit(const unsigned int max_threads=numbers::invalid_unsigned_int)
MultithreadInfo multithread_info