From: Bruno Turcksin Date: Fri, 20 Feb 2015 17:14:29 +0000 (-0600) Subject: Add set_thread_limit in step-9. X-Git-Tag: v8.3.0-rc1~437^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F520%2Fhead;p=dealii.git Add set_thread_limit in step-9. --- diff --git a/examples/step-9/step-9.cc b/examples/step-9/step-9.cc index 6b8ca0bff9..092e9f9c43 100644 --- a/examples/step-9/step-9.cc +++ b/examples/step-9/step-9.cc @@ -48,7 +48,7 @@ // programs. In the first one, the classes and functions are declared which we // need to do assembly in parallel (i.e. the // WorkStream namespace). The -// second file has a class MultithreadInfo which can be used to query the +// second file has a class MultithreadInfo which can be used to query the // number of processors in your system, which is often useful when deciding // how many threads to start in parallel. #include @@ -1318,15 +1318,25 @@ namespace Step9 // @sect3{Main function} -// The main function is exactly like in previous examples, with -// the only difference in the name of the main class that actually does the -// computation. +// The main function is similar to the previous examples. The main +// difference is that we use MultithreadInfo to set the maximum +// number of threads (see @ref threads "Parallel computing with multiple +// processors accessing shared memory" documentation module for more +// explanation). The number of threads used is the minimum of the environment +// variable DEAL_II_NUM_THREADS and the parameter of +// set_thread_limit. If no value is given to +// set_thread_limit, the default value from the Intel Threading +// Building Blocks (TBB) library is used. If the call to +// set_thread_limit is omitted, the number of threads will be +// chosen by TBB indepently of DEAL_II_NUM_THREADS. int main () { try { dealii::deallog.depth_console (0); + dealii::MultithreadInfo::set_thread_limit(); + Step9::AdvectionProblem<2> advection_problem_2d; advection_problem_2d.run (); }