]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Enable multithreading by default.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 2 May 2013 13:48:22 +0000 (13:48 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 2 May 2013 13:48:22 +0000 (13:48 +0000)
git-svn-id: https://svn.dealii.org/trunk@29426 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/examples/step-48/step-48.cc

index e5e71e7d20265ed85c3717b921385cbee8885a52..79250490eda176d66461b53ecf6582a748b92a2f 100644 (file)
@@ -3,7 +3,7 @@
 
 /*    $Id$       */
 /*                                                                */
-/*    Copyright (C) 2011-2012 by the deal.II authors             */
+/*    Copyright (C) 2011-2013 by the deal.II authors             */
 /*                                                                */
 /*    This file is subject to QPL and may not be  distributed     */
 /*    without copyright and license information. Please refer     */
@@ -603,13 +603,20 @@ namespace Step48
 
 // @sect3{The <code>main</code> function}
 
-// This is as in all other programs:
+// As in step-40, we initialize MPI at the start of the program. Since we will
+// in general mix MPI parallelization with threads, we also set the third
+// argument in MPI_InitFinalize that controls the number of threads to an
+// invalid number, which means that the TBB library chooses the number of
+// threads automatically, typically to the number of available cores in the
+// system. As an alternative, you can also set this number manually if you
+// want to set a specific number of threads (e.g. when MPI-only is required).
 int main (int argc, char **argv)
 {
   using namespace Step48;
   using namespace dealii;
 
-  Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv);
+  Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv,
+                                                         numbers::invalid_unsigned_int);
 
   try
     {

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.