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

Merge branch 'master_test' into 'master_pre_stage'

ELPA can compile on Fugaku

See merge request !64
parents 72d5ce75 eaa3de6c
......@@ -636,9 +636,12 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = @PKG_CONFIG_FILE@
# programs
if BUILD_FUGAKU
bin_PROGRAMS =
else
bin_PROGRAMS = \
elpa2_print_kernels@SUFFIX@
endif
noinst_PROGRAMS =
check_SCRIPTS =
......@@ -672,10 +675,12 @@ libelpatest@SUFFIX@_la_SOURCES += \
test/shared/test_redirect.F90
endif
if BUILD_FUGAKU
else
elpa2_print_kernels@SUFFIX@_SOURCES = src/elpa2/elpa2_print_kernels.F90
elpa2_print_kernels@SUFFIX@_LDADD = libelpa@SUFFIX@.la
elpa2_print_kernels@SUFFIX@_FCFLAGS = $(AM_FCFLAGS) $(FC_MODINC)modules
endif
include test_programs.am
......
......@@ -398,11 +398,22 @@ if test x"${enable_openmp}" = x"yes"; then
FCFLAGS="$OPENMP_FCFLAGS $FCFLAGS"
fi
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 launcher])],
[want_mpi_launcher="$enableval"],
[want_mpi_launcher="yes"])
AC_MSG_RESULT([${want_mpi_launcher}])
dnl check which MPI binray invokes a MPI job
if test x"$with_mpi" = x"yes"; then
AC_CHECK_PROGS([MPI_BINARY], [mpiexec.hydra mpiexec mpirun poe runjob srun aprun], [no])
if test x"$MPI_BINARY" = x"no"; then
AC_MSG_ERROR([Could not find either of the MPI binaries: mpiexec.hydra, mpiexec, mpirun, poe, runjob, srun, aprun])
if test x"$want_mpi_launcher" = x"yes"; then
AC_CHECK_PROGS([MPI_BINARY], [mpiexec.hydra mpiexec mpirun poe runjob srun aprun], [no])
if test x"$MPI_BINARY" = x"no"; then
AC_MSG_ERROR([Could not find either of the MPI binaries: mpiexec.hydra, mpiexec, mpirun, poe, runjob, srun, aprun])
fi
fi
fi
......@@ -1962,6 +1973,23 @@ 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 FUGAKU, default no.]),
[if test x"$enableval" = x"yes"; then
enable_fugaku=yes
else
enable_fugaku=no
fi],
[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"
fi
AC_MSG_CHECKING(whether we build for NEC SX-Auroa)
AC_ARG_ENABLE([SX-Aurora],
AS_HELP_STRING([--enable-SX-Aurora],
......@@ -2098,7 +2126,11 @@ AC_CONFIG_FILES([
m4_include([m4/ax_fc_check_define.m4])
AC_MSG_CHECKING([if workaround for broken preprocessor is needed])
need_manual_cpp=no
if test x"${enable_fugaku}" = x"yes"; then
need_manual_cpp=yes
else
need_manual_cpp=no
fi
AX_FC_CHECK_DEFINE([__INTEL_COMPILER],[is_intel=yes],[])
AX_FC_CHECK_DEFINE([__PGI],[is_pgi=yes],[])
ACTUAL_FC="$FC"
......
......@@ -74,6 +74,7 @@ for lang, m, g, gid, q, t, p, d, s, lay, spl in product(sorted(language_flag.key
sorted(solver_flag.keys()),
sorted(layout_flag.keys()),
sorted(split_comm_flag.keys())):
if gid == 1 and (g == 0 ):
continue
......@@ -207,50 +208,107 @@ for lang, m, g, gid, q, t, p, d, s, lay, spl in product(sorted(language_flag.key
layoutsuffix="_all_layouts" if lay == "all_layouts" else "",
spl="_split_comm_myself" if spl == "myself" else "")
print("if BUILD_KCOMPUTER")
print("bin_PROGRAMS += " + name)
print("else")
print("noinst_PROGRAMS += " + name)
print("endif")
if lay == "square" or t == "generalized":
if kernel == "all_kernels":
print("check_SCRIPTS += " + name + "_extended.sh")
else:
print("check_SCRIPTS += " + name + "_default.sh")
elif lay == "all_layouts":
if kernel == "all_kernels":
print("check_SCRIPTS += " + name + "_extended.sh")
else:
print("check_SCRIPTS += " + name + "_extended.sh")
if (m == "analytic"):
print("if BUILD_FUGAKU")
print("else")
print("if BUILD_KCOMPUTER")
print("bin_PROGRAMS += " + name)
print("else")
print("noinst_PROGRAMS += " + name)
print("endif")
print("endif")
else:
raise Exception("Unknown layout {0}".format(lay))
if lang == "Fortran":
print(name + "_SOURCES = test/Fortran/test.F90")
print(name + "_LDADD = $(test_program_ldadd)")
print(name + "_FCFLAGS = $(test_program_fcflags) \\")
elif lang == "C":
print(name + "_SOURCES = test/C/test.c")
print(name + "_LDADD = $(test_program_ldadd) $(FCLIBS)")
print(name + "_CFLAGS = $(test_program_cflags) \\")
print("if BUILD_KCOMPUTER")
print("bin_PROGRAMS += " + name)
print("else")
print("noinst_PROGRAMS += " + name)
print("endif")
if (m == "analytic"):
print("if BUILD_FUGAKU")
print("else")
if lay == "square" or t == "generalized":
if kernel == "all_kernels":
print("check_SCRIPTS += " + name + "_extended.sh")
else:
print("check_SCRIPTS += " + name + "_default.sh")
elif lay == "all_layouts":
if kernel == "all_kernels":
print("check_SCRIPTS += " + name + "_extended.sh")
else:
print("check_SCRIPTS += " + name + "_extended.sh")
else:
raise Exception("Unknown layout {0}".format(lay))
if lang == "Fortran":
print(name + "_SOURCES = test/Fortran/test.F90")
print(name + "_LDADD = $(test_program_ldadd)")
print(name + "_FCFLAGS = $(test_program_fcflags) \\")
elif lang == "C":
print(name + "_SOURCES = test/C/test.c")
print(name + "_LDADD = $(test_program_ldadd) $(FCLIBS)")
print(name + "_CFLAGS = $(test_program_cflags) \\")
else:
raise Exception("Unknown language")
print(" -DTEST_CASE=\\\"{0}\\\" \\".format(name))
print(" " + " \\\n ".join([
domain_flag[d],
prec_flag[p],
test_type_flag[t],
solver_flag[s],
gpu_flag[g],
gpu_id_flag[gid],
qr_flag[q],
matrix_flag[m]] + extra_flags))
print("endif\n" * endifs)
print("")
print("endif")
print("")
else:
raise Exception("Unknown language")
print(" -DTEST_CASE=\\\"{0}\\\" \\".format(name))
print(" " + " \\\n ".join([
domain_flag[d],
prec_flag[p],
test_type_flag[t],
solver_flag[s],
gpu_flag[g],
gpu_id_flag[gid],
qr_flag[q],
matrix_flag[m]] + extra_flags))
print("endif\n" * endifs)
if lay == "square" or t == "generalized":
if kernel == "all_kernels":
print("check_SCRIPTS += " + name + "_extended.sh")
else:
print("check_SCRIPTS += " + name + "_default.sh")
elif lay == "all_layouts":
if kernel == "all_kernels":
print("check_SCRIPTS += " + name + "_extended.sh")
else:
print("check_SCRIPTS += " + name + "_extended.sh")
else:
raise Exception("Unknown layout {0}".format(lay))
if lang == "Fortran":
print(name + "_SOURCES = test/Fortran/test.F90")
print(name + "_LDADD = $(test_program_ldadd)")
print(name + "_FCFLAGS = $(test_program_fcflags) \\")
elif lang == "C":
print(name + "_SOURCES = test/C/test.c")
print(name + "_LDADD = $(test_program_ldadd) $(FCLIBS)")
print(name + "_CFLAGS = $(test_program_cflags) \\")
else:
raise Exception("Unknown language")
print(" -DTEST_CASE=\\\"{0}\\\" \\".format(name))
print(" " + " \\\n ".join([
domain_flag[d],
prec_flag[p],
test_type_flag[t],
solver_flag[s],
gpu_flag[g],
gpu_id_flag[gid],
qr_flag[q],
matrix_flag[m]] + extra_flags))
print("endif\n" * endifs)
print("")
for lang, p, d in product(sorted(language_flag.keys()), sorted(prec_flag.keys()), sorted(domain_flag.keys())):
......
......@@ -193,8 +193,12 @@ program test
TEST_INT_TYPE :: i
#endif
#ifdef TEST_ALL_LAYOUTS
character(len=1), parameter :: layouts(2) = [ 'C', 'R' ]
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
......@@ -216,6 +220,13 @@ program test
character(len=MPI_MAX_ERROR_STRING) :: mpierr_string
#endif
#ifdef TEST_ALL_LAYOUTS
#ifdef BUILD_FUGAKU
layouts(1) = 'C'
layouts(2) = 'R'
#endif
#endif
ignoreError = .false.
call read_input_parameters_traditional(na, nev, nblk, write_to_file, skip_check_correctness)
......
......@@ -104,7 +104,11 @@ module test_analytic
end interface
TEST_INT_TYPE, parameter, private :: num_primes = 3
#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
......@@ -119,6 +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
......@@ -140,6 +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,6 +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)
......@@ -456,11 +461,14 @@
total_level = total_level + 1
if(what == ANALYTIC_MATRIX) then
#ifdef REALCASE
#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
#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/))
......@@ -468,9 +476,11 @@
! 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)
#endif
#endif
else if(what == ANALYTIC_EIGENVECTORS) then
#ifdef REALCASE
#ifndef FUGAKU
mat2x2 = reshape((/ c, s, &
-s, c /), &
(/2, 2/), order=(/2,1/))
......@@ -479,7 +489,9 @@
mat2x2(1,2) = s
mat2x2(2,1) = -s
#endif
#endif
#ifdef COMPLEXCASE
#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/))
......@@ -487,27 +499,36 @@
! 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)
#endif
#endif
else if(what == ANALYTIC_EIGENVALUES) then
#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
#ifndef BUILD_FUGAKU
mat(1:2, 1:2) = mat2x2
#endif
else if(prime == 3) then
#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
#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
......@@ -639,8 +660,13 @@
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)
#endif
if(myid == 0) print *, "Checking test_analytic module sanity.... "
#ifndef BUILD_FUGAKU
#ifdef HAVE_64BIT_INTEGER_MATH_SUPPORT
assert(decompose(1500_lik, decomposition))
#else
......@@ -654,6 +680,14 @@
#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&
......@@ -663,5 +697,5 @@
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