* that there are no other libraries starting threads.
*
* Note that a small number of places inside deal.II also uses thread-based
- * parallelism controlled by MultithreadInfo::n_default_threads
- * generally. Under some circumstances, deal.II also calls the BLAS library
+ * parallelism explicitly, for example for running background tasks that have
+ * to wait for input or output to happen and consequently do not consume
+ * much CPU time. Such threads do not run under the control of the TBB
+ * task scheduler and, therefore, are not affected by the procedure above.
+ * Under some circumstances, deal.II also calls the BLAS library
* which may sometimes also start threads of its own. You will have to consult
* the documentation of your BLAS installation to determine how to set the
* number of threads for these operations.
- The MPI support functions in namespace Utilities and Utilities::System.
- Deprecated members of namespace types.
- Namespace deal_II_numbers.
+ - MultithreadInfo::n_default_threads.
<br>
<em>With headers in <code>deal.II/lac/</code>:</em>
*/
const unsigned int n_cpus;
- /**
- * The number of threads to use as a default value for all functions that
- * support multithreading. At start time this is <tt>n_cpus</tt> or one, if
- * detection of the number of CPUs is not possible.
- *
- * This variable used to be the mechanism by which many parts of the library
- * determined how many threads to use, for example when assembling matrices
- * in MatrixCreator or generating output in DataOut. To this end,
- * n_default_threads is set to n_cpus at the start of the program, but used
- * programs could set it to a different value in their main() function.
- * However, since almost all of deal.II has now been converted to a task-
- * based parallelism model, this variable is no longer used in the library.
- * Instead, the task scheduling methods use the n_threads() function as a
- * guide to how many threads to use, and the current variable is now
- * deprecated.
- *
- * @deprecated: Use n_threads() to query the number of threads to use (if
- * you wanted to read this variable), and set_thread_limit() to limit it (if
- * you wanted to write to it).
- */
- unsigned int n_default_threads DEAL_II_DEPRECATED;
-
/**
* Returns the number of threads to use. This is initially set to the number
* of cores the system has (n_cpus) but can be further restricted by
MultithreadInfo::MultithreadInfo ()
:
n_cpus (get_n_cpus()),
- n_default_threads (n_cpus),
n_max_threads (numbers::invalid_unsigned_int)
{}
typename DoFHandler<dim>::active_cell_iterator
active_cell_iterator;
- const unsigned int n_threads = multithread_info.n_default_threads;
+ const unsigned int n_threads = multithread_info.n_threads();
std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
thread_ranges
= Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
typename DoFHandler<dim>::active_cell_iterator
active_cell_iterator;
- const unsigned int n_threads = multithread_info.n_default_threads;
+ const unsigned int n_threads = multithread_info.n_threads();
std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
thread_ranges
= Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
error_indicators.reinit (dual_solver.dof_handler
.get_tria().n_active_cells());
- const unsigned int n_threads = multithread_info.n_default_threads;
+ const unsigned int n_threads = multithread_info.n_threads();
for (unsigned int i=0; i<n_threads; ++i)
{
estimate_some
typename hp::DoFHandler<dim>::active_cell_iterator
active_cell_iterator;
- const unsigned int n_threads = multithread_info.n_default_threads;
+ const unsigned int n_threads = multithread_info.n_threads();
std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
thread_ranges
= Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),
error_indicators.reinit (dual_solver.dof_handler
.get_tria().n_active_cells());
- const unsigned int n_threads = multithread_info.n_default_threads;
+ const unsigned int n_threads = multithread_info.n_threads();
Threads::ThreadGroup<> threads;
for (unsigned int i=0; i<n_threads; ++i)
threads += Threads::new_thread (&WeightedResidual<dim>::estimate_some, *this,
typename hp::DoFHandler<dim>::active_cell_iterator
active_cell_iterator;
- const unsigned int n_threads = multithread_info.n_default_threads;
+ const unsigned int n_threads = multithread_info.n_threads();
std::vector<std::pair<active_cell_iterator,active_cell_iterator> >
thread_ranges
= Threads::split_range<active_cell_iterator> (dof_handler.begin_active (),