From ee53d64920f52a62631a4659cc71910d2820ab76 Mon Sep 17 00:00:00 2001 From: heister Date: Tue, 26 Mar 2013 20:18:22 +0000 Subject: [PATCH] PETSc examples work with threading enabled at configure time. Turn off at runtime. git-svn-id: https://svn.dealii.org/trunk@29047 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-17/CMakeLists.txt | 3 +-- deal.II/examples/step-17/step-17.cc | 3 +-- deal.II/examples/step-18/CMakeLists.txt | 3 +-- deal.II/examples/step-18/step-18.cc | 2 +- deal.II/examples/step-36/CMakeLists.txt | 3 +-- deal.II/examples/step-36/step-36.cc | 9 +-------- deal.II/examples/step-40/CMakeLists.txt | 3 +-- deal.II/examples/step-40/step-40.cc | 2 +- 8 files changed, 8 insertions(+), 20 deletions(-) diff --git a/deal.II/examples/step-17/CMakeLists.txt b/deal.II/examples/step-17/CMakeLists.txt index f49c226332..77d825f29b 100644 --- a/deal.II/examples/step-17/CMakeLists.txt +++ b/deal.II/examples/step-17/CMakeLists.txt @@ -30,11 +30,10 @@ ENDIF () # # Are all dependencies fullfilled? # -IF(NOT DEAL_II_WITH_PETSC OR DEAL_II_WITH_THREADS) +IF(NOT DEAL_II_WITH_PETSC) MESSAGE(FATAL_ERROR " Error! The deal.II library found at ${DEAL_II_PATH} was not configured with DEAL_II_WITH_PETSC = ON - DEAL_II_WITH_THREADS = OFF which is required for this tutorial step." ) ENDIF() diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index 34cfece843..9f7f7c6b14 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -908,8 +908,7 @@ int main (int argc, char **argv) // destructor of elastic_problem would run after // PetscFinalize; since the destructor involves calls to // PETSc functions, we would get strange error messages from PETSc.) - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv); - + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); { deallog.depth_console (0); diff --git a/deal.II/examples/step-18/CMakeLists.txt b/deal.II/examples/step-18/CMakeLists.txt index a0b84d2c0d..c1e1076991 100644 --- a/deal.II/examples/step-18/CMakeLists.txt +++ b/deal.II/examples/step-18/CMakeLists.txt @@ -30,11 +30,10 @@ ENDIF () # # Are all dependencies fullfilled? # -IF(NOT DEAL_II_WITH_PETSC OR DEAL_II_WITH_THREADS) +IF(NOT DEAL_II_WITH_PETSC) MESSAGE(FATAL_ERROR " Error! The deal.II library found at ${DEAL_II_PATH} was not configured with DEAL_II_WITH_PETSC = ON - DEAL_II_WITH_THREADS = OFF which is required for this tutorial step." ) ENDIF() diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index 92871e9f4e..607d760ecb 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -1989,7 +1989,7 @@ int main (int argc, char **argv) using namespace dealii; using namespace Step18; - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); { deallog.depth_console (0); diff --git a/deal.II/examples/step-36/CMakeLists.txt b/deal.II/examples/step-36/CMakeLists.txt index cabd34cc91..5e72c8ca3e 100644 --- a/deal.II/examples/step-36/CMakeLists.txt +++ b/deal.II/examples/step-36/CMakeLists.txt @@ -29,12 +29,11 @@ ENDIF() # # Are all dependencies fullfilled? # -IF(NOT DEAL_II_WITH_PETSC OR NOT DEAL_II_WITH_SLEPC OR DEAL_II_WITH_THREADS) +IF(NOT DEAL_II_WITH_PETSC OR NOT DEAL_II_WITH_SLEPC) MESSAGE(FATAL_ERROR " Error! The deal.II library found at ${DEAL_II_PATH} was not configured with DEAL_II_WITH_PETSC = ON DEAL_II_WITH_SLEPC = ON - DEAL_II_WITH_THREADS = OFF which is required for this tutorial step." ) ENDIF() diff --git a/deal.II/examples/step-36/step-36.cc b/deal.II/examples/step-36/step-36.cc index e018e89f44..6a4fc8651c 100644 --- a/deal.II/examples/step-36/step-36.cc +++ b/deal.II/examples/step-36/step-36.cc @@ -426,12 +426,7 @@ int main (int argc, char **argv) try { - // Here is another difference from other steps: We initialize the SLEPc - // work space which inherently initializes the PETSc work space, then go - // ahead run the whole program. After that is done, we finalize the - // SLEPc-PETSc work. - SlepcInitialize (&argc, &argv, 0, 0); - + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); { using namespace dealii; using namespace Step36; @@ -441,8 +436,6 @@ int main (int argc, char **argv) EigenvalueProblem<2> problem ("step-36.prm"); problem.run (); } - - SlepcFinalize (); } // All the while, we are watching out if any exceptions should have been diff --git a/deal.II/examples/step-40/CMakeLists.txt b/deal.II/examples/step-40/CMakeLists.txt index 65ebf1d444..ed9f3e4c1d 100644 --- a/deal.II/examples/step-40/CMakeLists.txt +++ b/deal.II/examples/step-40/CMakeLists.txt @@ -29,12 +29,11 @@ ENDIF() # # Are all dependencies fullfilled? # -IF(NOT DEAL_II_WITH_PETSC OR NOT DEAL_II_WITH_P4EST OR DEAL_II_WITH_THREADS) +IF(NOT DEAL_II_WITH_PETSC OR NOT DEAL_II_WITH_P4EST) MESSAGE(FATAL_ERROR " Error! The deal.II library found at ${DEAL_II_PATH} was not configured with DEAL_II_WITH_PETSC = ON DEAL_II_WITH_P4EST = ON - DEAL_II_WITH_THREADS = OFF which is required for this tutorial step." ) ENDIF() diff --git a/deal.II/examples/step-40/step-40.cc b/deal.II/examples/step-40/step-40.cc index 5c2ce3bbee..5b9d32310c 100644 --- a/deal.II/examples/step-40/step-40.cc +++ b/deal.II/examples/step-40/step-40.cc @@ -650,7 +650,7 @@ int main(int argc, char *argv[]) using namespace dealii; using namespace Step40; - Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv); + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); deallog.depth_console (0); { -- 2.39.5