Commit a0880a1e authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Test in configure if "use mpi" can be used

parent 3b812ca4
......@@ -263,26 +263,26 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
)
AC_MSG_RESULT([${can_compile_avx}])
#if test "${can_compile_avx}" = "yes" ; then
# AC_MSG_CHECKING([whether we can compile AVX intrinsics in C++])
# AC_LANG_PUSH([C++])
# AC_COMPILE_IFELSE([AC_LANG_SOURCE([
# #include <x86intrin.h>
# int main(int argc, char **argv){
# double* q;
# __m256d a1_1 = _mm256_load_pd(q);
# return 0;
# }
# ])],
# [can_compile_avx=yes],
# [can_compile_avx=no]
# )
# AC_LANG_POP([C++])
# AC_MSG_RESULT([${can_compile_avx}])
# if test "${can_compile_avx}" = "no" ; then
# AC_MSG_WARN([Cannot compile C++ with AVX: disabling AVX alltogether])
# fi
#fi
dnl if test "${can_compile_avx}" = "yes" ; then
dnl AC_MSG_CHECKING([whether we can compile AVX intrinsics in C++])
dnl AC_LANG_PUSH([C++])
dnl AC_COMPILE_IFELSE([AC_LANG_SOURCE([
dnl #include <x86intrin.h>
dnl int main(int argc, char **argv){
dnl double* q;
dnl __m256d a1_1 = _mm256_load_pd(q);
dnl return 0;
dnl }
dnl ])],
dnl [can_compile_avx=yes],
dnl [can_compile_avx=no]
dnl )
dnl AC_LANG_POP([C++])
dnl AC_MSG_RESULT([${can_compile_avx}])
dnl if test "${can_compile_avx}" = "no" ; then
dnl AC_MSG_WARN([Cannot compile C++ with AVX: disabling AVX alltogether])
dnl fi
dnl fi
AC_MSG_CHECKING([whether we can compile AVX2 intrinsics in C])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
......@@ -298,27 +298,28 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
[can_compile_avx2=no]
)
AC_MSG_RESULT([${can_compile_avx2}])
#if test "${can_compile_avx2}" = "yes" ; then
# AC_MSG_CHECKING([whether we can compile AVX2 intrinsics in C++])
# AC_LANG_PUSH([C++])
# AC_COMPILE_IFELSE([AC_LANG_SOURCE([
# #include <x86intrin.h>
# int main(int argc, char **argv){
# double* q;
# __m256d q1 = _mm256_load_pd(q);
# __m256d y1 = _mm256_fmadd_pd(q1, q1, q1);
# return 0;
# }
# ])],
# [can_compile_avx2=yes],
# [can_compile_avx2=no]
# )
# AC_LANG_POP([C++])
# AC_MSG_RESULT([${can_compile_avx2}])
# if test "${can_compile_avx2}" = "no" ; then
# AC_MSG_WARN([Cannot compile C++ with AVX2!])
# fi
#fi
dnl if test "${can_compile_avx2}" = "yes" ; then
dnl AC_MSG_CHECKING([whether we can compile AVX2 intrinsics in C++])
dnl AC_LANG_PUSH([C++])
dnl AC_COMPILE_IFELSE([AC_LANG_SOURCE([
dnl #include <x86intrin.h>
dnl int main(int argc, char **argv){
dnl double* q;
dnl __m256d q1 = _mm256_load_pd(q);
dnl __m256d y1 = _mm256_fmadd_pd(q1, q1, q1);
dnl return 0;
dnl }
dnl ])],
dnl [can_compile_avx2=yes],
dnl [can_compile_avx2=no]
dnl )
dnl AC_LANG_POP([C++])
dnl AC_MSG_RESULT([${can_compile_avx2}])
dnl if test "${can_compile_avx2}" = "no" ; then
dnl AC_MSG_WARN([Cannot compile C++ with AVX2!])
dnl fi
dnl fi
if test "${can_compile_avx}" = "yes" ; then
install_real_avx_block2=yes
......@@ -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])
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
......
......@@ -109,10 +109,9 @@ contains
subroutine hh_trafo_kernel_24_bgq(q, hh, nb, ldq, ldh, s)
use precision
use elpa_mpi
implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*)
......@@ -317,10 +316,9 @@ contains
subroutine hh_trafo_kernel_16_bgq(q, hh, nb, ldq, ldh, s)
use precision
use elpa_mpi
implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*)
......@@ -475,10 +473,9 @@ contains
subroutine hh_trafo_kernel_8_bgq(q, hh, nb, ldq, ldh, s)
use precision
use elpa_mpi
implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*)
......@@ -582,10 +579,9 @@ contains
subroutine hh_trafo_kernel_4_bgq(q, hh, nb, ldq, ldh, s)
use precision
use elpa_mpi
implicit none
include 'mpif.h'
integer(kind=ik), intent(in) :: nb, ldq, ldh
real(kind=rk), intent(inout) :: q(ldq,*)
......
......@@ -47,9 +47,13 @@ module elpa_mpi
#ifndef WITH_MPI
use elpa_mpi_stubs
#else
#ifdef HAVE_MPI_MODULE
use mpi
implicit none
public
include "mpif.h"
#else
implicit none
include 'mpif.h'
#endif
#endif
public
end module
......@@ -73,8 +73,13 @@ program read_real
#ifdef HAVE_DETAILED_TIMINGS
use timings
#endif
#ifdef HAVE_MPI_MODULE
use mpi
implicit none
#else
implicit none
include 'mpif.h'
#endif
!-------------------------------------------------------------------------------
! Please set system size parameters below!
......@@ -370,7 +375,13 @@ end
subroutine read_matrix(iunit, na, a, lda, nblk, my_prow, my_pcol, np_rows, np_cols)
implicit none
#ifdef HAVE_MPI_MODULE
use mpi
implicit none
#else
implicit none
include 'mpif.h'
#endif
integer, intent(in) :: iunit, na, lda, nblk, my_prow, my_pcol, np_rows, np_cols
real*8, intent(out) :: a(lda, *)
......
......@@ -75,8 +75,13 @@ program test_real_example
use ELPA1
use elpa_utilities, only : error_unit
use iso_c_binding
#ifdef HAVE_MPI_MODULE
use mpi
implicit none
include "mpif.h"
#else
implicit none
include 'mpif.h'
#endif
!-------------------------------------------------------------------------------
! 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