diff --git a/Makefile.am b/Makefile.am index ad9b2dfe47c723234cfc9c55a51548ab401cbb5e..9f0190ae94136eda7d9dad451c56243f8f82e9f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -362,6 +362,7 @@ distclean-local: EXTRA_DIST = \ fdep/fortran_dependencies.pl \ fdep/fortran_dependencies.mk \ + test/fortran_test_programs/elpa_test_programs_print_headers.X90 \ src/elpa_reduce_add_vectors.X90 \ src/elpa_transpose_vectors.X90 \ src/redist_band.X90 diff --git a/test/fortran_test_programs/elpa_test_programs_print_headers.X90 b/test/fortran_test_programs/elpa_test_programs_print_headers.X90 new file mode 100644 index 0000000000000000000000000000000000000000..08ad3b825ef68b78cddda64755733a7a7a870ba2 --- /dev/null +++ b/test/fortran_test_programs/elpa_test_programs_print_headers.X90 @@ -0,0 +1,150 @@ +#if 0 +! This file is part of ELPA. +! +! The ELPA library was originally created by the ELPA consortium, +! consisting of the following organizations: +! +! - Max Planck Computing and Data Facility (MPCDF), formerly known as +! Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG), +! - Bergische Universität Wuppertal, Lehrstuhl für angewandte +! Informatik, +! - Technische Universität München, Lehrstuhl für Informatik mit +! Schwerpunkt Wissenschaftliches Rechnen , +! - Fritz-Haber-Institut, Berlin, Abt. Theorie, +! - Max-Plack-Institut für Mathematik in den Naturwissenschaftrn, +! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition, +! and +! - IBM Deutschland GmbH +! +! +! More information can be found here: +! http://elpa.mpcdf.mpg.de/ +! +! ELPA is free software: you can redistribute it and/or modify +! it under the terms of the version 3 of the license of the +! GNU Lesser General Public License as published by the Free +! Software Foundation. +! +! ELPA is distributed in the hope that it will be useful, +! but WITHOUT ANY WARRANTY; without even the implied warranty of +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +! GNU Lesser General Public License for more details. +! +! You should have received a copy of the GNU Lesser General Public License +! along with ELPA. If not, see +! +! ELPA reflects a substantial effort on the part of the original +! ELPA consortium, and we ask you to respect the spirit of the +! license that we chose: i.e., please contribute any changes you +! may have back to the original ELPA library distribution, and keep +! any derivatives of ELPA under the same license that we chose for +! the original distribution, the GNU Lesser General Public License. +! +! +! ELPA1 -- Faster replacements for ScaLAPACK symmetric eigenvalue routines +! +! Copyright of the original code rests with the authors inside the ELPA +! consortium. The copyright of any additional modifications shall rest +! with their original authors, but shall adhere to the licensing terms +! distributed along with the original code in the file "COPYING". +#endif + +#ifdef WITH_OPENMP + if (myid .eq. 0) then + print *,"Threaded version of test program" + print *,"Using ",omp_get_max_threads()," threads" + print *," " + endif +#endif +#ifndef WITH_MPI + if (myid .eq. 0) then + print *,"This version of ELPA does not support MPI parallelisation" + print *,"For MPI support re-build ELPA with appropiate flags" + print *," " + endif +#endif + +#ifdef WITH_MPI + call MPI_BARRIER(MPI_COMM_WORLD, mpierr) +#endif +#ifdef HAVE_REDIRECT + if (check_redirect_environment_variable()) then + if (myid .eq. 0) then + print *," " + print *,"Redirection of mpi processes is used" + print *," " + if (create_directories() .ne. 1) then + write(error_unit,*) "Unable to create directory for stdout and stderr!" + stop + endif + endif +#ifdef WITH_MPI + call MPI_BARRIER(MPI_COMM_WORLD, mpierr) +#endif + call redirect_stdout(myid) + endif +#endif + +#ifndef ELPA1 + + if (myid .eq. 0) then + print *," " + print *,"This ELPA2 is build with" +#if DATATYPE == REAL + +#ifdef WITH_REAL_AVX_BLOCK2_KERNEL + print *,"AVX optimized kernel (2 blocking) for real matrices" +#endif +#ifdef WITH_REAL_AVX_BLOCK4_KERNEL + print *,"AVX optimized kernel (4 blocking) for real matrices" +#endif +#ifdef WITH_REAL_AVX_BLOCK6_KERNEL + print *,"AVX optimized kernel (6 blocking) for real matrices" +#endif + +#ifdef WITH_REAL_GENERIC_KERNEL + print *,"GENERIC kernel for real matrices" +#endif +#ifdef WITH_REAL_GENERIC_SIMPLE_KERNEL + print *,"GENERIC SIMPLE kernel for real matrices" +#endif +#ifdef WITH_REAL_SSE_KERNEL + print *,"SSE ASSEMBLER kernel for real matrices" +#endif +#ifdef WITH_REAL_BGP_KERNEL + print *,"BGP kernel for real matrices" +#endif +#ifdef WITH_REAL_BGQ_KERNEL + print *,"BGQ kernel for real matrices" +#endif + +#endif /* DATATYPE == REAL */ + +#if DATATYPE == COMPLEX +#ifdef WITH_COMPLEX_AVX_BLOCK2_KERNEL + print *,"AVX optimized kernel (2 blocking) for complex matrices" +#endif +#ifdef WITH_COMPLEX_AVX_BLOCK1_KERNEL + print *,"AVX optimized kernel (1 blocking) for complex matrices" +#endif + +#ifdef WITH_COMPLEX_GENERIC_KERNEL + print *,"GENERIC kernel for complex matrices" +#endif +#ifdef WITH_COMPLEX_GENERIC_SIMPLE_KERNEL + print *,"GENERIC SIMPLE kernel for complex matrices" +#endif +#ifdef WITH_COMPLEX_SSE_KERNEL + print *,"SSE ASSEMBLER kernel for complex matrices" +#endif + +#endif /* DATATYPE == COMPLEX */ + + endif +#endif /* ELPA1 */ + + if (write_to_file) then + if (myid .eq. 0) print *,"Writing output files" + endif + + diff --git a/test/fortran_test_programs/test_complex.F90 b/test/fortran_test_programs/test_complex.F90 index a10e194e18dbe6cc90da530a5b9b2601069ae8a4..0f66cc9a92cd65d2b5d1d51730a89702b21dfa3d 100644 --- a/test/fortran_test_programs/test_complex.F90 +++ b/test/fortran_test_programs/test_complex.F90 @@ -132,45 +132,10 @@ program test_complex call setup_mpi(myid, nprocs) STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif +#define DATATYPE COMPLEX +#define ELPA1 +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS diff --git a/test/fortran_test_programs/test_complex2.F90 b/test/fortran_test_programs/test_complex2.F90 index 9a987bf9039d7d7eae67479208977e7f6f6e8c70..cdd726091b707a56a3493b43e1e99ede67a8a3a1 100644 --- a/test/fortran_test_programs/test_complex2.F90 +++ b/test/fortran_test_programs/test_complex2.F90 @@ -141,68 +141,8 @@ program test_complex2 STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif - - if (myid .eq. 0) then - print *," " - print *,"This ELPA2 is build with" -#ifdef WITH_COMPLEX_AVX_BLOCK2_KERNEL - print *,"AVX optimized kernel (2 blocking) for complex matrices" -#endif -#ifdef WITH_COMPLEX_AVX_BLOCK1_KERNEL - print *,"AVX optimized kernel (1 blocking) for complex matrices" -#endif - -#ifdef WITH_COMPLEX_GENERIC_KERNEL - print *,"GENERIC kernel for complex matrices" -#endif -#ifdef WITH_COMPLEX_GENERIC_SIMPLE_KERNEL - print *,"GENERIC SIMPLE kernel for complex matrices" -#endif -#ifdef WITH_COMPLEX_SSE_KERNEL - print *,"SSE ASSEMBLER kernel for complex matrices" -#endif - - endif - - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif +#define DATATYPE COMPLEX +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS diff --git a/test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90 b/test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90 index aa5338931c8d764b96fd46839010a66a46542f99..9f40a06327030f73bb3945bb58930911a5d07944 100644 --- a/test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90 +++ b/test/fortran_test_programs/test_complex2_choose_kernel_with_api.F90 @@ -144,43 +144,8 @@ program test_complex2 call setup_mpi(myid, nprocs) STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - - -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif +#define DATATYPE COMPLEX +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS diff --git a/test/fortran_test_programs/test_complex2_default_kernel.F90 b/test/fortran_test_programs/test_complex2_default_kernel.F90 index 373b87113990ddd082f2bcf527ca6afa3f9342ff..7dfff020dca7a7cc8499081f84d877244cddad83 100644 --- a/test/fortran_test_programs/test_complex2_default_kernel.F90 +++ b/test/fortran_test_programs/test_complex2_default_kernel.F90 @@ -143,47 +143,8 @@ program test_complex2 STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - - -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif - - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif +#define DATATYPE COMPLEX +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS diff --git a/test/fortran_test_programs/test_real.F90 b/test/fortran_test_programs/test_real.F90 index 05c25ee95e018cbe4d56d6a12fc4d59815f51f46..d75180fbe8986fefc5be5aad26131ff6dea64d45 100644 --- a/test/fortran_test_programs/test_real.F90 +++ b/test/fortran_test_programs/test_real.F90 @@ -136,9 +136,11 @@ program test_real ! MPI Initialization call setup_mpi(myid, nprocs) - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif + STATUS = 0 + +#define DATATYPE REAL +#define ELPA1 +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS @@ -166,50 +168,6 @@ program test_real call timer%start("program") #endif - !------------------------------------------------------------------------------- - ! Selection of number of processor rows/columns - ! We try to set up the grid square-like, i.e. start the search for possible - ! divisors of nprocs with a number next to the square root of nprocs - ! and decrement it until a divisor is found. - - - STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif do np_cols = NINT(SQRT(REAL(nprocs))),2,-1 if(mod(nprocs,np_cols) == 0 ) exit diff --git a/test/fortran_test_programs/test_real2.F90 b/test/fortran_test_programs/test_real2.F90 index a9e708e101f28655bb0371fefa6c9a07bf7b0ee2..06b6d1f8832a1c73c7bdf4a443d4f24868282548 100644 --- a/test/fortran_test_programs/test_real2.F90 +++ b/test/fortran_test_programs/test_real2.F90 @@ -136,74 +136,9 @@ program test_real2 call setup_mpi(myid, nprocs) STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif - - if (myid .eq. 0) then - print *," " - print *,"This ELPA2 is build with" -#ifdef WITH_REAL_AVX_BLOCK2_KERNEL - print *,"AVX optimized kernel (2 blocking) for real matrices" -#endif -#ifdef WITH_REAL_AVX_BLOCK4_KERNEL - print *,"AVX optimized kernel (4 blocking) for real matrices" -#endif -#ifdef WITH_REAL_AVX_BLOCK6_KERNEL - print *,"AVX optimized kernel (6 blocking) for real matrices" -#endif -#ifdef WITH_REAL_GENERIC_KERNEL - print *,"GENERIC kernel for real matrices" -#endif -#ifdef WITH_REAL_GENERIC_SIMPLE_KERNEL - print *,"GENERIC SIMPLE kernel for real matrices" -#endif -#ifdef WITH_REAL_SSE_KERNEL - print *,"SSE ASSEMBLER kernel for real matrices" -#endif -#ifdef WITH_REAL_BGP_KERNEL - print *,"BGP kernel for real matrices" -#endif -#ifdef WITH_REAL_BGQ_KERNEL - print *,"BGQ kernel for real matrices" -#endif - endif - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif +#define DATATYPE REAL +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS diff --git a/test/fortran_test_programs/test_real2_choose_kernel_with_api.F90 b/test/fortran_test_programs/test_real2_choose_kernel_with_api.F90 index 834fba517723ada5590e7f9b3720878aeee847ae..8cea2425b430b1b13de294bc01e22c4b0929a678 100644 --- a/test/fortran_test_programs/test_real2_choose_kernel_with_api.F90 +++ b/test/fortran_test_programs/test_real2_choose_kernel_with_api.F90 @@ -142,46 +142,8 @@ program test_real2 STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - - -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif +#define DATATYPE REAL +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS diff --git a/test/fortran_test_programs/test_real2_default_kernel.F90 b/test/fortran_test_programs/test_real2_default_kernel.F90 index d9c618ce392a35b2feabd9bbefe965ab074859e3..0982f87f55dba72419a6523c572ff72e8460f6e6 100644 --- a/test/fortran_test_programs/test_real2_default_kernel.F90 +++ b/test/fortran_test_programs/test_real2_default_kernel.F90 @@ -139,47 +139,8 @@ program test_real2 STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - - -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif - - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif +#define DATATYPE REAL +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS diff --git a/test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90 b/test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90 index 55e6b78106a9a5f96c47129ac806ebd260d39b1c..b5b1421f7c8b6acc57d513f68757d7a29b76d017 100644 --- a/test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90 +++ b/test/fortran_test_programs/test_real2_default_kernel_qr_decomposition.F90 @@ -149,47 +149,8 @@ program test_real2 STATUS = 0 -#ifdef WITH_OPENMP - if (myid .eq. 0) then - print *,"Threaded version of test program" - print *,"Using ",omp_get_max_threads()," threads" - print *," " - endif -#endif -#ifndef WITH_MPI - if (myid .eq. 0) then - print *,"This version of ELPA does not support MPI parallelisation" - print *,"For MPI support re-build ELPA with appropiate flags" - print *," " - endif -#endif - -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - - -#ifdef HAVE_REDIRECT - if (check_redirect_environment_variable()) then - if (myid .eq. 0) then - print *," " - print *,"Redirection of mpi processes is used" - print *," " - if (create_directories() .ne. 1) then - write(error_unit,*) "Unable to create directory for stdout and stderr!" - stop - endif - endif -#ifdef WITH_MPI - call MPI_BARRIER(MPI_COMM_WORLD, mpierr) -#endif - call redirect_stdout(myid) - endif -#endif - - if (write_to_file) then - if (myid .eq. 0) print *,"Writing output files" - endif +#define DATATYPE REAL +#include "elpa_test_programs_print_headers.X90" #ifdef HAVE_DETAILED_TIMINGS