]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove deprecated variable MultithreadInfo::n_default_threads.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 2 Feb 2015 13:31:37 +0000 (07:31 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 2 Feb 2015 13:31:37 +0000 (07:31 -0600)
doc/doxygen/headers/multithreading.h
doc/news/changes.h
include/deal.II/base/multithread_info.h
source/base/multithread_info.cc
tests/bits/step-13.cc
tests/bits/step-14.cc
tests/fail/hp-step-14.cc
tests/hp/step-13.cc

index 277ae6a38049acaf57c456560ad29178c6bf0484..bf5e29479b5f4176cb05516794d35b1a57c5a05e 100644 (file)
  * 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.
index 7dc0797df135d423282bd429e089a8a74adbf634..c2539cacbb1b08f7151a2b5d2d53b558cbd00849 100644 (file)
@@ -140,6 +140,7 @@ inconvenience this causes.
   - 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>
index ba86c5da366293e3d153827c12554c1b5fd37ac0..b03f566e0467827f8a175fa99d76571260b4b022 100644 (file)
@@ -66,28 +66,6 @@ public:
    */
   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
index d7d0e0221ab0b3c40e508c5b7dffd454c4c0047b..5b7c9d982ac87dc377cb5340e538d9333abb6058 100644 (file)
@@ -157,7 +157,6 @@ bool MultithreadInfo::is_running_single_threaded()
 MultithreadInfo::MultithreadInfo ()
   :
   n_cpus (get_n_cpus()),
-  n_default_threads (n_cpus),
   n_max_threads (numbers::invalid_unsigned_int)
 {}
 
index 3e5ef4abb63783ce288f2951891eaf43879f5a60..d065a6dc37c481e868a38e862a07552d592e770e 100644 (file)
@@ -357,7 +357,7 @@ namespace LaplaceSolver
     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 (),
index f8e910540f678e4dda430a3e8699ac7262736cc4..80c2df07892f54cdb21f0a60f5bf7336f8fd7d54 100644 (file)
@@ -443,7 +443,7 @@ namespace LaplaceSolver
     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 (),
@@ -1684,7 +1684,7 @@ namespace LaplaceSolver
     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
index ca24e24a020f4c5f7738680af5f1ee70686af8a0..faab0e3786f2afc963bf9a4d153bd96f9992456c 100644 (file)
@@ -443,7 +443,7 @@ namespace LaplaceSolver
     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 (),
@@ -1684,7 +1684,7 @@ namespace LaplaceSolver
     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,
index d5179dc58aad2c6fbc406aa4351ae18601b6cde4..cb5882ce557e4a1a3e71478b21eec9aaf9fab5e7 100644 (file)
@@ -357,7 +357,7 @@ namespace LaplaceSolver
     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 (),

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.