]> https://gitweb.dealii.org/ - dealii.git/commitdiff
more multithread_info deprecation fixes
authorTimo Heister <timo.heister@gmail.com>
Tue, 17 Feb 2015 11:12:46 +0000 (06:12 -0500)
committerTimo Heister <timo.heister@gmail.com>
Tue, 17 Feb 2015 11:14:45 +0000 (06:14 -0500)
include/deal.II/base/multithread_info.h
include/deal.II/lac/sparse_vanka.h
include/deal.II/lac/vector.templates.h
include/deal.II/matrix_free/dof_info.templates.h
include/deal.II/matrix_free/matrix_free.h
include/deal.II/matrix_free/matrix_free.templates.h
tests/base/task_09.cc
tests/quick_tests/affinity.cc

index 5863f9e2ba8d15affc7691fe2fc353853f3b2550..df2951b3500e0147c5d378a30ee725d63f4dd67b 100644 (file)
@@ -37,10 +37,9 @@ DEAL_II_NAMESPACE_OPEN
  * @ref threads
  * for more information on this.  Thread-based parallel methods need to
  * explicitly created threads and may want to use a number of threads that is
- * related to the number of CPUs in your system. This can be queried using the
- * variable <code> multithread_info.n_cpus; </code> of a global variable
- * <code>multithread_info</code> of this class that, or using <code>
- * multithread_info.n_threads(); </code>
+ * related to the number of CPUs in your system. The recommended number of threads
+ * can be queried using MultithreadInfo::n_threads(), while the number of cores
+ * in the system is returned by MultithreadInfo::n_cores().
  *
  * @ingroup threads
  * @author Thomas Richter, Wolfgang Bangerth, 2000
@@ -66,7 +65,7 @@ public:
 
   /**
    * 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
+   * of cores the system has (see n_cores()) but can be further restricted by
    * set_thread_limit().
    */
   static unsigned int n_threads ();
index d184d6f3bbdb2d6621f05aa9fcd4978564bfc151..07aba26129a4ea1cc8779b7c4bacb3f8eff3c261 100644 (file)
@@ -165,7 +165,7 @@ public:
   SparseVanka(const SparseMatrix<number> &M,
               const std::vector<bool>    &selected,
               const bool                  conserve_memory = false,
-              const unsigned int          n_threads       = multithread_info.n_threads());
+              const unsigned int          n_threads       = MultithreadInfo::n_threads());
 
   /**
    * Destructor. Delete all allocated matrices.
@@ -441,7 +441,7 @@ public:
                     const unsigned int          n_blocks,
                     const BlockingStrategy      blocking_strategy,
                     const bool                  conserve_memory = false,
-                    const unsigned int          n_threads       = multithread_info.n_threads());
+                    const unsigned int          n_threads       = MultithreadInfo::n_threads());
 
   /**
    * Apply the preconditioner.
index 6b91b2883e291326e913e2aa3619428358c3979b..942f1f9cbd0e6b4d6f2644bccaf1c35cb05a0094 100644 (file)
@@ -1150,7 +1150,7 @@ namespace internal
           result = outer_results[0];
         }
 #ifdef DEAL_II_WITH_THREADS
-      else if (multithread_info.n_threads() > 1 &&
+      else if (MultithreadInfo::n_threads() > 1 &&
                vec_size > 4 * internal::Vector::minimum_parallel_grain_size &&
                depth != 0)
         {
@@ -1161,10 +1161,10 @@ namespace internal
 
           // find out how many recursions we should make (avoid too deep
           // hierarchies of tasks on large vectors), max use 8 *
-          // multithread_info.n_threads()
+          // MultithreadInfo::n_threads()
           int next_depth = depth;
           if (depth == -1)
-            next_depth = 8 * multithread_info.n_threads();
+            next_depth = 8 * MultithreadInfo::n_threads();
           next_depth /= 4;
 
           Threads::TaskGroup<> task_group;
index bec5ee59c3334edc6ab43671b7914c319c8e83e9..ca4049c55d9db8647459a116c391b167d7e330bf 100644 (file)
@@ -795,7 +795,7 @@ no_constraint:
           // we would like to have enough work to do, so as first guess, try
           // to get 50 times as many chunks as we have threads on the system.
           task_info.block_size =
-            size_info.n_macro_cells / (multithread_info.n_threads() * 50);
+            size_info.n_macro_cells / (MultithreadInfo::n_threads() * 50);
 
           // if there are too few degrees of freedom per cell, need to
           // increase the block size
index 6c4dd2769062d3556715c146bcb1f8feece28c7f..fd4220502bc715df967e799eac2efa2d44d50133 100644 (file)
@@ -203,7 +203,7 @@ public:
     /**
      * Sets the number of so-called macro cells that should form one
      * partition. If zero size is given, the class tries to find a good size
-     * for the blocks based on multithread_info.n_threads() and the number of
+     * for the blocks based on MultithreadInfo::n_threads() and the number of
      * cells present. Otherwise, the given number is used. If the given number
      * is larger than one third of the number of total cells, this means no
      * parallelism. Note that in the case vectorization is used, a macro cell
index 67f8264a090f1285466146b290be91b5f9495af5..d62b1fd062f37b028c88121d2d8d34708fc81045 100644 (file)
@@ -157,7 +157,7 @@ internal_reinit(const Mapping<dim>                          &mapping,
       // passed to the DoFInfo structure
 #ifdef DEAL_II_WITH_THREADS
       if (additional_data.tasks_parallel_scheme != AdditionalData::none &&
-          multithread_info.n_threads() > 1)
+          MultithreadInfo::n_threads() > 1)
         {
           task_info.use_multithreading = true;
           task_info.block_size = additional_data.tasks_block_size;
@@ -287,7 +287,7 @@ internal_reinit(const Mapping<dim>                            &mapping,
       // passed to the DoFInfo structure
 #ifdef DEAL_II_WITH_THREADS
       if (additional_data.tasks_parallel_scheme != AdditionalData::none &&
-          multithread_info.n_threads() > 1)
+          MultithreadInfo::n_threads() > 1)
         {
           task_info.use_multithreading = true;
           task_info.block_size = additional_data.tasks_block_size;
index 238c8efc182d37391e89c3887ad469f5a5882a66..943b0dc5d1e0405ee150e2ee48f9e48af6300674 100644 (file)
@@ -66,7 +66,7 @@ int main()
   deallog.depth_console(0);
   deallog.threshold_double(1.e-10);
 
-  for (unsigned int i=0; i<MultithreadInfo::n_cpus*2; ++i)
+  for (unsigned int i=0; i<MultithreadInfo::n_cores()*2; ++i)
     Threads::new_task (outer);
 
   deallog << "OK" << std::endl;
index 1db5bc658041f4be5dcb66bb49e980a027aff5c6..e573b8a7c1bb59e2fb7eee63fd4b95e3b7ebb2b9 100644 (file)
@@ -60,7 +60,7 @@ int main ()
   if (!getaffinity(bits_set, mask))
     return 1;
 
-  unsigned int nprocs = dealii::MultithreadInfo::n_cpus;
+  unsigned int nprocs = dealii::MultithreadInfo::n_cores();
   unsigned int tbbprocs = dealii::MultithreadInfo::n_threads();
   printf("aff_ncpus=%d, mask=%08X, nprocs=%d, tbb_threads=%d\n",
         bits_set, mask, nprocs, tbbprocs );

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.