Public Member Functions | |
| MultithreadInfo () | |
Static Public Member Functions | |
| static std::size_t | memory_consumption () |
| ::ExceptionBase & | ExcProcNotPresent () |
Public Attributes | |
| const unsigned int | n_cpus |
| unsigned int | n_default_threads |
Static Private Member Functions | |
| static unsigned int | get_n_cpus () |
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. Currently the library supports both thread-based and task-based parallelism. Parallel computing with multiple processors accessing shared memory describes the different uses of each. Thread-based parallel methods will use the member variable n_default_threads of this class as a guide to the 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. The default number of threads used for task-based parallel methods is selected automatically by the Threading Building Blocks library. See Parallel computing with multiple processors accessing shared memory for more information on this.
Definition at line 40 of file multithread_info.h.
| 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.
| static std::size_t 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.
| ::ExceptionBase& MultithreadInfo::ExcProcNotPresent | ( | ) | [static] |
Exception
| 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.
| const unsigned int MultithreadInfo::n_cpus |
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.
Definition at line 70 of file multithread_info.h.
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.
Definition at line 80 of file multithread_info.h.
documentation generated on Fri Feb 3 2012 06:04:10 by
doxygen
1.7.2