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

Test programs for QR with new API directly

parent faf3aacc
...@@ -30,6 +30,7 @@ test_type_flag = { ...@@ -30,6 +30,7 @@ test_type_flag = {
"solve_tridiagonal" : "-DTEST_SOLVE_TRIDIAGONAL", "solve_tridiagonal" : "-DTEST_SOLVE_TRIDIAGONAL",
"cholesky" : "-DTEST_CHOLESKY", "cholesky" : "-DTEST_CHOLESKY",
"hermitian_multiply" : "-DTEST_HERMITIAN_MULTIPLY", "hermitian_multiply" : "-DTEST_HERMITIAN_MULTIPLY",
"qr" : "-DTEST_QR_DECOMPOSITION",
} }
layout_flag = { layout_flag = {
...@@ -62,6 +63,9 @@ for m, g, t, p, d, s, l in product( ...@@ -62,6 +63,9 @@ for m, g, t, p, d, s, l in product(
if (t == "hermitian_multiply" and (s == "2stage")): if (t == "hermitian_multiply" and (s == "2stage")):
continue continue
if (t == "qr" and (s == "1stage" or d == "complex")):
continue
for kernel in ["all_kernels", "default_kernel"] if s == "2stage" else ["nokernel"]: for kernel in ["all_kernels", "default_kernel"] if s == "2stage" else ["nokernel"]:
endifs = 0 endifs = 0
extra_flags = [] extra_flags = []
......
...@@ -143,7 +143,7 @@ program test ...@@ -143,7 +143,7 @@ program test
! eigenvalues ! eigenvalues
EV_TYPE, allocatable :: ev(:), ev_analytic(:) EV_TYPE, allocatable :: ev(:), ev_analytic(:)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_HERMITIAN_MULTIPLY) #if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION) || defined(TEST_HERMITIAN_MULTIPLY)
EV_TYPE, allocatable :: d(:), sd(:), ds(:), sds(:) EV_TYPE, allocatable :: d(:), sd(:), ds(:), sds(:)
EV_TYPE :: diagonalELement, subdiagonalElement EV_TYPE :: diagonalELement, subdiagonalElement
#endif #endif
...@@ -187,6 +187,8 @@ program test ...@@ -187,6 +187,8 @@ program test
#endif #endif
#endif #endif
if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then if (elpa_init(CURRENT_API_VERSION) /= ELPA_OK) then
print *, "ELPA API version not supported" print *, "ELPA API version not supported"
stop 1 stop 1
...@@ -226,6 +228,29 @@ program test ...@@ -226,6 +228,29 @@ program test
print *,'' print *,''
endif endif
#ifdef TEST_QR_DECOMPOSITION
#if TEST_GPU == 1
#ifdef WITH_MPI
call mpi_finalize(mpierr)
#endif
stop 77
#endif
if (nblk .lt. 64) then
if (myid .eq. 0) then
print *,"At the moment QR decomposition need blocksize of at least 64"
endif
if ((na .lt. 64) .and. (myid .eq. 0)) then
print *,"This is why the matrix size must also be at least 64 or only 1 MPI task can be used"
endif
#ifdef WITH_MPI
call mpi_finalize(mpierr)
#endif
stop 77
endif
#endif
call set_up_blacsgrid(mpi_comm_world, np_rows, np_cols, layout, & call set_up_blacsgrid(mpi_comm_world, np_rows, np_cols, layout, &
my_blacs_ctxt, my_prow, my_pcol) my_blacs_ctxt, my_prow, my_pcol)
...@@ -242,7 +267,7 @@ program test ...@@ -242,7 +267,7 @@ program test
allocate(c (na_rows,na_cols)) allocate(c (na_rows,na_cols))
#endif #endif
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_CHOLESKY) #if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION) || defined(TEST_CHOLESKY)
allocate(d (na), ds(na)) allocate(d (na), ds(na))
allocate(sd (na), sds(na)) allocate(sd (na), sds(na))
allocate(ev_analytic(na)) allocate(ev_analytic(na))
...@@ -252,7 +277,7 @@ program test ...@@ -252,7 +277,7 @@ program test
z(:,:) = 0.0 z(:,:) = 0.0
ev(:) = 0.0 ev(:) = 0.0
#if defined(TEST_EIGENVECTORS) || defined(TEST_HERMITIAN_MULTIPLY) #if defined(TEST_EIGENVECTORS) || defined(TEST_HERMITIAN_MULTIPLY) || defined(TEST_QR_DECOMPOSITION)
#ifdef TEST_MATRIX_ANALYTIC #ifdef TEST_MATRIX_ANALYTIC
call prepare_matrix_analytic(na, a, nblk, myid, np_rows, np_cols, my_prow, my_pcol) call prepare_matrix_analytic(na, a, nblk, myid, np_rows, np_cols, my_prow, my_pcol)
as(:,:) = a as(:,:) = a
...@@ -301,7 +326,7 @@ program test ...@@ -301,7 +326,7 @@ program test
#endif /* TEST_HERMITIAN_MULTIPLY */ #endif /* TEST_HERMITIAN_MULTIPLY */
#endif /* TEST_MATRIX_ANALYTIC */ #endif /* TEST_MATRIX_ANALYTIC */
#endif /* defined(TEST_EIGENVECTORS) || defined(TEST_HERMITIAN_MULTIPLY) */ #endif /* defined(TEST_EIGENVECTORS) || defined(TEST_HERMITIAN_MULTIPLY) || defined(TEST_QR_DECOMPOSITION) */
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) #if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL)
...@@ -369,6 +394,11 @@ program test ...@@ -369,6 +394,11 @@ program test
call e%set("gpu", TEST_GPU, error) call e%set("gpu", TEST_GPU, error)
assert_elpa_ok(error) assert_elpa_ok(error)
#ifdef TEST_QR_DECOMPOSITION
call e%set("qr", 1, error)
assert_elpa_ok(error)
#endif
if (myid == 0) print *, "" if (myid == 0) print *, ""
#ifdef TEST_ALL_KERNELS #ifdef TEST_ALL_KERNELS
...@@ -400,7 +430,7 @@ program test ...@@ -400,7 +430,7 @@ program test
#endif #endif
! The actual solve step ! The actual solve step
#ifdef TEST_EIGENVECTORS #if defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION)
call e%timer_start("e%eigenvectors()") call e%timer_start("e%eigenvectors()")
#ifdef TEST_SCALAPACK_ALL #ifdef TEST_SCALAPACK_ALL
call solve_scalapack_all(na, a, sc_desc, ev, z) call solve_scalapack_all(na, a, sc_desc, ev, z)
...@@ -408,7 +438,7 @@ program test ...@@ -408,7 +438,7 @@ program test
call e%eigenvectors(a, ev, z, error) call e%eigenvectors(a, ev, z, error)
#endif #endif
call e%timer_stop("e%eigenvectors()") call e%timer_stop("e%eigenvectors()")
#endif /* TEST_EIGENVECTORS */ #endif /* TEST_EIGENVECTORS || defined(TEST_QR_DECOMPOSITION) */
#ifdef TEST_EIGENVALUES #ifdef TEST_EIGENVALUES
call e%timer_start("e%eigenvalues()") call e%timer_start("e%eigenvalues()")
...@@ -446,7 +476,7 @@ program test ...@@ -446,7 +476,7 @@ program test
call e%print_times(elpa_int_value_to_string(KERNEL_KEY, kernel)) call e%print_times(elpa_int_value_to_string(KERNEL_KEY, kernel))
#else /* TEST_ALL_KERNELS */ #else /* TEST_ALL_KERNELS */
#ifdef TEST_EIGENVECTORS #if defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION)
call e%print_times("e%eigenvectors()") call e%print_times("e%eigenvectors()")
#endif #endif
#ifdef TEST_EIGENVALUES #ifdef TEST_EIGENVALUES
...@@ -464,7 +494,7 @@ program test ...@@ -464,7 +494,7 @@ program test
#endif /* TEST_ALL_KERNELS */ #endif /* TEST_ALL_KERNELS */
endif endif
#ifdef TEST_EIGENVECTORS #if defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION)
#ifdef TEST_MATRIX_ANALYTIC #ifdef TEST_MATRIX_ANALYTIC
status = check_correctness_analytic(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol) status = check_correctness_analytic(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol)
#else #else
...@@ -591,7 +621,7 @@ program test ...@@ -591,7 +621,7 @@ program test
#ifdef TEST_ALL_KERNELS #ifdef TEST_ALL_KERNELS
a(:,:) = as(:,:) a(:,:) = as(:,:)
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_CHOLESKY) #if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION) || defined(TEST_CHOLESKY)
d = ds d = ds
sd = sds sd = sds
#endif #endif
...@@ -610,7 +640,7 @@ program test ...@@ -610,7 +640,7 @@ program test
deallocate(c) deallocate(c)
#endif #endif
#if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_CHOLESKY) #if defined(TEST_EIGENVALUES) || defined(TEST_SOLVE_TRIDIAGONAL) || defined(TEST_EIGENVECTORS) || defined(TEST_QR_DECOMPOSITION) || defined(TEST_CHOLESKY)
deallocate(d, ds) deallocate(d, ds)
deallocate(sd, sds) deallocate(sd, sds)
deallocate(ev_analytic) deallocate(ev_analytic)
......
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