]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
do not use n_default_threads but n_threads()
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 2 Oct 2013 17:59:44 +0000 (17:59 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 2 Oct 2013 17:59:44 +0000 (17:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@31077 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-13/step-13.cc
deal.II/examples/step-14/step-14.cc
deal.II/examples/step-17/step-17.cc
deal.II/examples/step-18/step-18.cc
deal.II/examples/step-9/step-9.cc

index 8e88ee8ad8b4bbfdc18a29e650ad811ccfa66e31..fbef4d1660bfa121a79d5d8ffc2ad11c8b1aa0c9 100644 (file)
@@ -743,7 +743,7 @@ namespace Step13
       // of equal size. The number of blocks is set to the default number of
       // threads to be used, which by default is set to the number of
       // processors found in your computer at startup of the program:
-      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 32d5710ce1fc9681cc3676e7cba51ee3c0ae36b4..58359c9e977a0b8c5ba37cbf1b8eb610910be7fc 100644 (file)
@@ -543,7 +543,7 @@ namespace Step14
       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 (),
@@ -2329,7 +2329,7 @@ namespace Step14
       // Now start a number of threads which compute the error formula on
       // parts of all the cells, and once they are all started wait until they
       // have all finished:
-      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,
index cf4745d3f706f4b19240f1e1eadef015c0ecccf0..9f072eea3519c73d66fb3b0d3c7e854a1404b79d 100644 (file)
@@ -780,7 +780,7 @@ namespace Step17
                                         local_error_per_cell,
                                         ComponentMask(),
                                         0,
-                                        multithread_info.n_default_threads,
+                                        multithread_info.n_threads(),
                                         this_mpi_process);
 
     // Now all processes have computed error indicators for their own cells
index 46a8ed4e53dd5e22564b5e098797be39c33486f2..f587d740be24c21ced5e2358150636dafbfeeb5c 100644 (file)
@@ -1627,7 +1627,7 @@ namespace Step18
                                         error_per_cell,
                                         ComponentMask(),
                                         0,
-                                        multithread_info.n_default_threads,
+                                        multithread_info.n_threads(),
                                         this_mpi_process);
 
     // Then set up a global vector into which we merge the local indicators
index e95c474a590b797440d44b8c8f8e33b70f2ca6f9..82a9af49df801689e1107170f42f9445f98c2b8a 100644 (file)
@@ -520,17 +520,13 @@ namespace Step9
     // configured for multithreading, then the number of CPUs is set to one.)
     // However, sometimes there might be reasons to use another value. For
     // example, you might want to use less processors than there are in your
-    // system in order not to use too many computational resources. On the
-    // other hand, if there are several jobs running on a computer and you
-    // want to get a higher percentage of CPU time, it might be worth to start
-    // more threads than there are CPUs, as most operating systems assign
-    // roughly the same CPU resources to all threads presently running. For
-    // this reason, the <code>MultithreadInfo</code> class contains a
-    // read-write variable <code>n_default_threads</code> which is set to
-    // <code>n_cpus</code> by default, but can be set to another value. This
-    // variable is also queried by functions inside the library to determine
+    // system in order not to use too many computational resources. For
+    // this reason, the number of threads can be set by
+    // <code>MultithreadInfo::set_thread_limit</code> and the current value
+    // is returned by n_threads(). This
+    // is also queried by functions inside the library to determine
     // how many threads they shall create.
-    const unsigned int n_threads = multithread_info.n_default_threads;
+    const unsigned int n_threads = multithread_info.n_threads();
     // It is worth noting, however, that this setup determines the load
     // distribution onto processor in a static way: it does not take into
     // account that some other part of our program may also be running
@@ -1004,7 +1000,7 @@ namespace Step9
     // as we have used the function <code>Threads::split_range</code> when
     // assembling above, there is a function that computes intervals of
     // roughly equal size from a larger interval. This is used here:
-    const unsigned int n_threads = multithread_info.n_default_threads;
+    const unsigned int n_threads = multithread_info.n_threads();
     std::vector<IndexInterval> index_intervals
       = Threads::split_interval (0, dof_handler.get_tria().n_active_cells(),
                                  n_threads);
@@ -1038,7 +1034,7 @@ namespace Step9
     // finish their work:
     threads.join_all ();
     // Note that if the value of the variable
-    // <code>multithread_info.n_default_threads</code> was one, or if the
+    // <code>multithread_info.n_threads()</code> was one, or if the
     // library was not configured to use threads, then the sequence of
     // commands above reduced to a complicated way to simply call the
     // <code>estimate_interval</code> function with the whole range of cells

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.