Commit a312b026 authored by Andreas Marek's avatar Andreas Marek
Browse files

ifdefs for FUGAKU

parent f7848512
......@@ -397,7 +397,7 @@ want_mpi_launcher="no"
AC_MSG_CHECKING(whether mpi-launcher should be detected)
AC_ARG_ENABLE(detect-mpi-launcher,
[AS_HELP_STRING([--enable-detect-mpi-launcher],
[detect mpi launcer])],
[detect mpi launcher])],
[want_mpi_launcher="$enableval"],
[want_mpi_launcher="yes"])
AC_MSG_RESULT([${want_mpi_launcher}])
......@@ -1777,10 +1777,10 @@ if test x"${enable_kcomputer}" = x"yes"; then
fi
fi
AC_MSG_CHECKING(whether we build for Fugaku)
AC_ARG_ENABLE([Fugaku],
AS_HELP_STRING([--enable-Fugaku],
[enable builds on Fugaki, default no.]),
AC_MSG_CHECKING(whether we build for FUGAKU)
AC_ARG_ENABLE([FUGAKU],
AS_HELP_STRING([--enable-FUGAKU],
[enable builds on FUGAKU, default no.]),
[if test x"$enableval" = x"yes"; then
enable_fugaku=yes
else
......@@ -1789,19 +1789,11 @@ AC_ARG_ENABLE([Fugaku],
[enable_fugaku=no])
AC_MSG_RESULT([${enable_fugaku}])
AM_CONDITIONAL([BUILD_FUGAKU],[test x"$enable_fugaku" = x"yes"])
if test x"${enable_fugaku}" = x"yes"; then
AC_DEFINE([BUILD_FUGAKU], [1], [build for Fugaku])
#FC_MODINC="-I"
#if test x"${USE_ASSUMED_SIZE}" = x"yes" ; then
# AC_MSG_ERROR(on K-computer you have to switch off assumed-size arrays!)
#fi
#if test x"${enable_fortran2008_features}" = x"yes" ; then
# AC_MSG_ERROR(on K-computer you have to switch off Fortran 2008 features!)
#fi
if test x"${enable_fugalu}" = x"yes"; then
AC_DEFINE([BUILD_FUGAKU], [1], [build for FUGAKU])
FC_MODINC="-I"
fi
AC_MSG_CHECKING(whether we build for NEC SX-Auroa)
AC_ARG_ENABLE([SX-Aurora],
AS_HELP_STRING([--enable-SX-Aurora],
......
......@@ -184,9 +184,12 @@ program test
TEST_INT_TYPE :: i
#endif
#ifdef TEST_ALL_LAYOUTS
!character(len=1), parameter :: layouts(2) = [ 'C', 'R' ]
character(len=1) :: layouts(2)
TEST_INT_TYPE :: i_layout
#ifdef BUILD_FUGAKU
character(len=1) :: layouts(2)
#else
character(len=1), parameter :: layouts(2) = [ 'C', 'R' ]
#endif
#endif
integer(kind=c_int):: kernel
character(len=1) :: layout
......@@ -209,8 +212,10 @@ program test
#endif
#ifdef TEST_ALL_LAYOUTS
#ifdef BUILD_FUGAKU
layouts(1) = 'C'
layouts(2) = 'R'
#endif
#endif
ignoreError = .false.
......
......@@ -104,8 +104,11 @@ module test_analytic
end interface
TEST_INT_TYPE, parameter, private :: num_primes = 3
!TEST_INT_TYPE, parameter, private :: primes(num_primes) = (/2,3,5/)
#ifdef BUILD_FUGAKU
TEST_INT_TYPE, private :: primes(num_primes)
#else
TEST_INT_TYPE, parameter, private :: primes(num_primes) = (/2,3,5/)
#endif
TEST_INT_TYPE, parameter, private :: ANALYTIC_MATRIX = 0
TEST_INT_TYPE, parameter, private :: ANALYTIC_EIGENVECTORS = 1
......@@ -120,9 +123,11 @@ module test_analytic
logical :: possible
TEST_INT_TYPE :: reminder, prime, prime_id
#ifdef BUILD_FUGAKU
primes(1) = 2
primes(2) = 3
primes(3) = 5
#endif
decomposition = 0
possible = .true.
reminder = num
......@@ -144,9 +149,11 @@ module test_analytic
TEST_INT_TYPE :: num, prime_id
num = 1;
#ifdef BUILD_FUGAKU
primes(1) = 2
primes(2) = 3
primes(3) = 5
#endif
do prime_id = 1, num_primes
num = num * primes(prime_id) ** decomposition(prime_id)
end do
......
......@@ -449,9 +449,11 @@
#endif
total_level = 0
am = a
#ifdef BUILD_FUGAKU
primes(1) = 2
primes(2) = 3
primes(3) = 5
#endif
do prime_id = 1,num_primes
prime = primes(prime_id)
do level = 1, levels(prime_id)
......@@ -459,58 +461,74 @@
total_level = total_level + 1
if(what == ANALYTIC_MATRIX) then
#ifdef REALCASE
!mat2x2 = reshape((/ c*c + amp * s*s, (amp - 1.0_rk) * s*c, &
! (amp - 1.0_rk) * s*c, s*s + amp * c*c /), &
! (/2, 2/), order=(/2,1/))
#ifndef FUGAKU
mat2x2 = reshape((/ c*c + amp * s*s, (amp - 1.0_rk) * s*c, &
(amp - 1.0_rk) * s*c, s*s + amp * c*c /), &
(/2, 2/), order=(/2,1/))
#endif
#endif
#ifdef COMPLEXCASE
!mat2x2 = reshape((/ 0.5_rck * (amp + 1.0_rck) * (1.0_rk, 0.0_rk), sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, 1.0_rk), &
! sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, -1.0_rk), 0.5_rck * (amp + 1.0_rck) * (1.0_rk, 0.0_rk) /), &
! (/2, 2/), order=(/2,1/))
#ifndef FUGAKU
mat2x2 = reshape((/ 0.5_rck * (amp + 1.0_rck) * (1.0_rk, 0.0_rk), sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, 1.0_rk), &
sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, -1.0_rk), 0.5_rck * (amp + 1.0_rck) * (1.0_rk, 0.0_rk) /), &
(/2, 2/), order=(/2,1/))
! intel 2018 does not reshape correctly (one would have to specify order=(/1,2/)
! until this is resolved, I resorted to the following
!mat2x2(1,2) = sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, 1.0_rk)
!mat2x2(2,1) = sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, -1.0_rk)
mat2x2(1,2) = sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, 1.0_rk)
mat2x2(2,1) = sq2/4.0_rk * (amp - 1.0_rk) * (1.0_rk, -1.0_rk)
#endif
#endif
else if(what == ANALYTIC_EIGENVECTORS) then
#ifdef REALCASE
!mat2x2 = reshape((/ c, s, &
! -s, c /), &
! (/2, 2/), order=(/2,1/))
#ifndef FUGAKU
mat2x2 = reshape((/ c, s, &
-s, c /), &
(/2, 2/), order=(/2,1/))
! intel 2018 does not reshape correctly (one would have to specify order=(/1,2/)
! until this is resolved, I resorted to the following
!mat2x2(1,2) = s
!mat2x2(2,1) = -s
mat2x2(1,2) = s
mat2x2(2,1) = -s
#endif
#endif
#ifdef COMPLEXCASE
!mat2x2 = reshape((/ -sq2/2.0_rck * (1.0_rk, 0.0_rk), -sq2/2.0_rck * (1.0_rk, 0.0_rk), &
! 0.5_rk * (1.0_rk, -1.0_rk), 0.5_rk * (-1.0_rk, 1.0_rk) /), &
! (/2, 2/), order=(/2,1/))
#ifndef FUGAKU
mat2x2 = reshape((/ -sq2/2.0_rck * (1.0_rk, 0.0_rk), -sq2/2.0_rck * (1.0_rk, 0.0_rk), &
0.5_rk * (1.0_rk, -1.0_rk), 0.5_rk * (-1.0_rk, 1.0_rk) /), &
(/2, 2/), order=(/2,1/))
! intel 2018 does not reshape correctly (one would have to specify order=(/1,2/)
! until this is resolved, I resorted to the following
!mat2x2(1,2) = -sq2/2.0_rck * (1.0_rk, 0.0_rk)
!mat2x2(2,1) = 0.5_rk * (1.0_rk, -1.0_rk)
mat2x2(1,2) = -sq2/2.0_rck * (1.0_rk, 0.0_rk)
mat2x2(2,1) = 0.5_rk * (1.0_rk, -1.0_rk)
#endif
#endif
else if(what == ANALYTIC_EIGENVALUES) then
!mat2x2 = reshape((/ 1.0_rck, 0.0_rck, &
! 0.0_rck, amp /), &
! (/2, 2/), order=(/2,1/))
#ifndef FUGAKU
mat2x2 = reshape((/ 1.0_rck, 0.0_rck, &
0.0_rck, amp /), &
(/2, 2/), order=(/2,1/))
#endif
else
assert(.false.)
end if
mat = 0.0_rck
if(prime == 2) then
!mat(1:2, 1:2) = mat2x2
#ifndef BUILD_FUGAKU
mat(1:2, 1:2) = mat2x2
#endif
else if(prime == 3) then
!mat((/1,3/),(/1,3/)) = mat2x2
#ifndef BUILD_FUGAKU
mat((/1,3/),(/1,3/)) = mat2x2
#endif
if(what == ANALYTIC_EIGENVECTORS) then
mat(2,2) = 1.0_rck
else
mat(2,2) = am
end if
else if(prime == 5) then
!mat((/1,5/),(/1,5/)) = mat2x2
#ifndef BUILD_FUGAKU
mat((/1,5/),(/1,5/)) = mat2x2
#endif
if(what == ANALYTIC_EIGENVECTORS) then
mat(2,2) = 1.0_rck
mat(3,3) = 1.0_rck
......@@ -642,36 +660,42 @@
implicit none
TEST_INT_TYPE, intent(in) :: myid
TEST_INT_TYPE :: decomposition(num_primes), i
#ifndef BUILD_FUGAKU
TEST_INT_TYPE, parameter :: check_sizes(7) = (/2, 3, 5, 6, 10, 25, 150/)
#else
TEST_INT_TYPE :: check_sizes(7)
!TEST_INT_TYPE, parameter :: check_sizes(7) = (/2, 3, 5, 6, 10, 25, 150/)
#endif
if(myid == 0) print *, "Checking test_analytic module sanity.... "
!#ifdef HAVE_64BIT_INTEGER_MATH_SUPPORT
! assert(decompose(1500_lik, decomposition))
!#else
! assert(decompose(1500_ik, decomposition))
!#endif
! assert(all(decomposition == (/2,1,3/)))
!#ifdef HAVE_64BIT_INTEGER_MATH_SUPPORT
! assert(decompose(6_lik,decomposition))
!#else
! assert(decompose(6_ik,decomposition))
!#endif
! assert(all(decomposition == (/1,1,0/)))
!
! check_sizes(1) = 2
! check_sizes(2) = 3
! check_sizes(3) = 5
! check_sizes(4) = 10
! check_sizes(5) = 25
! check_sizes(6) = 150
! do i =1, size(check_sizes)
! call check_matrices_&
! &MATH_DATATYPE&
! &_&
! &PRECISION&
! &(myid, check_sizes(i))
! end do
!
! if(myid == 0) print *, "Checking test_analytic module sanity.... DONE"
#ifndef BUILD_FUGAKU
#ifdef HAVE_64BIT_INTEGER_MATH_SUPPORT
assert(decompose(1500_lik, decomposition))
#else
assert(decompose(1500_ik, decomposition))
#endif
assert(all(decomposition == (/2,1,3/)))
#ifdef HAVE_64BIT_INTEGER_MATH_SUPPORT
assert(decompose(6_lik,decomposition))
#else
assert(decompose(6_ik,decomposition))
#endif
assert(all(decomposition == (/1,1,0/)))
#ifdef BUILD_FUGAKU
check_sizes(1) = 2
check_sizes(2) = 3
check_sizes(3) = 5
check_sizes(4) = 10
check_sizes(5) = 25
check_sizes(6) = 150
#endif
do i =1, size(check_sizes)
call check_matrices_&
&MATH_DATATYPE&
&_&
&PRECISION&
&(myid, check_sizes(i))
end do
if(myid == 0) print *, "Checking test_analytic module sanity.... DONE"
#endif
end subroutine
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