From 3d9c053b77e2c1de12417b3b6015815964b7a6c2 Mon Sep 17 00:00:00 2001 From: Andreas Marek Date: Wed, 26 Feb 2014 16:12:08 +0100 Subject: [PATCH] ELPA_2013.11 OpenMP tests return error code If the ELPA library is compiled with OpenMP, the tests check whether the MPI library provides the neccessary threading level. There has been the error, that if the required threading level was not available the test programs aborted, put no explicit error code was set. This is changed now. --- ELPA_2013.11/test/read_real.F90 | 3 ++- ELPA_2013.11/test/read_real_gen.F90 | 3 ++- ELPA_2013.11/test/test_complex.F90 | 5 +++-- ELPA_2013.11/test/test_complex2.F90 | 3 ++- ELPA_2013.11/test/test_complex_gen.F90 | 3 ++- ELPA_2013.11/test/test_real.F90 | 3 ++- ELPA_2013.11/test/test_real2.F90 | 3 ++- ELPA_2013.11/test/test_real_gen.F90 | 16 ++++++++++++++++ 8 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ELPA_2013.11/test/read_real.F90 b/ELPA_2013.11/test/read_real.F90 index c27e219a..38a3802f 100644 --- a/ELPA_2013.11/test/read_real.F90 +++ b/ELPA_2013.11/test/read_real.F90 @@ -94,7 +94,8 @@ program read_real if (required_mpi_thread_level .ne. provided_mpi_thread_level) then print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" print *," ", provided_mpi_thread_level, " is available" - stop + call EXIT(1) + stop 1 endif #endif diff --git a/ELPA_2013.11/test/read_real_gen.F90 b/ELPA_2013.11/test/read_real_gen.F90 index 833a0aa0..578b3841 100644 --- a/ELPA_2013.11/test/read_real_gen.F90 +++ b/ELPA_2013.11/test/read_real_gen.F90 @@ -95,7 +95,8 @@ program read_real_gen if (required_mpi_thread_level .ne. provided_mpi_thread_level) then print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" print *," ", provided_mpi_thread_level, " is available" - stop + call EXIT(1) + stop 1 endif #endif diff --git a/ELPA_2013.11/test/test_complex.F90 b/ELPA_2013.11/test/test_complex.F90 index 7a7f6e89..2f44c302 100644 --- a/ELPA_2013.11/test/test_complex.F90 +++ b/ELPA_2013.11/test/test_complex.F90 @@ -136,9 +136,10 @@ program test_complex if (required_mpi_thread_level .ne. provided_mpi_thread_level) then print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" print *," ", provided_mpi_thread_level, " is available" - stop + call EXIT(1) + stop 1 endif - + #endif call mpi_comm_rank(mpi_comm_world,myid,mpierr) diff --git a/ELPA_2013.11/test/test_complex2.F90 b/ELPA_2013.11/test/test_complex2.F90 index 64f9e06c..c1438b41 100644 --- a/ELPA_2013.11/test/test_complex2.F90 +++ b/ELPA_2013.11/test/test_complex2.F90 @@ -139,7 +139,8 @@ program test_complex2 if (required_mpi_thread_level .ne. provided_mpi_thread_level) then print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" print *," ", provided_mpi_thread_level, " is available" - stop + call EXIT(1) + stop 1 endif #endif diff --git a/ELPA_2013.11/test/test_complex_gen.F90 b/ELPA_2013.11/test/test_complex_gen.F90 index 3c7354b0..fe6b1363 100644 --- a/ELPA_2013.11/test/test_complex_gen.F90 +++ b/ELPA_2013.11/test/test_complex_gen.F90 @@ -106,7 +106,8 @@ program test_complex_gen if (required_mpi_thread_level .ne. provided_mpi_thread_level) then print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" print *," ", provided_mpi_thread_level, " is available" - stop + call EXIT(1) + stop 1 endif #endif diff --git a/ELPA_2013.11/test/test_real.F90 b/ELPA_2013.11/test/test_real.F90 index 41b5b120..7b581c43 100644 --- a/ELPA_2013.11/test/test_real.F90 +++ b/ELPA_2013.11/test/test_real.F90 @@ -136,7 +136,8 @@ program test_real if (required_mpi_thread_level .ne. provided_mpi_thread_level) then print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" print *," ", provided_mpi_thread_level, " is available" - stop + call EXIT(1) + stop 1 endif #endif diff --git a/ELPA_2013.11/test/test_real2.F90 b/ELPA_2013.11/test/test_real2.F90 index 9d8554de..5c54742f 100644 --- a/ELPA_2013.11/test/test_real2.F90 +++ b/ELPA_2013.11/test/test_real2.F90 @@ -134,7 +134,8 @@ program test_real2 if (required_mpi_thread_level .ne. provided_mpi_thread_level) then print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" print *," ", provided_mpi_thread_level, " is available" - stop + call EXIT(1) + stop 1 endif #endif diff --git a/ELPA_2013.11/test/test_real_gen.F90 b/ELPA_2013.11/test/test_real_gen.F90 index a5cfa488..ebe41229 100644 --- a/ELPA_2013.11/test/test_real_gen.F90 +++ b/ELPA_2013.11/test/test_real_gen.F90 @@ -39,6 +39,7 @@ ! the original distribution, the GNU Lesser General Public License. ! ! +#include "config-f90.h" program test_real_gen !------------------------------------------------------------------------------- @@ -88,7 +89,22 @@ program test_real_gen !------------------------------------------------------------------------------- ! MPI Initialization +#ifndef WITH_OPENMP call mpi_init(mpierr) +#else + required_mpi_thread_level = MPI_THREAD_MULTIPLE + call mpi_init_thread(required_mpi_thread_level, & + provided_mpi_thread_level, mpierr) + + if (required_mpi_thread_level .ne. provided_mpi_thread_level) then + print *,"MPI ERROR: MPI_THREAD_MULTIPLE is not provided on this system" + print *," ", provided_mpi_thread_level, " is available" + call EXIT(1) + stop 1 + endif + +#endif + call mpi_comm_rank(mpi_comm_world,myid,mpierr) call mpi_comm_size(mpi_comm_world,nprocs,mpierr) -- GitLab