]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Clarify some of the function docs.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Apr 2014 12:25:07 +0000 (12:25 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Apr 2014 12:25:07 +0000 (12:25 +0000)
git-svn-id: https://svn.dealii.org/trunk@32866 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/mpi.h
deal.II/source/base/mpi.cc

index 5a734f16c70171fd81f265c0dca560f5f08810c6..6c1dff4bc90204b69757ea4fee4b3b8f164cdec8 100644 (file)
@@ -1,7 +1,7 @@
 // ---------------------------------------------------------------------
 // $Id$
 //
-// Copyright (C) 2011 - 2013 by the deal.II authors
+// Copyright (C) 2011 - 2014 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -274,15 +274,20 @@ namespace Utilities
        * Initialize MPI (and optionally PETSc) and set the number of threads
        * used by deal.II (and TBB) to the given parameter. If set to
        * numbers::invalid_unsigned_int, the number of threads is determined by
-       * TBB. When in doubt, set this value to 1.
+       * TBB. When in doubt, set this value to 1 since MPI jobs are typically
+       * run in a way where one has one MPI process per available processor
+       * core and there will be little CPU resources left to support multithreaded
+       * processes.
        *
-       * This will call MultithreadInfo::set_thread_limit() with @p
-       * max_num_threads, so the environment variable DEAL_II_NUM_THREADS will
-       * be respected.
+       * This function calls MultithreadInfo::set_thread_limit()
+       * unconditionally with @p max_num_threads . That function in turn also
+       * evaluates the environment variable DEAL_II_NUM_THREADS and the number
+       * of threads to be used will be the minimum of the argument passed here
+       * and the environment (if both are set).
        */
       MPI_InitFinalize (int    &argc,
                         char ** &argv,
-                        unsigned int max_num_threads);
+                        const unsigned int max_num_threads);
       /**
        * Destructor. Calls <tt>MPI_Finalize()</tt> in case this class owns the
        * MPI process.
@@ -304,7 +309,7 @@ namespace Utilities
        */
       void do_init(int    &argc,
                    char ** &argv,
-                   unsigned int max_num_threads);
+                   const unsigned int max_num_threads);
     };
 
     namespace internal
index df1d36039366e5b262076b97e66acba2cc608eb4..ca73d301d7b4b91d1d5de207a4ccf2e850a105b0 100644 (file)
@@ -1,7 +1,7 @@
 // ---------------------------------------------------------------------
 // $Id$
 //
-// Copyright (C) 2005 - 2013 by the deal.II authors
+// Copyright (C) 2005 - 2014 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -315,7 +315,7 @@ namespace Utilities
 
     MPI_InitFinalize::MPI_InitFinalize (int    &argc,
                                         char ** &argv,
-                                        unsigned int max_num_threads)
+                                        const unsigned int max_num_threads)
       :
       owns_mpi (true)
     {
@@ -337,7 +337,7 @@ namespace Utilities
     void
     MPI_InitFinalize::do_init(int    &argc,
                               char ** &argv,
-                              unsigned int max_num_threads)
+                              const unsigned int max_num_threads)
     {
       static bool constructor_has_already_run = false;
       Assert (constructor_has_already_run == false,
@@ -389,7 +389,8 @@ namespace Utilities
 
       constructor_has_already_run = true;
 
-      //set maximum number of threads:
+      // set maximum number of threads (also respecting the environment
+      // variable that the called function evaluates)
       multithread_info.set_thread_limit(max_num_threads);
     }
 

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.