Commit a0880a1e authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Test in configure if "use mpi" can be used

parent 3b812ca4
...@@ -263,26 +263,26 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ...@@ -263,26 +263,26 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
) )
AC_MSG_RESULT([${can_compile_avx}]) AC_MSG_RESULT([${can_compile_avx}])
#if test "${can_compile_avx}" = "yes" ; then dnl if test "${can_compile_avx}" = "yes" ; then
# AC_MSG_CHECKING([whether we can compile AVX intrinsics in C++]) dnl AC_MSG_CHECKING([whether we can compile AVX intrinsics in C++])
# AC_LANG_PUSH([C++]) dnl AC_LANG_PUSH([C++])
# AC_COMPILE_IFELSE([AC_LANG_SOURCE([ dnl AC_COMPILE_IFELSE([AC_LANG_SOURCE([
# #include <x86intrin.h> dnl #include <x86intrin.h>
# int main(int argc, char **argv){ dnl int main(int argc, char **argv){
# double* q; dnl double* q;
# __m256d a1_1 = _mm256_load_pd(q); dnl __m256d a1_1 = _mm256_load_pd(q);
# return 0; dnl return 0;
# } dnl }
# ])], dnl ])],
# [can_compile_avx=yes], dnl [can_compile_avx=yes],
# [can_compile_avx=no] dnl [can_compile_avx=no]
# ) dnl )
# AC_LANG_POP([C++]) dnl AC_LANG_POP([C++])
# AC_MSG_RESULT([${can_compile_avx}]) dnl AC_MSG_RESULT([${can_compile_avx}])
# if test "${can_compile_avx}" = "no" ; then dnl if test "${can_compile_avx}" = "no" ; then
# AC_MSG_WARN([Cannot compile C++ with AVX: disabling AVX alltogether]) dnl AC_MSG_WARN([Cannot compile C++ with AVX: disabling AVX alltogether])
# fi dnl fi
#fi dnl fi
AC_MSG_CHECKING([whether we can compile AVX2 intrinsics in C]) AC_MSG_CHECKING([whether we can compile AVX2 intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
...@@ -298,27 +298,28 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ...@@ -298,27 +298,28 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
[can_compile_avx2=no] [can_compile_avx2=no]
) )
AC_MSG_RESULT([${can_compile_avx2}]) AC_MSG_RESULT([${can_compile_avx2}])
#if test "${can_compile_avx2}" = "yes" ; then
# AC_MSG_CHECKING([whether we can compile AVX2 intrinsics in C++]) dnl if test "${can_compile_avx2}" = "yes" ; then
# AC_LANG_PUSH([C++]) dnl AC_MSG_CHECKING([whether we can compile AVX2 intrinsics in C++])
# AC_COMPILE_IFELSE([AC_LANG_SOURCE([ dnl AC_LANG_PUSH([C++])
# #include <x86intrin.h> dnl AC_COMPILE_IFELSE([AC_LANG_SOURCE([
# int main(int argc, char **argv){ dnl #include <x86intrin.h>
# double* q; dnl int main(int argc, char **argv){
# __m256d q1 = _mm256_load_pd(q); dnl double* q;
# __m256d y1 = _mm256_fmadd_pd(q1, q1, q1); dnl __m256d q1 = _mm256_load_pd(q);
# return 0; dnl __m256d y1 = _mm256_fmadd_pd(q1, q1, q1);
# } dnl return 0;
# ])], dnl }
# [can_compile_avx2=yes], dnl ])],
# [can_compile_avx2=no] dnl [can_compile_avx2=yes],
# ) dnl [can_compile_avx2=no]
# AC_LANG_POP([C++]) dnl )
# AC_MSG_RESULT([${can_compile_avx2}]) dnl AC_LANG_POP([C++])
# if test "${can_compile_avx2}" = "no" ; then dnl AC_MSG_RESULT([${can_compile_avx2}])
# AC_MSG_WARN([Cannot compile C++ with AVX2!]) dnl if test "${can_compile_avx2}" = "no" ; then
# fi dnl AC_MSG_WARN([Cannot compile C++ with AVX2!])
#fi dnl fi
dnl fi
if test "${can_compile_avx}" = "yes" ; then if test "${can_compile_avx}" = "yes" ; then
install_real_avx_block2=yes install_real_avx_block2=yes
...@@ -609,6 +610,24 @@ if test x"${fortran_can_check_environment}" = x"yes" ; then ...@@ -609,6 +610,24 @@ if test x"${fortran_can_check_environment}" = x"yes" ; then
AC_DEFINE([HAVE_ENVIRONMENT_CHECKING],[1],[Fortran can querry environment variables]) AC_DEFINE([HAVE_ENVIRONMENT_CHECKING],[1],[Fortran can querry environment variables])
fi fi
if test x"${with_mpi}" = x"yes"; then
AC_MSG_CHECKING(whether Fortran mpi module can be used)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
program test_mpi_module
use mpi
real :: time
time = MPI_WTime()
end program
])],
[fortran_mpi_module=yes],
[fortran_mpi_module=no]
)
AC_MSG_RESULT([${fortran_mpi_module}])
if test x"${fortran_mpi_module}" = x"yes" ; then
AC_DEFINE([HAVE_MPI_MODULE],[1],[can use Fortran mpi module])
fi
fi
dnl last check whether user wants to compile only a specific kernel dnl last check whether user wants to compile only a specific kernel
dnl dnl
......
...@@ -109,10 +109,9 @@ contains ...@@ -109,10 +109,9 @@ contains
subroutine hh_trafo_kernel_24_bgq(q, hh, nb, ldq, ldh, s) subroutine hh_trafo_kernel_24_bgq(q, hh, nb, ldq, ldh, s)
use precision use precision
use elpa_mpi
implicit none implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*) real(kind=rk), intent(inout) :: q(ldq,*)
...@@ -317,10 +316,9 @@ contains ...@@ -317,10 +316,9 @@ contains
subroutine hh_trafo_kernel_16_bgq(q, hh, nb, ldq, ldh, s) subroutine hh_trafo_kernel_16_bgq(q, hh, nb, ldq, ldh, s)
use precision use precision
use elpa_mpi
implicit none implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*) real(kind=rk), intent(inout) :: q(ldq,*)
...@@ -475,10 +473,9 @@ contains ...@@ -475,10 +473,9 @@ contains
subroutine hh_trafo_kernel_8_bgq(q, hh, nb, ldq, ldh, s) subroutine hh_trafo_kernel_8_bgq(q, hh, nb, ldq, ldh, s)
use precision use precision
use elpa_mpi
implicit none implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*) real(kind=rk), intent(inout) :: q(ldq,*)
...@@ -582,10 +579,9 @@ contains ...@@ -582,10 +579,9 @@ contains
subroutine hh_trafo_kernel_4_bgq(q, hh, nb, ldq, ldh, s) subroutine hh_trafo_kernel_4_bgq(q, hh, nb, ldq, ldh, s)
use precision use precision
use elpa_mpi
implicit none implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*) real(kind=rk), intent(inout) :: q(ldq,*)
......
...@@ -47,9 +47,13 @@ module elpa_mpi ...@@ -47,9 +47,13 @@ module elpa_mpi
#ifndef WITH_MPI #ifndef WITH_MPI
use elpa_mpi_stubs use elpa_mpi_stubs
#else #else
#ifdef HAVE_MPI_MODULE
use mpi
implicit none implicit none
public #else
include "mpif.h" implicit none
include 'mpif.h'
#endif #endif
#endif
public
end module end module
...@@ -73,8 +73,13 @@ program read_real ...@@ -73,8 +73,13 @@ program read_real
#ifdef HAVE_DETAILED_TIMINGS #ifdef HAVE_DETAILED_TIMINGS
use timings use timings
#endif #endif
#ifdef HAVE_MPI_MODULE
use mpi
implicit none
#else
implicit none implicit none
include 'mpif.h' include 'mpif.h'
#endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Please set system size parameters below! ! Please set system size parameters below!
...@@ -370,7 +375,13 @@ end ...@@ -370,7 +375,13 @@ end
subroutine read_matrix(iunit, na, a, lda, nblk, my_prow, my_pcol, np_rows, np_cols) subroutine read_matrix(iunit, na, a, lda, nblk, my_prow, my_pcol, np_rows, np_cols)
implicit none implicit none
#ifdef HAVE_MPI_MODULE
use mpi
implicit none
#else
implicit none
include 'mpif.h' include 'mpif.h'
#endif
integer, intent(in) :: iunit, na, lda, nblk, my_prow, my_pcol, np_rows, np_cols integer, intent(in) :: iunit, na, lda, nblk, my_prow, my_pcol, np_rows, np_cols
real*8, intent(out) :: a(lda, *) real*8, intent(out) :: a(lda, *)
......
...@@ -75,8 +75,13 @@ program test_real_example ...@@ -75,8 +75,13 @@ program test_real_example
use ELPA1 use ELPA1
use elpa_utilities, only : error_unit use elpa_utilities, only : error_unit
use iso_c_binding use iso_c_binding
#ifdef HAVE_MPI_MODULE
use mpi
implicit none implicit none
include "mpif.h" #else
implicit none
include 'mpif.h'
#endif
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! Please set system size parameters below! ! Please set system size parameters below!
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment