MultithreadInfo Class Reference
[Multithreading]

List of all members.

Classes

class  ExcProcNotPresent

Public Member Functions

 MultithreadInfo ()

Static Public Member Functions

static unsigned int memory_consumption ()

Public Attributes

const unsigned int n_cpus
unsigned int n_default_threads

Static Private Member Functions

static unsigned int get_n_cpus ()

Detailed Description

This class provides information about the system which may be of use in multithreaded programs. At the moment this is just the number of cpus. If deal.II is compiled with multithreading support, some functions will use multiple threads for their action, and will use the member variable n_default_threads of this class as the default number of threads to start. This variable n_default_threads is set to the number of CPUs by default, but can be adjusted by the user to fit the requirements.

Author:
Thomas Richter, Wolfgang Bangerth, 2000

Constructor & Destructor Documentation

MultithreadInfo::MultithreadInfo (  ) 

The constructor determines the number of CPUs in the system. At the moment detection of CPUs is only implemented on Linux computers with the /proc filesystem and on Sun machines. The number of CPUs present is set to one if detection failed or if detection is not supported.


Member Function Documentation

static unsigned int MultithreadInfo::memory_consumption (  )  [static]

Determine an estimate for the memory consumption (in bytes) of this object. Since sometimes the size of objects can not be determined exactly (for example: what is the memory consumption of an STL std::map type with a certain number of elements?), this is only an estimate. however often quite close to the true value.

static unsigned int MultithreadInfo::get_n_cpus (  )  [static, private]

Private function to determine the number of CPUs. Implementation for Linux, OSF, SGI, and Sun machines; if no detection of the number of CPUs is supported, or if detection fails, this function returns one.


Member Data Documentation

The number of CPUs in the system. It is one if detection is not implemented or failed.

If it is one, although you are on a multi-processor machine, please refer to the documentation in multithread_info.cc near to the error directive.

The number of threads to use as a default value for all functions that support multithreading. At start time this is n_cpus or one, if detection of the number of CPUs is not possible.


The documentation for this class was generated from the following file:

deal.II documentation generated on Mon Nov 23 22:57:58 2009 by doxygen 1.6.1