From c914a6af11d4833c9c0a9663f51b0e7db68c087b Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Sun, 2 Jun 2024 18:11:35 +0000 Subject: [PATCH 01/16] update spack and use +gfortran variant --- ci/ci-common.yml | 4 ++-- ci/docker/common.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/ci-common.yml b/ci/ci-common.yml index e7ca6e6..941f342 100644 --- a/ci/ci-common.yml +++ b/ci/ci-common.yml @@ -29,8 +29,8 @@ stages: reports: dotenv: build.env variables: - SPACK_SHA: develop-2024-05-26 - SPACK_BUILDCACHE: develop-2024-05-26 + SPACK_SHA: develop-2024-06-02 + SPACK_BUILDCACHE: develop-2024-06-02 SPACK_DLAF_FORTRAN_REPO: ./spack DOCKER_BUILD_ARGS: '[ "BASE_IMAGE", diff --git a/ci/docker/common.yaml b/ci/docker/common.yaml index 13334dd..28b8e83 100644 --- a/ci/docker/common.yaml +++ b/ci/docker/common.yaml @@ -26,6 +26,7 @@ packages: require: - 'threads=openmp' - '+cluster' + - '+gfortran' openblas: variants: - 'threads=openmp' From d3e01a6dbc208e44fc2ffdb18c813904eea1df78 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Fri, 21 Jun 2024 12:47:05 +0000 Subject: [PATCH 02/16] sed gvx to gvd --- src/dlaf_fortran.f90 | 50 ++++++++++----------- test/CMakeLists.txt | 4 +- test/helpers/CMakeLists.txt | 2 +- test/helpers/{pxhegvx.fypp => pxhegvd.fypp} | 18 ++++---- test/{pzhegvx.f90 => pchegvd.f90} | 8 ++-- test/{pchegvx.f90 => pdsygvd.f90} | 8 ++-- test/{pdsygvx.f90 => pssygvd.f90} | 8 ++-- test/{pssygvx.f90 => pzhegvd.f90} | 8 ++-- 8 files changed, 53 insertions(+), 53 deletions(-) rename test/helpers/{pxhegvx.fypp => pxhegvd.fypp} (96%) rename test/{pzhegvx.f90 => pchegvd.f90} (68%) rename test/{pchegvx.f90 => pdsygvd.f90} (68%) rename test/{pdsygvx.f90 => pssygvd.f90} (68%) rename test/{pssygvx.f90 => pzhegvd.f90} (68%) diff --git a/src/dlaf_fortran.f90 b/src/dlaf_fortran.f90 index b8756f0..747b97e 100644 --- a/src/dlaf_fortran.f90 +++ b/src/dlaf_fortran.f90 @@ -29,7 +29,7 @@ module dlaf_fortran public :: dlaf_create_grid_from_blacs, dlaf_free_grid public :: dlaf_pspotrf, dlaf_pdpotrf, dlaf_pcpotrf, dlaf_pzpotrf public :: dlaf_pssyevd, dlaf_pdsyevd, dlaf_pcheevd, dlaf_pzheevd - public :: dlaf_pssygvx, dlaf_pdsygvx, dlaf_pchegvx, dlaf_pzhegvx + public :: dlaf_pssygvd, dlaf_pdsygvd, dlaf_pchegvd, dlaf_pzhegvd contains @@ -337,7 +337,7 @@ end subroutine dlaf_pzheevd_c end subroutine dlaf_pzheevd - subroutine dlaf_pssygvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + subroutine dlaf_pssygvd(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz integer, dimension(9), intent(in) :: desca, descb, descz @@ -346,8 +346,8 @@ subroutine dlaf_pssygvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, j real(kind=sp), dimension(:), target, intent(out) :: w interface - subroutine dlaf_pssygvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & - bind(C, name='dlaf_pssygvx') + subroutine dlaf_pssygvd_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & + bind(C, name='dlaf_pssygvd') import :: c_int, c_ptr, c_signed_char @@ -356,12 +356,12 @@ subroutine dlaf_pssygvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, type(c_ptr), value :: a_, b_, w_, z_ integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ type(c_ptr), value :: info_ - end subroutine dlaf_pssygvx_c + end subroutine dlaf_pssygvd_c end interface info = -1 - call dlaf_pssygvx_c(iachar(uplo, c_signed_char), n, & + call dlaf_pssygvd_c(iachar(uplo, c_signed_char), n, & c_loc(a(1, 1)), ia, ja, desca, & c_loc(b(1, 1)), ib, jb, descb, & c_loc(w(1)), & @@ -369,9 +369,9 @@ end subroutine dlaf_pssygvx_c c_loc(info) & ) - end subroutine dlaf_pssygvx + end subroutine dlaf_pssygvd - subroutine dlaf_pdsygvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + subroutine dlaf_pdsygvd(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz integer, dimension(9), intent(in) :: desca, descb, descz @@ -380,8 +380,8 @@ subroutine dlaf_pdsygvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, j real(kind=dp), dimension(:), target, intent(out) :: w interface - subroutine dlaf_pdsygvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & - bind(C, name='dlaf_pdsygvx') + subroutine dlaf_pdsygvd_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & + bind(C, name='dlaf_pdsygvd') import :: c_int, c_ptr, c_signed_char @@ -390,12 +390,12 @@ subroutine dlaf_pdsygvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, type(c_ptr), value :: a_, b_, w_, z_ integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ type(c_ptr), value :: info_ - end subroutine dlaf_pdsygvx_c + end subroutine dlaf_pdsygvd_c end interface info = -1 - call dlaf_pdsygvx_c(iachar(uplo, c_signed_char), n, & + call dlaf_pdsygvd_c(iachar(uplo, c_signed_char), n, & c_loc(a(1, 1)), ia, ja, desca, & c_loc(b(1, 1)), ib, jb, descb, & c_loc(w(1)), & @@ -403,9 +403,9 @@ end subroutine dlaf_pdsygvx_c c_loc(info) & ) - end subroutine dlaf_pdsygvx + end subroutine dlaf_pdsygvd - subroutine dlaf_pchegvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + subroutine dlaf_pchegvd(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz integer, dimension(9), intent(in) :: desca, descb, descz @@ -414,8 +414,8 @@ subroutine dlaf_pchegvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, j real(kind=sp), dimension(:), target, intent(out) :: w interface - subroutine dlaf_pchegvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & - bind(C, name='dlaf_pchegvx') + subroutine dlaf_pchegvd_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & + bind(C, name='dlaf_pchegvd') import :: c_int, c_ptr, c_signed_char @@ -424,12 +424,12 @@ subroutine dlaf_pchegvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, type(c_ptr), value :: a_, b_, w_, z_ integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ type(c_ptr), value :: info_ - end subroutine dlaf_pchegvx_c + end subroutine dlaf_pchegvd_c end interface info = -1 - call dlaf_pchegvx_c(iachar(uplo, c_signed_char), n, & + call dlaf_pchegvd_c(iachar(uplo, c_signed_char), n, & c_loc(a(1, 1)), ia, ja, desca, & c_loc(b(1, 1)), ib, jb, descb, & c_loc(w(1)), & @@ -437,9 +437,9 @@ end subroutine dlaf_pchegvx_c c_loc(info) & ) - end subroutine dlaf_pchegvx + end subroutine dlaf_pchegvd - subroutine dlaf_pzhegvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + subroutine dlaf_pzhegvd(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz integer, dimension(9), intent(in) :: desca, descb, descz @@ -448,8 +448,8 @@ subroutine dlaf_pzhegvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, j real(kind=dp), dimension(:), target, intent(out) :: w interface - subroutine dlaf_pzhegvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & - bind(C, name='dlaf_pzhegvx') + subroutine dlaf_pzhegvd_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_) & + bind(C, name='dlaf_pzhegvd') import :: c_int, c_ptr, c_signed_char @@ -458,12 +458,12 @@ subroutine dlaf_pzhegvx_c(uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, type(c_ptr), value :: a_, b_, w_, z_ integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ type(c_ptr), value :: info_ - end subroutine dlaf_pzhegvx_c + end subroutine dlaf_pzhegvd_c end interface info = -1 - call dlaf_pzhegvx_c(iachar(uplo, c_signed_char), n, & + call dlaf_pzhegvd_c(iachar(uplo, c_signed_char), n, & c_loc(a(1, 1)), ia, ja, desca, & c_loc(b(1, 1)), ib, jb, descb, & c_loc(w(1)), & @@ -471,6 +471,6 @@ end subroutine dlaf_pzhegvx_c c_loc(info) & ) - end subroutine dlaf_pzhegvx + end subroutine dlaf_pzhegvd end module dlaf_fortran diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 07275ff..6b5a9e1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,7 +12,7 @@ set(INIT_TEST_EXECUTABLES init) set(PXPOTRF_TEST_EXECUTABLES pspotrf pdpotrf pcpotrf pzpotrf) set(PXHEEVD_TEST_EXECUTABLES pssyevd pdsyevd pcheevd pzheevd) -set(PXHEGVX_TEST_EXECUTABLES pssygvx pdsygvx pchegvx pzhegvx) +set(PXHEGVX_TEST_EXECUTABLES pssygvd pdsygvd pchegvd pzhegvd) find_program(FYPP_PROGRAM fypp) @@ -60,4 +60,4 @@ endfunction() add_tests("${INIT_TEST_EXECUTABLES}" "") add_tests("${PXPOTRF_TEST_EXECUTABLES}" pxpotrf) add_tests("${PXHEEVD_TEST_EXECUTABLES}" pxheevd) -add_tests("${PXHEGVX_TEST_EXECUTABLES}" pxhegvx) +add_tests("${PXHEGVX_TEST_EXECUTABLES}" pxhegvd) diff --git a/test/helpers/CMakeLists.txt b/test/helpers/CMakeLists.txt index 99f7c84..4c8983c 100644 --- a/test/helpers/CMakeLists.txt +++ b/test/helpers/CMakeLists.txt @@ -8,7 +8,7 @@ # SPDX-License-Identifier: BSD-3-Clause # -set(fyppFiles pxpotrf.fypp pxheevd.fypp pxhegvx.fypp) +set(fyppFiles pxpotrf.fypp pxheevd.fypp pxhegvd.fypp) foreach(infileName IN LISTS fyppFiles) diff --git a/test/helpers/pxhegvx.fypp b/test/helpers/pxhegvd.fypp similarity index 96% rename from test/helpers/pxhegvx.fypp rename to test/helpers/pxhegvd.fypp index 2608f6f..3de2ea4 100644 --- a/test/helpers/pxhegvx.fypp +++ b/test/helpers/pxhegvd.fypp @@ -12,13 +12,13 @@ #:set types = ['real', 'complex'] #:set names = {('sp', 'real'): 'ssy', ('sp', 'complex'): 'che', ('dp', 'real'): 'dsy', ('dp', 'complex'): 'zhe'} #:set symbols = {('sp', 'real'): 's', ('sp', 'complex'): 'c', ('dp', 'real'): 'd', ('dp', 'complex'): 'z'} -module pxhegvx_tests +module pxhegvd_tests use iso_fortran_env, only: error_unit, sp => real32, dp => real64 use dlaf_fortran, only: dlaf_initialize, dlaf_finalize, dlaf_create_grid_from_blacs, dlaf_free_grid #:for dtype in precision #:for type in types #:set name = names[(dtype, type)] - use dlaf_fortran, only: dlaf_p${name}$gvx + use dlaf_fortran, only: dlaf_p${name}$gvd #:endfor #:endfor @@ -39,7 +39,7 @@ module pxhegvx_tests #:for dtype in precision #:for type in types #:set name = names[(dtype, type)] - public :: p${name}$gvx_test + public :: p${name}$gvd_test #:endfor #:endfor @@ -49,7 +49,7 @@ contains #:for type in types #:set name = names[(dtype, type)] #:set symbol = symbols[(dtype, type)] - subroutine p${name}$gvx_test + subroutine p${name}$gvd_test integer, parameter :: n = 4 @@ -142,7 +142,7 @@ contains ! Solve with DLAF call dlaf_initialize() call dlaf_create_grid_from_blacs(ictxt) - call dlaf_p${name}$gvx( & + call dlaf_p${name}$gvd( & 'L', & n, A_local_dlaf, 1, 1, desca_local_dlaf, & B_local_dlaf, 1, 1, descb_local_dlaf, & @@ -170,7 +170,7 @@ contains ! ScaLAPACK #:if type == 'real' - call p${name}$gvx( & + call p${name}$gvd( & 1, 'V', 'A', 'L', & n, A_local_scalapack, 1, 1, desca_local_scalapack, & B_local_scalapack, 1, 1, descb_local_scalapack, & @@ -179,7 +179,7 @@ contains work, lwork, iwork, liwork, ifail, iclustr, gap, info & ) #:else - call p${name}$gvx( & + call p${name}$gvd( & 1, 'V', 'A', 'L', & n, A_local_scalapack, 1, 1, desca_local_scalapack, & B_local_scalapack, 1, 1, descb_local_scalapack, & @@ -246,8 +246,8 @@ contains call blacs_gridexit(ictxt) call blacs_exit(1) call teardown_mpi() - end subroutine p${name}$gvx_test + end subroutine p${name}$gvd_test #:endfor #:endfor -end module pxhegvx_tests +end module pxhegvd_tests diff --git a/test/pzhegvx.f90 b/test/pchegvd.f90 similarity index 68% rename from test/pzhegvx.f90 rename to test/pchegvd.f90 index 593f10e..16c2534 100644 --- a/test/pzhegvx.f90 +++ b/test/pchegvd.f90 @@ -8,11 +8,11 @@ ! SPDX-License-Identifier: BSD-3-Clause ! -program test_pzhegvx - use pxhegvx_tests, only: pzhegvx_test +program test_pchegvd + use pxhegvd_tests, only: pchegvd_test implicit none - call pzhegvx_test() + call pchegvd_test() -end program test_pzhegvx +end program test_pchegvd diff --git a/test/pchegvx.f90 b/test/pdsygvd.f90 similarity index 68% rename from test/pchegvx.f90 rename to test/pdsygvd.f90 index ea59aa2..23ee743 100644 --- a/test/pchegvx.f90 +++ b/test/pdsygvd.f90 @@ -8,11 +8,11 @@ ! SPDX-License-Identifier: BSD-3-Clause ! -program test_pchegvx - use pxhegvx_tests, only: pchegvx_test +program test_pdsygvd + use pxhegvd_tests, only: pdsygvd_test implicit none - call pchegvx_test() + call pdsygvd_test() -end program test_pchegvx +end program test_pdsygvd diff --git a/test/pdsygvx.f90 b/test/pssygvd.f90 similarity index 68% rename from test/pdsygvx.f90 rename to test/pssygvd.f90 index 44507c4..9830bd0 100644 --- a/test/pdsygvx.f90 +++ b/test/pssygvd.f90 @@ -8,11 +8,11 @@ ! SPDX-License-Identifier: BSD-3-Clause ! -program test_pdsygvx - use pxhegvx_tests, only: pdsygvx_test +program test_pssygvd + use pxhegvd_tests, only: pssygvd_test implicit none - call pdsygvx_test() + call pssygvd_test() -end program test_pdsygvx +end program test_pssygvd diff --git a/test/pssygvx.f90 b/test/pzhegvd.f90 similarity index 68% rename from test/pssygvx.f90 rename to test/pzhegvd.f90 index 3a6a539..8812bf2 100644 --- a/test/pssygvx.f90 +++ b/test/pzhegvd.f90 @@ -8,11 +8,11 @@ ! SPDX-License-Identifier: BSD-3-Clause ! -program test_pssygvx - use pxhegvx_tests, only: pssygvx_test +program test_pzhegvd + use pxhegvd_tests, only: pzhegvd_test implicit none - call pssygvx_test() + call pzhegvd_test() -end program test_pssygvx +end program test_pzhegvd From b385a8c4da79f865cd9f5ed155d6d4f800de0764 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Mon, 24 Jun 2024 10:55:36 +0000 Subject: [PATCH 03/16] factorized api --- src/dlaf_fortran.f90 | 144 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/src/dlaf_fortran.f90 b/src/dlaf_fortran.f90 index b8756f0..fe19193 100644 --- a/src/dlaf_fortran.f90 +++ b/src/dlaf_fortran.f90 @@ -371,6 +371,42 @@ end subroutine dlaf_pssygvx_c end subroutine dlaf_pssygvx + subroutine dlaf_pssygvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + character, intent(in) :: uplo + integer, intent(in) :: n, ia, ja, ib, jb, iz, jz + integer, dimension(9), intent(in) :: desca, descb, descz + integer, target, intent(out) :: info + real(kind=sp), dimension(:, :), target, intent(inout) :: a, b, z + real(kind=sp), dimension(:), target, intent(out) :: w + + interface + subroutine dlaf_pssygvd_factorized_c( & + uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_ & + ) & + bind(C, name='dlaf_pssygvd_factorized') + + import :: c_int, c_ptr, c_signed_char + + integer(kind=c_signed_char), value :: uplo_ + integer(kind=c_int), value :: n_, ia_, ja_, ib_, jb_, iz_, jz_ + type(c_ptr), value :: a_, b_, w_, z_ + integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ + type(c_ptr), value :: info_ + end subroutine dlaf_pssygvd_factorized_c + end interface + + info = -1 + + call dlaf_pssygvd_factorized_c(iachar(uplo, c_signed_char), n, & + c_loc(a(1, 1)), ia, ja, desca, & + c_loc(b(1, 1)), ib, jb, descb, & + c_loc(w(1)), & + c_loc(z(1, 1)), iz, jz, descz, & + c_loc(info) & + ) + + end subroutine dlaf_pssygvd_factorized + subroutine dlaf_pdsygvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -405,6 +441,42 @@ end subroutine dlaf_pdsygvx_c end subroutine dlaf_pdsygvx + subroutine dlaf_pdsygvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + character, intent(in) :: uplo + integer, intent(in) :: n, ia, ja, ib, jb, iz, jz + integer, dimension(9), intent(in) :: desca, descb, descz + integer, target, intent(out) :: info + real(kind=dp), dimension(:, :), target, intent(inout) :: a, b, z + real(kind=dp), dimension(:), target, intent(out) :: w + + interface + subroutine dlaf_pdsygvd_factorized_c( & + uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_ & + ) & + bind(C, name='dlaf_pdsygvd_factorized') + + import :: c_int, c_ptr, c_signed_char + + integer(kind=c_signed_char), value :: uplo_ + integer(kind=c_int), value :: n_, ia_, ja_, ib_, jb_, iz_, jz_ + type(c_ptr), value :: a_, b_, w_, z_ + integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ + type(c_ptr), value :: info_ + end subroutine dlaf_pdsygvd_factorized_c + end interface + + info = -1 + + call dlaf_pdsygvd_factorized_c(iachar(uplo, c_signed_char), n, & + c_loc(a(1, 1)), ia, ja, desca, & + c_loc(b(1, 1)), ib, jb, descb, & + c_loc(w(1)), & + c_loc(z(1, 1)), iz, jz, descz, & + c_loc(info) & + ) + + end subroutine dlaf_pdsygvd_factorized + subroutine dlaf_pchegvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -439,6 +511,42 @@ end subroutine dlaf_pchegvx_c end subroutine dlaf_pchegvx + subroutine dlaf_pchegvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + character, intent(in) :: uplo + integer, intent(in) :: n, ia, ja, ib, jb, iz, jz + integer, dimension(9), intent(in) :: desca, descb, descz + integer, target, intent(out) :: info + complex(kind=sp), dimension(:, :), target, intent(inout) :: a, b, z + real(kind=sp), dimension(:), target, intent(out) :: w + + interface + subroutine dlaf_pchegvd_factorized_c( & + uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_ & + ) & + bind(C, name='dlaf_pchegvd_factorized') + + import :: c_int, c_ptr, c_signed_char + + integer(kind=c_signed_char), value :: uplo_ + integer(kind=c_int), value :: n_, ia_, ja_, ib_, jb_, iz_, jz_ + type(c_ptr), value :: a_, b_, w_, z_ + integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ + type(c_ptr), value :: info_ + end subroutine dlaf_pchegvd_factorized_c + end interface + + info = -1 + + call dlaf_pchegvd_factorized_c(iachar(uplo, c_signed_char), n, & + c_loc(a(1, 1)), ia, ja, desca, & + c_loc(b(1, 1)), ib, jb, descb, & + c_loc(w(1)), & + c_loc(z(1, 1)), iz, jz, descz, & + c_loc(info) & + ) + + end subroutine dlaf_pchegvd_factorized + subroutine dlaf_pzhegvx(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -473,4 +581,40 @@ end subroutine dlaf_pzhegvx_c end subroutine dlaf_pzhegvx + subroutine dlaf_pzhegvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) + character, intent(in) :: uplo + integer, intent(in) :: n, ia, ja, ib, jb, iz, jz + integer, dimension(9), intent(in) :: desca, descb, descz + integer, target, intent(out) :: info + complex(kind=dp), dimension(:, :), target, intent(inout) :: a, b, z + real(kind=dp), dimension(:), target, intent(out) :: w + + interface + subroutine dlaf_pzhegvd_factorized_c( & + uplo_, n_, a_, ia_, ja_, desca_, b_, ib_, jb_, descb_, w_, z_, iz_, jz_, descz_, info_ & + ) & + bind(C, name='dlaf_pzhegvd_factorized') + + import :: c_int, c_ptr, c_signed_char + + integer(kind=c_signed_char), value :: uplo_ + integer(kind=c_int), value :: n_, ia_, ja_, ib_, jb_, iz_, jz_ + type(c_ptr), value :: a_, b_, w_, z_ + integer(kind=c_int), dimension(9) :: desca_, descb_, descz_ + type(c_ptr), value :: info_ + end subroutine dlaf_pzhegvd_factorized_c + end interface + + info = -1 + + call dlaf_pzhegvd_factorized_c(iachar(uplo, c_signed_char), n, & + c_loc(a(1, 1)), ia, ja, desca, & + c_loc(b(1, 1)), ib, jb, descb, & + c_loc(w(1)), & + c_loc(z(1, 1)), iz, jz, descz, & + c_loc(info) & + ) + + end subroutine dlaf_pzhegvd_factorized + end module dlaf_fortran From bc8bd6dcb26b94c4ccecc0b137f1c91f7c90b2ae Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Mon, 24 Jun 2024 13:03:16 +0000 Subject: [PATCH 04/16] test --- src/dlaf_fortran.f90 | 1 + test/helpers/pxhegvx.fypp | 49 +++++++++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/dlaf_fortran.f90 b/src/dlaf_fortran.f90 index fe19193..e5651dc 100644 --- a/src/dlaf_fortran.f90 +++ b/src/dlaf_fortran.f90 @@ -30,6 +30,7 @@ module dlaf_fortran public :: dlaf_pspotrf, dlaf_pdpotrf, dlaf_pcpotrf, dlaf_pzpotrf public :: dlaf_pssyevd, dlaf_pdsyevd, dlaf_pcheevd, dlaf_pzheevd public :: dlaf_pssygvx, dlaf_pdsygvx, dlaf_pchegvx, dlaf_pzhegvx + public :: dlaf_pssygvd_factorized, dlaf_pdsygvd_factorized, dlaf_pchegvd_factorized, dlaf_pzhegvd_factorized contains diff --git a/test/helpers/pxhegvx.fypp b/test/helpers/pxhegvx.fypp index 2608f6f..3e043bd 100644 --- a/test/helpers/pxhegvx.fypp +++ b/test/helpers/pxhegvx.fypp @@ -19,6 +19,7 @@ module pxhegvx_tests #:for type in types #:set name = names[(dtype, type)] use dlaf_fortran, only: dlaf_p${name}$gvx + use dlaf_fortran, only: dlaf_p${name}$gvd_factorized #:endfor #:endfor @@ -68,11 +69,11 @@ contains integer :: descb(9), descb_local_dlaf(9), descb_local_scalapack(9) integer :: descz_local_dlaf(9), descz_local_scalapack(9) integer :: descz_dlaf(9), descz_scalapack(9) - ${type}$ (kind=${dtype}$), dimension(:, :), allocatable :: A, A_local_dlaf, A_local_scalapack + ${type}$ (kind=${dtype}$), dimension(:, :), allocatable :: A, A_local_dlaf, A_local_scalapack, A_local_store ${type}$ (kind=${dtype}$), dimension(:, :), allocatable :: B, B_local_dlaf, B_local_scalapack - ${type}$ (kind=${dtype}$), dimension(:, :), allocatable :: Z_local_dlaf, Z_local_scalapack - ${type}$ (kind=${dtype}$), dimension(:, :), allocatable :: Z_dlaf, Z_scalapack - real(kind=${dtype}$), dimension(:), allocatable :: W_dlaf, W_scalapack + ${type}$ (kind=${dtype}$), dimension(:, :), allocatable :: Z_local_dlaf, Z_local_scalapack, Z_local_dlaf_factorized + ${type}$ (kind=${dtype}$), dimension(:, :), allocatable :: Z_dlaf, Z_scalapack, Z_dlaf_factorized + real(kind=${dtype}$), dimension(:), allocatable :: W_dlaf, W_scalapack, W_dlaf_factorized real(kind=${dtype}$), parameter :: abstol = #{if dtype == 'sp'}# 1e-5_${dtype}$ #{else}# 1e-8_${dtype}$ #{endif}# integer, parameter :: lwork = 100, liwork = 100 @@ -110,6 +111,7 @@ contains allocate (B(n, n)) allocate (Z_dlaf(n, n)) allocate (Z_scalapack(n, n)) + allocate (Z_dlaf_factorized(n, n)) call descinit(desca, n, n, n, n, 0, 0, ictxt_0, n, info) call descinit(descb, n, n, n, n, 0, 0, ictxt_0, n, info) @@ -124,10 +126,10 @@ contains ma = numroc(n, nb, myrow, 0, nprow) na = numroc(n, nb, mycol, 0, npcol) lld = max(1, ma) - allocate (A_local_dlaf(ma, na), A_local_scalapack(ma, na)) + allocate (A_local_dlaf(ma, na), A_local_scalapack(ma, na), A_local_store(ma, na)) allocate (B_local_dlaf(ma, na), B_local_scalapack(ma, na)) - allocate (Z_local_dlaf(ma, na), Z_local_scalapack(ma, na)) - allocate (W_dlaf(n), W_scalapack(n)) + allocate (Z_local_dlaf(ma, na), Z_local_scalapack(ma, na), Z_local_dlaf_factorized(ma, na)) + allocate (W_dlaf(n), W_scalapack(n), W_dlaf_factorized(n)) ! + ---- + ! | DLAF | @@ -139,9 +141,14 @@ contains call p${symbol}$gemr2d(n, n, a, 1, 1, desca, A_local_dlaf, 1, 1, desca_local_dlaf, ictxt) call p${symbol}$gemr2d(n, n, b, 1, 1, desca, B_local_dlaf, 1, 1, descb_local_dlaf, ictxt) + ! Store local copy + A_local_store(:, :) = A_local_dlaf(:, :) + ! Solve with DLAF call dlaf_initialize() call dlaf_create_grid_from_blacs(ictxt) + + ! Solve with Cholesky factorization call dlaf_p${name}$gvx( & 'L', & n, A_local_dlaf, 1, 1, desca_local_dlaf, & @@ -149,6 +156,17 @@ contains W_dlaf, Z_local_dlaf, 1, 1, descz_local_dlaf, & info & ) + + ! Solve with Cholesky from the previous + A_local_dlaf(:, :) = A_local_store(:, :) + call dlaf_p${name}$gvd_factorized( & + 'L', & + n, A_local_dlaf, 1, 1, desca_local_dlaf, & + B_local_dlaf, 1, 1, descb_local_dlaf, & + W_dlaf_factorized, Z_local_dlaf_factorized, 1, 1, descz_local_dlaf, & + info & + ) + call dlaf_free_grid(ictxt) call dlaf_finalize() if (info /= 0) then @@ -157,6 +175,7 @@ contains end if call p${symbol}$gemr2d(n, n, Z_local_dlaf, 1, 1, descz_local_dlaf, Z_dlaf, 1, 1, descz_dlaf, ictxt) + call p${symbol}$gemr2d(n, n, Z_local_dlaf_factorized, 1, 1, descz_local_dlaf, Z_dlaf_factorized, 1, 1, descz_dlaf, ictxt) ! + --------- + ! | ScaLAPACK | @@ -206,6 +225,19 @@ contains end if end if + call bcast_check(failed) + if (failed) then + call terminate(ictxt) + end if + + failed = .false. + if (rank == 0) then + if (.not. allclose(W_dlaf, W_dlaf_factorized)) then + failed = .true. + write (error_unit, *) "ERROR: DLAF != DLAF Factorized (eigenvalues)" + end if + end if + call bcast_check(failed) if (failed) then call terminate(ictxt) @@ -234,12 +266,15 @@ contains end if if (allocated(A_local_dlaf)) deallocate (A_local_dlaf) if (allocated(A_local_scalapack)) deallocate (A_local_scalapack) + if (allocated(A_local_store)) deallocate (A_local_store) if (allocated(B_local_dlaf)) deallocate (B_local_dlaf) if (allocated(B_local_scalapack)) deallocate (B_local_scalapack) if (allocated(Z_local_dlaf)) deallocate (Z_local_dlaf) if (allocated(Z_local_scalapack)) deallocate (Z_local_scalapack) + if (allocated(Z_local_dlaf_factorized)) deallocate (Z_local_dlaf_factorized) if (allocated(W_dlaf)) deallocate (W_dlaf) if (allocated(W_scalapack)) deallocate (W_scalapack) + if (allocated(W_dlaf_factorized)) deallocate (W_dlaf_factorized) if (allocated(iclustr)) deallocate (iclustr) if (allocated(gap)) deallocate (gap) From 8d9ed3fe39f401de9142ad7df8f4d61c06d9c2a6 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Mon, 24 Jun 2024 13:12:32 +0000 Subject: [PATCH 05/16] fix scalapack --- test/helpers/pxhegvd.fypp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/helpers/pxhegvd.fypp b/test/helpers/pxhegvd.fypp index 3de2ea4..5c26336 100644 --- a/test/helpers/pxhegvd.fypp +++ b/test/helpers/pxhegvd.fypp @@ -170,7 +170,7 @@ contains ! ScaLAPACK #:if type == 'real' - call p${name}$gvd( & + call p${name}$gvx( & 1, 'V', 'A', 'L', & n, A_local_scalapack, 1, 1, desca_local_scalapack, & B_local_scalapack, 1, 1, descb_local_scalapack, & @@ -179,7 +179,7 @@ contains work, lwork, iwork, liwork, ifail, iclustr, gap, info & ) #:else - call p${name}$gvd( & + call p${name}$gvx( & 1, 'V', 'A', 'L', & n, A_local_scalapack, 1, 1, desca_local_scalapack, & B_local_scalapack, 1, 1, descb_local_scalapack, & From 6981d8880748b55f192573672906dcb5c2a6d929 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Tue, 25 Jun 2024 07:25:31 +0000 Subject: [PATCH 06/16] dlaf 0.6.0 in ci --- ci/ci-common.yml | 2 +- spack/packages/dla-future-fortran/package.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/ci-common.yml b/ci/ci-common.yml index 941f342..07edd64 100644 --- a/ci/ci-common.yml +++ b/ci/ci-common.yml @@ -29,7 +29,7 @@ stages: reports: dotenv: build.env variables: - SPACK_SHA: develop-2024-06-02 + SPACK_SHA: 05c7ff4595a4e574cbcf45475c626b9b94c22af1 SPACK_BUILDCACHE: develop-2024-06-02 SPACK_DLAF_FORTRAN_REPO: ./spack DOCKER_BUILD_ARGS: '[ diff --git a/spack/packages/dla-future-fortran/package.py b/spack/packages/dla-future-fortran/package.py index 04f8b6f..9e33ddb 100644 --- a/spack/packages/dla-future-fortran/package.py +++ b/spack/packages/dla-future-fortran/package.py @@ -29,7 +29,8 @@ class DlaFutureFortran(CMakePackage): generator("ninja") depends_on("cmake@3.22:", type="build") - depends_on("dla-future@0.4.1: +scalapack") + depends_on("dla-future@0.4.1:5 +scalapack", when="@0.1.0") + depends_on("dla-future@0.6.0: +scalapack", when="@0.2.0:") depends_on("dla-future +shared", when="+shared") depends_on("mpi", when="+test") From ef99ed3a378f8eaf9a0ed057faa5b5bc1545f38d Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Tue, 25 Jun 2024 10:22:42 +0200 Subject: [PATCH 07/16] Update spack/packages/dla-future-fortran/package.py Co-authored-by: Mikael Simberg --- spack/packages/dla-future-fortran/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack/packages/dla-future-fortran/package.py b/spack/packages/dla-future-fortran/package.py index 9e33ddb..29a555d 100644 --- a/spack/packages/dla-future-fortran/package.py +++ b/spack/packages/dla-future-fortran/package.py @@ -29,7 +29,7 @@ class DlaFutureFortran(CMakePackage): generator("ninja") depends_on("cmake@3.22:", type="build") - depends_on("dla-future@0.4.1:5 +scalapack", when="@0.1.0") + depends_on("dla-future@0.4.1:0.5 +scalapack", when="@0.1.0") depends_on("dla-future@0.6.0: +scalapack", when="@0.2.0:") depends_on("dla-future +shared", when="+shared") From d1fdc6dcbe17bedc80ccf183a6dcdacc09a0928a Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 08:07:38 +0000 Subject: [PATCH 08/16] update cache tag --- ci/ci-common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/ci-common.yml b/ci/ci-common.yml index 07edd64..48cc174 100644 --- a/ci/ci-common.yml +++ b/ci/ci-common.yml @@ -30,7 +30,7 @@ stages: dotenv: build.env variables: SPACK_SHA: 05c7ff4595a4e574cbcf45475c626b9b94c22af1 - SPACK_BUILDCACHE: develop-2024-06-02 + SPACK_BUILDCACHE: develop-2024-06-16 SPACK_DLAF_FORTRAN_REPO: ./spack DOCKER_BUILD_ARGS: '[ "BASE_IMAGE", From ad6335bb2322ca58ab64a52232ec83b31607bb6e Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 09:32:08 +0000 Subject: [PATCH 09/16] try force --- ci/docker/build.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/docker/build.Dockerfile b/ci/docker/build.Dockerfile index db53793..e377e0b 100644 --- a/ci/docker/build.Dockerfile +++ b/ci/docker/build.Dockerfile @@ -59,7 +59,7 @@ RUN spack external find \ # Enable Spack build cache ARG SPACK_BUILDCACHE RUN spack mirror add ${SPACK_BUILDCACHE} https://binaries.spack.io/${SPACK_BUILDCACHE} -RUN spack buildcache keys --install --trust +RUN spack buildcache keys --install --trust --force # Add custom Spack repo ARG SPACK_DLAF_FORTRAN_REPO From 0d80daec89d4c63485b2bded6568d835968d655f Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 13:51:29 +0200 Subject: [PATCH 10/16] Update test/helpers/pxhegvd.fypp --- test/helpers/pxhegvd.fypp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helpers/pxhegvd.fypp b/test/helpers/pxhegvd.fypp index 0252080..83bab48 100644 --- a/test/helpers/pxhegvd.fypp +++ b/test/helpers/pxhegvd.fypp @@ -157,7 +157,7 @@ contains info & ) - ! Solve with Cholesky from the previous + ! Solve with Cholesky factorisation from the previous call A_local_dlaf(:, :) = A_local_store(:, :) call dlaf_p${name}$gvd_factorized( & 'L', & From 5f82327c15a6f8079865c364c7da8b0cc8b734a0 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 12:26:54 +0000 Subject: [PATCH 11/16] try prvious tag --- ci/ci-common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/ci-common.yml b/ci/ci-common.yml index 48cc174..2a1a265 100644 --- a/ci/ci-common.yml +++ b/ci/ci-common.yml @@ -30,7 +30,7 @@ stages: dotenv: build.env variables: SPACK_SHA: 05c7ff4595a4e574cbcf45475c626b9b94c22af1 - SPACK_BUILDCACHE: develop-2024-06-16 + SPACK_BUILDCACHE: develop-2024-06-09 SPACK_DLAF_FORTRAN_REPO: ./spack DOCKER_BUILD_ARGS: '[ "BASE_IMAGE", From 9bbcec07216ea865e648399aba18f024c0d9a718 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 12:40:30 +0000 Subject: [PATCH 12/16] re-try working tag --- ci/ci-common.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/ci-common.yml b/ci/ci-common.yml index 2a1a265..07edd64 100644 --- a/ci/ci-common.yml +++ b/ci/ci-common.yml @@ -30,7 +30,7 @@ stages: dotenv: build.env variables: SPACK_SHA: 05c7ff4595a4e574cbcf45475c626b9b94c22af1 - SPACK_BUILDCACHE: develop-2024-06-09 + SPACK_BUILDCACHE: develop-2024-06-02 SPACK_DLAF_FORTRAN_REPO: ./spack DOCKER_BUILD_ARGS: '[ "BASE_IMAGE", From 982334f3b95d4f6da9d1a30d67063eca93701008 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 13:43:36 +0000 Subject: [PATCH 13/16] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ba30cc..c080eb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## DLA-Future-Fortran X.Y.Z +### Changed + +* Name of the generalized eigenvalue solver from `*gvx` to `*gvd` [PR #16] + ### Fixed * Spack installation with `+test` variant by setting `-DMPIEXEC_MAX_NUMPROCS=6` [PR #10] From 591275e3cc96e39a1ead67b2ea89243fb623126c Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 13:46:07 +0000 Subject: [PATCH 14/16] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c080eb0..3ccc80f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## DLA-Future-Fortran X.Y.Z +### Added + +* Generalized eigensolver for an already factorized $\mathbf{B}$ matrix [PR #18] + ### Changed * Name of the generalized eigenvalue solver from `*gvx` to `*gvd` [PR #16] From f4569bbb9253abdb46760bb2cfd83a5e0fc1566d Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Wed, 26 Jun 2024 14:09:03 +0000 Subject: [PATCH 15/16] fix --- src/dlaf_fortran.f90 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/dlaf_fortran.f90 b/src/dlaf_fortran.f90 index ab7ac6a..c5fc5bb 100644 --- a/src/dlaf_fortran.f90 +++ b/src/dlaf_fortran.f90 @@ -372,7 +372,6 @@ end subroutine dlaf_pssygvd_c end subroutine dlaf_pssygvd -<<<<<<< HEAD subroutine dlaf_pssygvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -409,8 +408,6 @@ end subroutine dlaf_pssygvd_factorized_c end subroutine dlaf_pssygvd_factorized -======= ->>>>>>> main subroutine dlaf_pdsygvd(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -445,7 +442,6 @@ end subroutine dlaf_pdsygvd_c end subroutine dlaf_pdsygvd -<<<<<<< HEAD subroutine dlaf_pdsygvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -482,8 +478,6 @@ end subroutine dlaf_pdsygvd_factorized_c end subroutine dlaf_pdsygvd_factorized -======= ->>>>>>> main subroutine dlaf_pchegvd(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -518,7 +512,6 @@ end subroutine dlaf_pchegvd_c end subroutine dlaf_pchegvd -<<<<<<< HEAD subroutine dlaf_pchegvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -555,8 +548,6 @@ end subroutine dlaf_pchegvd_factorized_c end subroutine dlaf_pchegvd_factorized -======= ->>>>>>> main subroutine dlaf_pzhegvd(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo integer, intent(in) :: n, ia, ja, ib, jb, iz, jz @@ -590,7 +581,6 @@ end subroutine dlaf_pzhegvd_c ) end subroutine dlaf_pzhegvd -<<<<<<< HEAD subroutine dlaf_pzhegvd_factorized(uplo, n, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, info) character, intent(in) :: uplo @@ -627,7 +617,5 @@ end subroutine dlaf_pzhegvd_factorized_c ) end subroutine dlaf_pzhegvd_factorized -======= ->>>>>>> main end module dlaf_fortran From 64602e4a7eed3cef67e85bf402b2303535aff551 Mon Sep 17 00:00:00 2001 From: Rocco Meli Date: Thu, 27 Jun 2024 12:01:49 +0000 Subject: [PATCH 16/16] add check on eigenvectors too for good measure --- test/helpers/pxhegvd.fypp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/helpers/pxhegvd.fypp b/test/helpers/pxhegvd.fypp index 83bab48..4ac02ae 100644 --- a/test/helpers/pxhegvd.fypp +++ b/test/helpers/pxhegvd.fypp @@ -251,6 +251,19 @@ contains end if end if + call bcast_check(failed) + if (failed) then + call terminate(ictxt) + end if + + failed = .false. + if (rank == 0) then + if (.not. allclose(abs(Z_dlaf), abs(Z_dlaf_factorized))) then + failed = .true. + write (error_unit, *) "ERROR: DLAF != DLAF Factorized (eigenvectors)" + end if + end if + call bcast_check(failed) if (failed) then call terminate(ictxt)