diff --git a/include/dlaf_c/eigensolver/eigensolver.h b/include/dlaf_c/eigensolver/eigensolver.h index 3a63d0f5fa..387f7bd064 100644 --- a/include/dlaf_c/eigensolver/eigensolver.h +++ b/include/dlaf_c/eigensolver/eigensolver.h @@ -118,8 +118,8 @@ DLAF_EXTERN_C void dlaf_pssyevd(const char uplo, const int n, float* a, const in const int descz[9], int* info) DLAF_NOEXCEPT; // @copydoc dlaf_pssyevd -/// @param eigenvalues_index_begin index of the first eigenvalue to compute (has to be 0) -/// @param eigenvalues_index_end index of the last eigenvalue to compute (exclusive) +/// @param eigenvalues_index_begin index of the first eigenvalue to compute (has to be 1) +/// @param eigenvalues_index_end index of the last eigenvalue to compute (inclusive) DLAF_EXTERN_C void dlaf_pssyevd_partial_spectrum( const char uplo, const int n, float* a, const int ia, const int ja, const int desca[9], float* w, float* z, const int iz, const int jz, const int descz[9], const SizeType eigenvalues_index_begin, diff --git a/include/dlaf_c/eigensolver/gen_eigensolver.h b/include/dlaf_c/eigensolver/gen_eigensolver.h index f898b5bb6d..b04cc75920 100644 --- a/include/dlaf_c/eigensolver/gen_eigensolver.h +++ b/include/dlaf_c/eigensolver/gen_eigensolver.h @@ -41,7 +41,7 @@ DLAF_EXTERN_C int dlaf_symmetric_generalized_eigensolver_s( const struct DLAF_descriptor dlaf_descz) DLAF_NOEXCEPT; /// @copydoc dlaf_symmetric_generalized_eigensolver_s -/// @param eigenvalues_index_begin index of the first eigenvalue to compute +/// @param eigenvalues_index_begin index of the first eigenvalue to compute (has to be 0) /// @param eigenvalues_index_end index of the last eigenvalue to compute (exclusive) DLAF_EXTERN_C int dlaf_symmetric_generalized_eigensolver_partial_spectrum_s( const int dlaf_context, const char uplo, float* a, const struct DLAF_descriptor dlaf_desca, float* b, @@ -116,7 +116,7 @@ DLAF_EXTERN_C int dlaf_symmetric_generalized_eigensolver_factorized_s( const struct DLAF_descriptor dlaf_descz) DLAF_NOEXCEPT; /// @copydoc dlaf_symmetric_generalized_eigensolver_factorized_s -/// @param eigenvalues_index_begin index of the first eigenvalue to compute +/// @param eigenvalues_index_begin index of the first eigenvalue to compute (has to be 0) /// @param eigenvalues_index_end index of the last eigenvalue to compute (exclusive) DLAF_EXTERN_C int dlaf_symmetric_generalized_eigensolver_partial_spectrum_factorized_s( const int dlaf_context, const char uplo, float* a, const struct DLAF_descriptor dlaf_desca, float* b, @@ -208,8 +208,8 @@ DLAF_EXTERN_C void dlaf_pssygvd(const char uplo, const int n, float* a, const in const int descz[9], int* info) DLAF_NOEXCEPT; /// @copydoc dlaf_pssygvd -/// @param eigenvalues_index_begin index of the first eigenvalue to compute -/// @param eigenvalues_index_end index of the last eigenvalue to compute (exclusive) +/// @param eigenvalues_index_begin index of the first eigenvalue to compute (has to be 1) +/// @param eigenvalues_index_end index of the last eigenvalue to compute (inclusive) DLAF_EXTERN_C void dlaf_pssygvd_partial_spectrum( const char uplo, const int n, float* a, const int ia, const int ja, const int desca[9], float* b, const int ib, const int jb, const int descb[9], float* w, float* z, const int iz, const int jz, @@ -303,8 +303,8 @@ DLAF_EXTERN_C void dlaf_pssygvd_factorized(const char uplo, const int n, float* int* info) DLAF_NOEXCEPT; /// @copydoc dlaf_pssygvx_factorized -/// @param eigenvalues_index_begin index of the first eigenvalue to compute -/// @param eigenvalues_index_end index of the last eigenvalue to compute (exclusive) +/// @param eigenvalues_index_begin index of the first eigenvalue to compute (has to be 1) +/// @param eigenvalues_index_end index of the last eigenvalue to compute (inclusive) DLAF_EXTERN_C void dlaf_pssygvd_partial_spectrum_factorized( const char uplo, const int n, float* a, const int ia, const int ja, const int desca[9], float* b, const int ib, const int jb, const int descb[9], float* w, float* z, const int iz, const int jz, diff --git a/src/c_api/eigensolver/eigensolver.cpp b/src/c_api/eigensolver/eigensolver.cpp index 1f8b5437da..a502deff08 100644 --- a/src/c_api/eigensolver/eigensolver.cpp +++ b/src/c_api/eigensolver/eigensolver.cpp @@ -83,7 +83,7 @@ int dlaf_hermitian_eigensolver_partial_spectrum_z( void dlaf_pssyevd(const char uplo, const int m, float* a, const int ia, const int ja, const int desca[9], float* w, float* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxheevd(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 0l, m, *info); + pxheevd(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 1l, m, *info); } void dlaf_pssyevd_partial_spectrum(const char uplo, const int m, float* a, const int ia, const int ja, @@ -97,7 +97,7 @@ void dlaf_pssyevd_partial_spectrum(const char uplo, const int m, float* a, const void dlaf_pdsyevd(const char uplo, const int m, double* a, const int ia, const int ja, const int desca[9], double* w, double* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxheevd(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 0l, m, *info); + pxheevd(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 1l, m, *info); } void dlaf_pdsyevd_partial_spectrum(const char uplo, const int m, double* a, const int ia, const int ja, @@ -110,7 +110,7 @@ void dlaf_pdsyevd_partial_spectrum(const char uplo, const int m, double* a, cons void dlaf_pcheevd(const char uplo, const int m, dlaf_complex_c* a, const int ia, const int ja, const int desca[9], float* w, dlaf_complex_c* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxheevd>(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 0l, m, *info); + pxheevd>(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 1l, m, *info); } void dlaf_pcheevd_partial_spectrum(const char uplo, const int m, dlaf_complex_c* a, const int ia, @@ -125,7 +125,7 @@ void dlaf_pcheevd_partial_spectrum(const char uplo, const int m, dlaf_complex_c* void dlaf_pzheevd(const char uplo, const int m, dlaf_complex_z* a, const int ia, const int ja, const int desca[9], double* w, dlaf_complex_z* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxheevd>(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 0l, m, *info); + pxheevd>(uplo, m, a, ia, ja, desca, w, z, iz, jz, descz, 1l, m, *info); } void dlaf_pzheevd_partial_spectrum(const char uplo, const int m, dlaf_complex_z* a, const int ia, diff --git a/src/c_api/eigensolver/eigensolver.h b/src/c_api/eigensolver/eigensolver.h index 78b7996b9a..20aada8569 100644 --- a/src/c_api/eigensolver/eigensolver.h +++ b/src/c_api/eigensolver/eigensolver.h @@ -86,12 +86,17 @@ void pxheevd(const char uplo, const int m, T* a, const int ia, const int ja, con DLAF_ASSERT(ja == 1, ja); DLAF_ASSERT(iz == 1, iz); DLAF_ASSERT(iz == 1, iz); + DLAF_ASSERT(m > 0 ? eigenvalues_index_begin >= 1 : eigenvalues_index_begin == 1, m, + eigenvalues_index_begin); + DLAF_ASSERT(m > 0 ? eigenvalues_index_end <= m : eigenvalues_index_end == 0, m, eigenvalues_index_end); + DLAF_ASSERT(m > 0 ? eigenvalues_index_begin <= eigenvalues_index_end : true, m, + eigenvalues_index_begin, eigenvalues_index_end); auto dlaf_desca = make_dlaf_descriptor(m, m, ia, ja, desca); auto dlaf_descz = make_dlaf_descriptor(m, m, iz, jz, descz); auto _info = hermitian_eigensolver(desca[1], uplo, a, dlaf_desca, w, z, dlaf_descz, - eigenvalues_index_begin, eigenvalues_index_end); + eigenvalues_index_begin - 1, eigenvalues_index_end); info = _info; } diff --git a/src/c_api/eigensolver/gen_eigensolver.cpp b/src/c_api/eigensolver/gen_eigensolver.cpp index a030191456..21b3842849 100644 --- a/src/c_api/eigensolver/gen_eigensolver.cpp +++ b/src/c_api/eigensolver/gen_eigensolver.cpp @@ -175,7 +175,7 @@ int dlaf_hermitian_generalized_eigensolver_partial_spectrum_factorized_z( void dlaf_pssygvd(const char uplo, const int m, float* a, const int ia, const int ja, const int desca[9], float* b, const int ib, const int jb, const int descb[9], float* w, float* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxhegvd(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 0, m, *info); + pxhegvd(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 1, m, *info); } void dlaf_pssygvd_partial_spectrum(const char uplo, const int m, float* a, const int ia, const int ja, @@ -191,7 +191,7 @@ void dlaf_pdsygvd(const char uplo, const int m, double* a, const int ia, const i const int desca[9], double* b, const int ib, const int jb, const int descb[9], double* w, double* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxhegvd(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 0, m, *info); + pxhegvd(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 1, m, *info); } void dlaf_pdsygvd_partial_spectrum(const char uplo, const int m, double* a, const int ia, const int ja, @@ -207,7 +207,7 @@ void dlaf_pchegvd(const char uplo, const int m, dlaf_complex_c* a, const int ia, const int desca[9], dlaf_complex_c* b, const int ib, const int jb, const int descb[9], float* w, dlaf_complex_c* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxhegvd>(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 0, m, + pxhegvd>(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 1, m, *info); } @@ -225,7 +225,7 @@ void dlaf_pzhegvd(const char uplo, const int m, dlaf_complex_z* a, const int ia, const int desca[9], dlaf_complex_z* b, const int ib, const int jb, const int descb[9], double* w, dlaf_complex_z* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxhegvd>(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 0, m, + pxhegvd>(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 1, m, *info); } @@ -243,7 +243,7 @@ void dlaf_pssygvd_factorized(const char uplo, const int m, float* a, const int i const int desca[9], float* b, const int ib, const int jb, const int descb[9], float* w, float* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxhegvd_factorized(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 0, m, + pxhegvd_factorized(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 1, m, *info); } @@ -261,7 +261,7 @@ void dlaf_pdsygvd_factorized(const char uplo, const int m, double* a, const int const int desca[9], double* b, const int ib, const int jb, const int descb[9], double* w, double* z, const int iz, const int jz, const int descz[9], int* info) noexcept { - pxhegvd_factorized(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 0, m, + pxhegvd_factorized(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, descz, 1, m, *info); } @@ -280,7 +280,7 @@ void dlaf_pchegvd_factorized(const char uplo, const int m, dlaf_complex_c* a, co const int descb[9], float* w, dlaf_complex_c* z, const int iz, const int jz, const int descz[9], int* info) noexcept { pxhegvd_factorized>(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, - descz, 0, m, *info); + descz, 1, m, *info); } void dlaf_pchegvd_partial_spectrum_factorized( @@ -297,7 +297,7 @@ void dlaf_pzhegvd_factorized(const char uplo, const int m, dlaf_complex_z* a, co const int descb[9], double* w, dlaf_complex_z* z, const int iz, const int jz, const int descz[9], int* info) noexcept { pxhegvd_factorized>(uplo, m, a, ia, ja, desca, b, ib, jb, descb, w, z, iz, jz, - descz, 0, m, *info); + descz, 1, m, *info); } void dlaf_pzhegvd_partial_spectrum_factorized( diff --git a/src/c_api/eigensolver/gen_eigensolver.h b/src/c_api/eigensolver/gen_eigensolver.h index a0251176fd..1484e8f411 100644 --- a/src/c_api/eigensolver/gen_eigensolver.h +++ b/src/c_api/eigensolver/gen_eigensolver.h @@ -124,19 +124,24 @@ void pxhegvd(const char uplo, const int m, T* a, const int ia, const int ja, con DLAF_ASSERT(jb == 1, jb); DLAF_ASSERT(iz == 1, iz); DLAF_ASSERT(iz == 1, iz); + DLAF_ASSERT(m > 0 ? eigenvalues_index_begin >= 1 : eigenvalues_index_begin == 1, m, + eigenvalues_index_begin); + DLAF_ASSERT(m > 0 ? eigenvalues_index_end <= m : eigenvalues_index_end == 0, m, eigenvalues_index_end); + DLAF_ASSERT(m > 0 ? eigenvalues_index_begin <= eigenvalues_index_end : true, m, + eigenvalues_index_begin, eigenvalues_index_end); auto dlaf_desca = make_dlaf_descriptor(m, m, ia, ja, desca); auto dlaf_descb = make_dlaf_descriptor(m, m, ib, jb, descb); auto dlaf_descz = make_dlaf_descriptor(m, m, iz, jz, descz); if (!factorized) { - info = - hermitian_generalized_eigensolver(desca[1], uplo, a, dlaf_desca, b, dlaf_descb, w, z, - dlaf_descz, eigenvalues_index_begin, eigenvalues_index_end); + info = hermitian_generalized_eigensolver(desca[1], uplo, a, dlaf_desca, b, dlaf_descb, w, z, + dlaf_descz, eigenvalues_index_begin - 1, + eigenvalues_index_end); } else { info = hermitian_generalized_eigensolver_factorized(desca[1], uplo, a, dlaf_desca, b, dlaf_descb, - w, z, dlaf_descz, eigenvalues_index_begin, + w, z, dlaf_descz, eigenvalues_index_begin - 1, eigenvalues_index_end); } } diff --git a/test/unit/c_api/eigensolver/test_eigensolver_c_api.cpp b/test/unit/c_api/eigensolver/test_eigensolver_c_api.cpp index bfeae05adb..fecc8651d5 100644 --- a/test/unit/c_api/eigensolver/test_eigensolver_c_api.cpp +++ b/test/unit/c_api/eigensolver/test_eigensolver_c_api.cpp @@ -188,10 +188,16 @@ void testEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType mb, int desc_a[] = {1, dlaf_context, (int) m, (int) m, (int) mb, (int) mb, 0, 0, lld_a}; int desc_z[] = {1, dlaf_context, (int) m, (int) m, (int) mb, (int) mb, 0, 0, lld_eigenvectors}; int info = -1; + + // Treat special case when eval_idx_end is 0 for the C API + // The ScaLAPACK API uses base 1 indexing + const SizeType eval_idx_end_scalapack = m > 0 && eval_idx_end == 0 ? 1 : eval_idx_end; + if constexpr (std::is_same_v) { if (eigenvalues_index_end.has_value()) C_dlaf_pdsyevd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); else C_dlaf_pdsyevd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, desc_z, &info); @@ -199,7 +205,8 @@ void testEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType mb, else if constexpr (std::is_same_v) { if (eigenvalues_index_end.has_value()) C_dlaf_pssyevd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); else C_dlaf_pssyevd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, desc_z, &info); @@ -207,7 +214,8 @@ void testEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType mb, else if constexpr (std::is_same_v>) { if (eigenvalues_index_end.has_value()) C_dlaf_pzheevd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); else C_dlaf_pzheevd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, desc_z, &info); @@ -215,7 +223,8 @@ void testEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType mb, else if constexpr (std::is_same_v>) { if (eigenvalues_index_end.has_value()) C_dlaf_pcheevd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); else C_dlaf_pcheevd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, desc_z, &info); diff --git a/test/unit/c_api/eigensolver/test_gen_eigensolver_c_api.cpp b/test/unit/c_api/eigensolver/test_gen_eigensolver_c_api.cpp index 785d48223d..bddbe79f52 100644 --- a/test/unit/c_api/eigensolver/test_gen_eigensolver_c_api.cpp +++ b/test/unit/c_api/eigensolver/test_gen_eigensolver_c_api.cpp @@ -274,12 +274,17 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType int desc_b[] = {1, dlaf_context, (int) m, (int) m, (int) mb, (int) mb, 0, 0, lld_b}; int desc_z[] = {1, dlaf_context, (int) m, (int) m, (int) mb, (int) mb, 0, 0, lld_eigenvectors}; int info = -1; + + // Treat special case when eval_idx_end is 0 for the C API + // The ScaLAPACK API uses base 1 indexing + const SizeType eval_idx_end_scalapack = m > 0 && eval_idx_end == 0 ? 1 : eval_idx_end; + if constexpr (std::is_same_v) { if constexpr (factorization == Factorization::do_factorization) { if (eigenvalues_index_end.has_value()) { C_dlaf_pdsygvd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, - desc_z, 0, eval_idx_end, &info); + desc_z, 1, eval_idx_end_scalapack, &info); } else { C_dlaf_pdsygvd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, @@ -294,8 +299,8 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType if (eigenvalues_index_end.has_value()) { C_dlaf_pdsygvd_partial_spectrum_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, - eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); } else { C_dlaf_pdsygvd_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, @@ -309,7 +314,7 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType if (eigenvalues_index_end.has_value()) { C_dlaf_pssygvd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, - desc_z, 0, eval_idx_end, &info); + desc_z, 1, eval_idx_end_scalapack, &info); } else { C_dlaf_pssygvd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, @@ -324,8 +329,8 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType if (eigenvalues_index_end.has_value()) { C_dlaf_pssygvd_partial_spectrum_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, - eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); } else { C_dlaf_pssygvd_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, @@ -339,7 +344,7 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType if (eigenvalues_index_end.has_value()) { C_dlaf_pzhegvd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, - desc_z, 0, eval_idx_end, &info); + desc_z, 1, eval_idx_end_scalapack, &info); } else { C_dlaf_pzhegvd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, @@ -354,8 +359,8 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType if (eigenvalues_index_end.has_value()) { C_dlaf_pzhegvd_partial_spectrum_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, - eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); } else { C_dlaf_pzhegvd_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, @@ -369,7 +374,7 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType if (eigenvalues_index_end.has_value()) { C_dlaf_pchegvd_partial_spectrum(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, local_eigenvectors_ptr, 1, 1, - desc_z, 0, eval_idx_end, &info); + desc_z, 1, eval_idx_end_scalapack, &info); } else { C_dlaf_pchegvd(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, @@ -384,8 +389,8 @@ void testGenEigensolver(const blas::Uplo uplo, const SizeType m, const SizeType if (eigenvalues_index_end.has_value()) { C_dlaf_pchegvd_partial_spectrum_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1, desc_b, eigenvalues_ptr, - local_eigenvectors_ptr, 1, 1, desc_z, 0, - eval_idx_end, &info); + local_eigenvectors_ptr, 1, 1, desc_z, 1, + eval_idx_end_scalapack, &info); } else { C_dlaf_pchegvd_factorized(dlaf_uplo, (int) m, local_a_ptr, 1, 1, desc_a, local_b_ptr, 1, 1,