Commit 958032ef authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

A bit of cleanup of the test programs

- Remove all use of ELPA internal modules, the test programs now
  only use the public ELPA API. This is now enforced, by hiding the
  private modules

- Prefix all test internal modules with "test_" to make it really
  clear that these modules are not to be used by users.
parent cd075538
This diff is collapsed.
...@@ -905,8 +905,7 @@ AC_SUBST([OPENMP_FCFLAGS]) ...@@ -905,8 +905,7 @@ AC_SUBST([OPENMP_FCFLAGS])
AC_SUBST([OPENMP_LDFLAGS]) AC_SUBST([OPENMP_LDFLAGS])
AC_SUBST([DOXYGEN_OUTPUT_DIR], [docs]) AC_SUBST([DOXYGEN_OUTPUT_DIR], [docs])
#rm -rf modules/ private_modules/ .fortran_dependencies/ mkdir -p modules private_modules test_modules
mkdir -p modules private_modules
#gl_VISIBILITY #gl_VISIBILITY
......
...@@ -67,12 +67,12 @@ ...@@ -67,12 +67,12 @@
!> \author A. Marek (MPCDF) !> \author A. Marek (MPCDF)
program print_available_elpa2_kernels program print_available_elpa2_kernels
use precision
use elpa use elpa
use, intrinsic :: iso_c_binding
implicit none implicit none
integer(kind=ik) :: i integer(kind=c_int) :: i
class(elpa_t), pointer :: e class(elpa_t), pointer :: e
integer :: option integer :: option
......
! This file is part of ELPA. ! This file is part of ELPA.
! !
! The ELPA library was originally created by the ELPA consortium, ! The ELPA library was originally created by the ELPA consortium,
! consisting of the following organizations: ! consisting of the following organizations:
......
...@@ -53,114 +53,113 @@ ...@@ -53,114 +53,113 @@
!> \brief Fortran module tp provide some variables for the LEGACY interface. This is obsolete, please use the new interface !> \brief Fortran module tp provide some variables for the LEGACY interface. This is obsolete, please use the new interface
module elpa2_utilities module elpa2_utilities
use elpa use elpa
use precision
implicit none implicit none
public public
integer(kind=ik), parameter :: number_of_real_kernels = ELPA_2STAGE_NUMBER_OF_REAL_KERNELS integer(kind=c_int), parameter :: number_of_real_kernels = ELPA_2STAGE_NUMBER_OF_REAL_KERNELS
integer(kind=ik), parameter :: number_of_complex_kernels = ELPA_2STAGE_NUMBER_OF_COMPLEX_KERNELS integer(kind=c_int), parameter :: number_of_complex_kernels = ELPA_2STAGE_NUMBER_OF_COMPLEX_KERNELS
#ifdef WITH_REAL_GENERIC_KERNEL #ifdef WITH_REAL_GENERIC_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_GENERIC = ELPA_2STAGE_REAL_GENERIC integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_GENERIC = ELPA_2STAGE_REAL_GENERIC
#endif #endif
#ifdef WITH_REAL_GENERIC_SIMPLE_KERNEL #ifdef WITH_REAL_GENERIC_SIMPLE_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_REAL_GENERIC_SIMPLE integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_REAL_GENERIC_SIMPLE
#endif #endif
#ifdef WITH_REAL_BGP_KERNEL #ifdef WITH_REAL_BGP_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_BGP = ELPA_2STAGE_REAL_BGP integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_BGP = ELPA_2STAGE_REAL_BGP
#endif #endif
#ifdef WITH_REAL_BGQ_KERNEL #ifdef WITH_REAL_BGQ_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_BGQ = ELPA_2STAGE_REAL_BGQ integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_BGQ = ELPA_2STAGE_REAL_BGQ
#endif #endif
#ifdef WITH_REAL_SSE_ASSEMBLY_KERNEL #ifdef WITH_REAL_SSE_ASSEMBLY_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE = ELPA_2STAGE_REAL_SSE_ASSEMBLY integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE = ELPA_2STAGE_REAL_SSE_ASSEMBLY
#endif #endif
#ifdef WITH_REAL_SSE_BLOCK2_KERNEL #ifdef WITH_REAL_SSE_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_REAL_SSE_BLOCK2 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_REAL_SSE_BLOCK2
#endif #endif
#ifdef WITH_REAL_SSE_BLOCK4_KERNEL #ifdef WITH_REAL_SSE_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK4 = ELPA_2STAGE_REAL_SSE_BLOCK4 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK4 = ELPA_2STAGE_REAL_SSE_BLOCK4
#endif #endif
#ifdef WITH_REAL_SSE_BLOCK6_KERNEL #ifdef WITH_REAL_SSE_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK6 = ELPA_2STAGE_REAL_SSE_BLOCK6 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_SSE_BLOCK6 = ELPA_2STAGE_REAL_SSE_BLOCK6
#endif #endif
#ifdef WITH_REAL_AVX_BLOCK2_KERNEL #ifdef WITH_REAL_AVX_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_REAL_AVX_BLOCK2 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_REAL_AVX_BLOCK2
#endif #endif
#ifdef WITH_REAL_AVX_BLOCK4_KERNEL #ifdef WITH_REAL_AVX_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK4 = ELPA_2STAGE_REAL_AVX_BLOCK4 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK4 = ELPA_2STAGE_REAL_AVX_BLOCK4
#endif #endif
#ifdef WITH_REAL_AVX_BLOCK6_KERNEL #ifdef WITH_REAL_AVX_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK6 = ELPA_2STAGE_REAL_AVX_BLOCK6 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX_BLOCK6 = ELPA_2STAGE_REAL_AVX_BLOCK6
#endif #endif
#ifdef WITH_REAL_AVX2_BLOCK2_KERNEL #ifdef WITH_REAL_AVX2_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_REAL_AVX2_BLOCK2 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_REAL_AVX2_BLOCK2
#endif #endif
#ifdef WITH_REAL_AVX2_BLOCK4_KERNEL #ifdef WITH_REAL_AVX2_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK4 = ELPA_2STAGE_REAL_AVX2_BLOCK4 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK4 = ELPA_2STAGE_REAL_AVX2_BLOCK4
#endif #endif
#ifdef WITH_REAL_AVX2_BLOCK6_KERNEL #ifdef WITH_REAL_AVX2_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK6 = ELPA_2STAGE_REAL_AVX2_BLOCK6 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX2_BLOCK6 = ELPA_2STAGE_REAL_AVX2_BLOCK6
#endif #endif
#ifdef WITH_REAL_AVX512_BLOCK2_KERNEL #ifdef WITH_REAL_AVX512_BLOCK2_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_REAL_AVX512_BLOCK2 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_REAL_AVX512_BLOCK2
#endif #endif
#ifdef WITH_REAL_AVX512_BLOCK4_KERNEL #ifdef WITH_REAL_AVX512_BLOCK4_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK4 = ELPA_2STAGE_REAL_AVX512_BLOCK4 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK4 = ELPA_2STAGE_REAL_AVX512_BLOCK4
#endif #endif
#ifdef WITH_REAL_AVX512_BLOCK6_KERNEL #ifdef WITH_REAL_AVX512_BLOCK6_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK6 = ELPA_2STAGE_REAL_AVX512_BLOCK6 integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_AVX512_BLOCK6 = ELPA_2STAGE_REAL_AVX512_BLOCK6
#endif #endif
#ifdef WITH_GPU_KERNEL #ifdef WITH_GPU_KERNEL
integer(kind=ik), parameter :: REAL_ELPA_KERNEL_GPU = ELPA_2STAGE_REAL_GPU integer(kind=c_int), parameter :: REAL_ELPA_KERNEL_GPU = ELPA_2STAGE_REAL_GPU
#endif #endif
integer(kind=ik), parameter :: DEFAULT_REAL_ELPA_KERNEL = ELPA_2STAGE_REAL_DEFAULT integer(kind=c_int), parameter :: DEFAULT_REAL_ELPA_KERNEL = ELPA_2STAGE_REAL_DEFAULT
#ifdef WITH_COMPLEX_GENERIC_KERNEL #ifdef WITH_COMPLEX_GENERIC_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_GENERIC = ELPA_2STAGE_COMPLEX_GENERIC integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_GENERIC = ELPA_2STAGE_COMPLEX_GENERIC
#endif #endif
#ifdef WITH_COMPLEX_GENERIC_SIMPLE_KERNEL #ifdef WITH_COMPLEX_GENERIC_SIMPLE_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_COMPLEX_GENERIC_SIMPLE integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_GENERIC_SIMPLE = ELPA_2STAGE_COMPLEX_GENERIC_SIMPLE
#endif #endif
#ifdef WITH_COMPLEX_BGP_KERNEL #ifdef WITH_COMPLEX_BGP_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_BGP = ELPA_2STAGE_COMPLEX_BGP integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_BGP = ELPA_2STAGE_COMPLEX_BGP
#endif #endif
#ifdef WITH_COMPLEX_BGQ_KERNEL #ifdef WITH_COMPLEX_BGQ_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_BGQ = ELPA_2STAGE_COMPLEX_BGQ integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_BGQ = ELPA_2STAGE_COMPLEX_BGQ
#endif #endif
#ifdef WITH_COMPLEX_SSE_ASSEMBLY_KERNEL #ifdef WITH_COMPLEX_SSE_ASSEMBLY_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_SSE = ELPA_2STAGE_COMPLEX_SSE_ASSEMBLY integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_SSE = ELPA_2STAGE_COMPLEX_SSE_ASSEMBLY
#endif #endif
#ifdef WITH_COMPLEX_SSE_BLOCK1_KERNEL #ifdef WITH_COMPLEX_SSE_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK1 = ELPA_2STAGE_COMPLEX_SSE_BLOCK1 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK1 = ELPA_2STAGE_COMPLEX_SSE_BLOCK1
#endif #endif
#ifdef WITH_COMPLEX_SSE_BLOCK2_KERNEL #ifdef WITH_COMPLEX_SSE_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_COMPLEX_SSE_BLOCK2 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_SSE_BLOCK2 = ELPA_2STAGE_COMPLEX_SSE_BLOCK2
#endif #endif
#ifdef WITH_COMPLEX_AVX_BLOCK1_KERNEL #ifdef WITH_COMPLEX_AVX_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX_BLOCK1 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX_BLOCK1
#endif #endif
#ifdef WITH_COMPLEX_AVX_BLOCK2_KERNEL #ifdef WITH_COMPLEX_AVX_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX_BLOCK2 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX_BLOCK2
#endif #endif
#ifdef WITH_COMPLEX_AVX2_BLOCK1_KERNEL #ifdef WITH_COMPLEX_AVX2_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK1 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK1
#endif #endif
#ifdef WITH_COMPLEX_AVX2_BLOCK2_KERNEL #ifdef WITH_COMPLEX_AVX2_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK2 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX2_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX2_BLOCK2
#endif #endif
#ifdef WITH_COMPLEX_AVX512_BLOCK1_KERNEL #ifdef WITH_COMPLEX_AVX512_BLOCK1_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK1 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK1 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK1
#endif #endif
#ifdef WITH_COMPLEX_AVX512_BLOCK2_KERNEL #ifdef WITH_COMPLEX_AVX512_BLOCK2_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK2 integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_AVX512_BLOCK2 = ELPA_2STAGE_COMPLEX_AVX512_BLOCK2
#endif #endif
#ifdef WITH_GPU_KERNEL #ifdef WITH_GPU_KERNEL
integer(kind=ik), parameter :: COMPLEX_ELPA_KERNEL_GPU = ELPA_2STAGE_COMPLEX_GPU integer(kind=c_int), parameter :: COMPLEX_ELPA_KERNEL_GPU = ELPA_2STAGE_COMPLEX_GPU
#endif #endif
integer(kind=ik), parameter :: DEFAULT_COMPLEX_ELPA_KERNEL = ELPA_2STAGE_COMPLEX_DEFAULT integer(kind=c_int), parameter :: DEFAULT_COMPLEX_ELPA_KERNEL = ELPA_2STAGE_COMPLEX_DEFAULT
character(35), parameter, dimension(number_of_real_kernels) :: & character(35), parameter, dimension(number_of_real_kernels) :: &
REAL_ELPA_KERNEL_NAMES = (/"REAL_ELPA_KERNEL_GENERIC ", & REAL_ELPA_KERNEL_NAMES = (/"REAL_ELPA_KERNEL_GENERIC ", &
...@@ -198,7 +197,7 @@ module elpa2_utilities ...@@ -198,7 +197,7 @@ module elpa2_utilities
"COMPLEX_ELPA_KERNEL_AVX512_BLOCK2 ", & "COMPLEX_ELPA_KERNEL_AVX512_BLOCK2 ", &
"COMPLEX_ELPA_KERNEL_GPU "/) "COMPLEX_ELPA_KERNEL_GPU "/)
integer(kind=ik), parameter :: & integer(kind=c_int), parameter :: &
AVAILABLE_REAL_ELPA_KERNELS(number_of_real_kernels) = & AVAILABLE_REAL_ELPA_KERNELS(number_of_real_kernels) = &
(/ & (/ &
#if WITH_REAL_GENERIC_KERNEL #if WITH_REAL_GENERIC_KERNEL
...@@ -295,7 +294,7 @@ module elpa2_utilities ...@@ -295,7 +294,7 @@ module elpa2_utilities
#endif #endif
/) /)
integer(kind=ik), parameter :: & integer(kind=c_int), parameter :: &
AVAILABLE_COMPLEX_ELPA_KERNELS(number_of_complex_kernels) = & AVAILABLE_COMPLEX_ELPA_KERNELS(number_of_complex_kernels) = &
(/ & (/ &
#if WITH_COMPLEX_GENERIC_KERNEL #if WITH_COMPLEX_GENERIC_KERNEL
......
...@@ -54,6 +54,7 @@ module ELPA_utilities ...@@ -54,6 +54,7 @@ module ELPA_utilities
#ifdef HAVE_ISO_FORTRAN_ENV #ifdef HAVE_ISO_FORTRAN_ENV
use iso_fortran_env, only : output_unit, error_unit use iso_fortran_env, only : output_unit, error_unit
#endif #endif
use, intrinsic :: iso_c_binding
implicit none implicit none
private ! By default, all routines contained are private private ! By default, all routines contained are private
...@@ -76,10 +77,9 @@ module ELPA_utilities ...@@ -76,10 +77,9 @@ module ELPA_utilities
!Processor col for global col number !Processor col for global col number
pure function pcol(global_col, nblk, np_cols) result(local_col) pure function pcol(global_col, nblk, np_cols) result(local_col)
use precision
implicit none implicit none
integer(kind=ik), intent(in) :: global_col, nblk, np_cols integer(kind=c_int), intent(in) :: global_col, nblk, np_cols
integer(kind=ik) :: local_col integer(kind=c_int) :: local_col
local_col = MOD((global_col-1)/nblk,np_cols) local_col = MOD((global_col-1)/nblk,np_cols)
end function end function
...@@ -87,10 +87,9 @@ module ELPA_utilities ...@@ -87,10 +87,9 @@ module ELPA_utilities
!Processor row for global row number !Processor row for global row number
pure function prow(global_row, nblk, np_rows) result(local_row) pure function prow(global_row, nblk, np_rows) result(local_row)
use precision
implicit none implicit none
integer(kind=ik), intent(in) :: global_row, nblk, np_rows integer(kind=c_int), intent(in) :: global_row, nblk, np_rows
integer(kind=ik) :: local_row integer(kind=c_int) :: local_row
local_row = MOD((global_row-1)/nblk,np_rows) local_row = MOD((global_row-1)/nblk,np_rows)
end function end function
...@@ -98,13 +97,11 @@ module ELPA_utilities ...@@ -98,13 +97,11 @@ module ELPA_utilities
function map_global_array_index_to_local_index(iGLobal, jGlobal, iLocal, jLocal , nblk, np_rows, np_cols, my_prow, my_pcol) & function map_global_array_index_to_local_index(iGLobal, jGlobal, iLocal, jLocal , nblk, np_rows, np_cols, my_prow, my_pcol) &
result(possible) result(possible)
use precision
implicit none implicit none
integer(kind=ik) :: pi, pj, li, lj, xi, xj integer(kind=c_int) :: pi, pj, li, lj, xi, xj
integer(kind=ik), intent(in) :: iGlobal, jGlobal, nblk, np_rows, np_cols, my_prow, my_pcol integer(kind=c_int), intent(in) :: iGlobal, jGlobal, nblk, np_rows, np_cols, my_prow, my_pcol
integer(kind=ik), intent(out) :: iLocal, jLocal integer(kind=c_int), intent(out) :: iLocal, jLocal
logical :: possible logical :: possible
possible = .true. possible = .true.
...@@ -157,12 +154,11 @@ module ELPA_utilities ...@@ -157,12 +154,11 @@ module ELPA_utilities
! iflag==0 : Return 0 ! iflag==0 : Return 0
! iflag> 0 : Return next local index after that row/col ! iflag> 0 : Return next local index after that row/col
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
use precision
implicit none implicit none
integer(kind=ik) :: idx, my_proc, num_procs, nblk, iflag integer(kind=c_int) :: idx, my_proc, num_procs, nblk, iflag
integer(kind=ik) :: iblk integer(kind=c_int) :: iblk
iblk = (idx-1)/nblk ! global block number, 0 based iblk = (idx-1)/nblk ! global block number, 0 based
...@@ -196,9 +192,8 @@ module ELPA_utilities ...@@ -196,9 +192,8 @@ module ELPA_utilities
! Returns the least common multiple of a and b ! Returns the least common multiple of a and b
! There may be more efficient ways to do this, we use the most simple approach ! There may be more efficient ways to do this, we use the most simple approach
use precision
implicit none implicit none
integer(kind=ik), intent(in) :: a, b integer(kind=c_int), intent(in) :: a, b
do least_common_multiple = a, a*(b-1), a do least_common_multiple = a, a*(b-1), a
if(mod(least_common_multiple,b)==0) exit if(mod(least_common_multiple,b)==0) exit
...@@ -208,13 +203,12 @@ module ELPA_utilities ...@@ -208,13 +203,12 @@ module ELPA_utilities
end function least_common_multiple end function least_common_multiple
subroutine check_alloc(function_name, variable_name, istat, errorMessage) subroutine check_alloc(function_name, variable_name, istat, errorMessage)
use precision
implicit none implicit none
character(len=*), intent(in) :: function_name character(len=*), intent(in) :: function_name
character(len=*), intent(in) :: variable_name character(len=*), intent(in) :: variable_name
integer(kind=ik), intent(in) :: istat integer(kind=c_int), intent(in) :: istat
character(len=*), intent(in) :: errorMessage character(len=*), intent(in) :: errorMessage
if (istat .ne. 0) then if (istat .ne. 0) then
...@@ -224,12 +218,11 @@ module ELPA_utilities ...@@ -224,12 +218,11 @@ module ELPA_utilities
end subroutine end subroutine
subroutine check_alloc_CUDA_f(file_name, line, successCUDA) subroutine check_alloc_CUDA_f(file_name, line, successCUDA)
use precision
implicit none implicit none
character(len=*), intent(in) :: file_name character(len=*), intent(in) :: file_name
integer(kind=ik), intent(in) :: line integer(kind=c_int), intent(in) :: line
logical :: successCUDA logical :: successCUDA
if (.not.(successCUDA)) then if (.not.(successCUDA)) then
...@@ -239,12 +232,11 @@ module ELPA_utilities ...@@ -239,12 +232,11 @@ module ELPA_utilities
end subroutine end subroutine
subroutine check_dealloc_CUDA_f(file_name, line, successCUDA) subroutine check_dealloc_CUDA_f(file_name, line, successCUDA)
use precision
implicit none implicit none
character(len=*), intent(in) :: file_name character(len=*), intent(in) :: file_name
integer(kind=ik), intent(in) :: line integer(kind=c_int), intent(in) :: line
logical :: successCUDA logical :: successCUDA
if (.not.(successCUDA)) then if (.not.(successCUDA)) then
...@@ -254,12 +246,11 @@ module ELPA_utilities ...@@ -254,12 +246,11 @@ module ELPA_utilities
end subroutine end subroutine
subroutine check_memcpy_CUDA_f(file_name, line, successCUDA) subroutine check_memcpy_CUDA_f(file_name, line, successCUDA)
use precision
implicit none implicit none
character(len=*), intent(in) :: file_name character(len=*), intent(in) :: file_name
integer(kind=ik), intent(in) :: line integer(kind=c_int), intent(in) :: line
logical :: successCUDA logical :: successCUDA
if (.not.(successCUDA)) then if (.not.(successCUDA)) then
......
...@@ -44,16 +44,15 @@ ...@@ -44,16 +44,15 @@
#include "config-f90.h" #include "config-f90.h"
!> \brief Fortran module which exports the MPI stubs function, if ELPA as been built without MPI support !> \brief Fortran module which exports the MPI stubs function, if ELPA as been built without MPI support
module elpa_mpi_stubs module elpa_mpi_stubs
use precision use iso_c_binding
implicit none implicit none
public public
integer(kind=ik), parameter :: MPI_COMM_SELF=1, MPI_COMM_WORLD=1, MPI_SUCCESS=0 integer(kind=c_int), parameter :: MPI_COMM_SELF=1, MPI_COMM_WORLD=1, MPI_SUCCESS=0
contains contains
function MPI_WTIME() result(time) function MPI_WTIME() result(time)
use iso_c_binding
#ifndef WITH_MPI #ifndef WITH_MPI
use time_c use time_c
#endif #endif
...@@ -66,14 +65,11 @@ module elpa_mpi_stubs ...@@ -66,14 +65,11 @@ module elpa_mpi_stubs
end function end function
subroutine mpi_comm_size(mpi_comm_world, ntasks, mpierr) subroutine mpi_comm_size(mpi_comm_world, ntasks, mpierr)
use precision
implicit none implicit none
integer(kind=ik), intent(in) :: mpi_comm_world integer(kind=c_int), intent(in) :: mpi_comm_world
integer(kind=ik), intent(inout) :: ntasks integer(kind=c_int), intent(inout) :: ntasks
integer(kind=ik), intent(inout) :: mpierr integer(kind=c_int), intent(inout) :: mpierr
ntasks = 1 ntasks = 1
mpierr = 0 mpierr = 0
...@@ -83,11 +79,10 @@ module elpa_mpi_stubs ...@@ -83,11 +79,10 @@ module elpa_mpi_stubs
end subroutine mpi_comm_size end subroutine mpi_comm_size
subroutine mpi_comm_rank(mpi_comm_world, myid, mpierr) subroutine mpi_comm_rank(mpi_comm_world, myid, mpierr)
use precision
implicit none implicit none
integer(kind=ik), intent(in) :: mpi_comm_world integer(kind=c_int), intent(in) :: mpi_comm_world
integer(kind=ik), intent(inout) :: mpierr integer(kind=c_int), intent(inout) :: mpierr
integer(kind=ik), intent(inout) :: myid integer(kind=c_int), intent(inout) :: myid
myid = 0 myid = 0
mpierr = 0 mpierr = 0
...@@ -96,10 +91,9 @@ module elpa_mpi_stubs ...@@ -96,10 +91,9 @@ module elpa_mpi_stubs
end subroutine mpi_comm_rank end subroutine mpi_comm_rank
subroutine mpi_comm_split(mpi_communicator, color, key, new_comm, mpierr) subroutine mpi_comm_split(mpi_communicator, color, key, new_comm, mpierr)
use precision
implicit none implicit none
integer(kind=ik), intent(in) :: mpi_communicator, color, key integer(kind=c_int), intent(in) :: mpi_communicator, color, key
integer(kind=ik), intent(inout) :: new_comm, mpierr integer(kind=c_int), intent(inout) :: new_comm, mpierr
new_comm = mpi_communicator new_comm = mpi_communicator
mpierr = 0 mpierr = 0
......
...@@ -77,27 +77,19 @@ program test_complex2 ...@@ -77,27 +77,19 @@ program test_complex2
! with their original authors, but shall adhere to the licensing terms ! with their original authors, but shall adhere to the licensing terms
! distributed along with the original code in the file "COPYING". ! distributed along with the original code in the file "COPYING".
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
use precision
use elpa_driver use elpa_driver
use elpa_utilities, only<