<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Did you solve this problem? in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1137796#M26151</link>
    <description>&lt;P&gt;Did you solve this problem? if not, why don't you try to change the type to General matrix?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now suffering from symmetric diagonalization using mkl_sparse_d_ev function. In my case, if I use the general format (even though the matrix is still symmetric), the function works perfectly.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Jun 2020 09:57:48 GMT</pubDate>
    <dc:creator>Choi__Sunghwan</dc:creator>
    <dc:date>2020-06-03T09:57:48Z</dc:date>
    <item>
      <title>segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1137795#M26150</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I am trying to calculate eigenvalues of some real symmetric sparse matrices. What I notice is that the program crashes occasionally. I found a minimum working example:&lt;/P&gt;

&lt;PRE class="brush:cpp; class-name:dark;"&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;mkl.h&amp;gt;
#include &amp;lt;mkl_spblas.h&amp;gt;
#include &amp;lt;mkl_solvers_ee.h&amp;gt;

int main()
{
	int i;
    MKL_INT pm[128];
    mkl_sparse_ee_init(pm);
    // feastinit(pm);  // Using FEAST is fine
    char ls_which = 'L';
    sparse_matrix_t mat_handle;

    double vals[] = {3, 1, 1, 5, 1, 5, 5};
    MKL_INT cols[] = {0, 1, 3, 1, 2, 2, 3};
    MKL_INT rows[] =  {0, 3, 5, 6, 7};

    double vals2[] = {3, 1, 1, 1, 5, 5, 5};
    MKL_INT cols2[] = {0, 1, 2, 3, 1, 2, 3};
    MKL_INT rows2[] =  {0, 4, 5, 6, 7};

    MKL_INT ret_k;
    double ret_E[4], ret_X[4*4], ret_res[4];
    struct matrix_descr descs = {.type = SPARSE_MATRIX_TYPE_SYMMETRIC,
                               .mode = SPARSE_FILL_MODE_UPPER,
                               .diag = SPARSE_DIAG_NON_UNIT
    };
    int csize = 4;
    sparse_status_t spflag = mkl_sparse_d_create_csr(&amp;amp;mat_handle, SPARSE_INDEX_BASE_ZERO, csize, csize,
                           rows, rows+1, cols, vals);
    printf("create_csr return: %d\n", (int)spflag );
    spflag = mkl_sparse_d_ev(&amp;amp;ls_which, pm, mat_handle, descs, csize, &amp;amp;ret_k, ret_E, ret_X, ret_res);
    printf("sparse_ev return: %d\n", (int)spflag );
    for(i=0; i&amp;lt;4; ++i)
    {
    	printf("%f ", ret_E&lt;I&gt;);
    }
    printf("\n");
    spflag = mkl_sparse_d_create_csr(&amp;amp;mat_handle, SPARSE_INDEX_BASE_ZERO, csize, csize,
                           rows2, rows2+1, cols2, vals2);
printf("create_csr return: %d\n", (int)spflag );
    spflag = mkl_sparse_d_ev(&amp;amp;ls_which, pm, mat_handle, descs, csize, &amp;amp;ret_k, ret_E, ret_X, ret_res); // *Crash* here
    printf("sparse_ev return: %d\n", (int)spflag );
    for(i=0; i&amp;lt;4; ++i)
    {
    	printf("%f ", ret_E&lt;I&gt;);
    }

    printf("\n");
}
&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;The first matrix is&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;[3, 1, 0, 1;&lt;BR /&gt;
	1, 5, 1, 0;&lt;BR /&gt;
	0, 1, 5, 0;&lt;BR /&gt;
	1, 0, 0, 5 &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;The second matrix is&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;[3, 1, 1, 1;&lt;BR /&gt;
	1, 5, 0, 0;&lt;BR /&gt;
	1, 0, 5, 0;&lt;BR /&gt;
	1, 0, 0, 5 &lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;which has two degenerated eigenvalue 5. I am wondering what happens.&lt;/P&gt;

&lt;P&gt;Also attach the simple Makefile:&lt;/P&gt;

&lt;PRE class="brush:plain; class-name:dark;"&gt;INTEL_ROOT = /opt/intel/compilers_and_libraries/mac
MKLROOT = $(INTEL_ROOT)/mkl
FLAGS =   -L${MKLROOT}/lib -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
mkl_test: test.c
	icc -o mkl_test test.c -I$(MKLROOT)/include $(FLAGS) &lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Oct 2018 01:29:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1137795#M26150</guid>
      <dc:creator>hu__yi</dc:creator>
      <dc:date>2018-10-02T01:29:43Z</dc:date>
    </item>
    <item>
      <title>Did you solve this problem?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1137796#M26151</link>
      <description>&lt;P&gt;Did you solve this problem? if not, why don't you try to change the type to General matrix?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am now suffering from symmetric diagonalization using mkl_sparse_d_ev function. In my case, if I use the general format (even though the matrix is still symmetric), the function works perfectly.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 09:57:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1137796#M26151</guid>
      <dc:creator>Choi__Sunghwan</dc:creator>
      <dc:date>2020-06-03T09:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1186970#M29630</link>
      <description>&lt;P&gt;I have a positive semi-definite matrix with two zero-eigenvalues. I'm trying to find its smallest, non-zero eigenvalue. I seem to be having the same trouble when I use &lt;STRONG&gt;SPARSE_MATRIX_TYPE_SYMMETRIC&lt;/STRONG&gt;. This is the backtrace:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;#0  0x00007ffff591c0e7 in mkl_sparse_d_transpose_matrix_i4 () from /opt/intel/mkl/lib/intel64/libmkl_intel_thread.so
#1  0x00007ffff597eda2 in mkl_sparse_d_transposeMatrix_i4 () from /opt/intel/mkl/lib/intel64/libmkl_intel_thread.so
#2  0x00007ffff593eaba in mkl_sparse_d_add_i4 () from /opt/intel/mkl/lib/intel64/libmkl_intel_thread.so
#3  0x00007ffff597b06b in create_gen_from_sym () from /opt/intel/mkl/lib/intel64/libmkl_intel_thread.so
#4  0x00007ffff597c730 in mkl_sparse_d_optimize_csr_mv_i4 () from /opt/intel/mkl/lib/intel64/libmkl_intel_thread.so
#5  0x00007fffef3e575b in mkl_sparse_optimize_i4_avx2 () from /opt/intel/mkl/lib/intel64/libmkl_avx2.so
#6  0x00007ffff68e7fe1 in mkl_sparse_d_ev_i4 () from /opt/intel/mkl/lib/intel64/libmkl_intel_thread.so&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Never-mind; I have made a trivial mistake. It works for me with either setting, and the SYMMETRIC option is slightly faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 13:24:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1186970#M29630</guid>
      <dc:creator>Vishnu</dc:creator>
      <dc:date>2020-06-25T13:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1284806#M31384</link>
      <description>&lt;P&gt;I encounter the same problem with you. I am solving eigen problem for a symmetric sparse matrix with dim=10353252 and nnz=2837797476. I need k0=100 smallest eigenvalues and corresponding eigenvectors. Since it is a huge matrix , time cost for feast algorithm is unaffordable , so the only choice is Krylov-&lt;SPAN&gt;Schur algorithm. But I find that&amp;nbsp;mkl_sparse_?_ev end with a&amp;nbsp;segment error&amp;nbsp;when the matrix has degenerate eigenvalues.I provid a simple example here:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;iomanip&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;string&amp;gt;

#include "mkl.h"
#include "mkl_solvers_ee.h"

void printmat(const std::string &amp;amp;name, int m, int n, int lda, const double *mat, int precision);

int main() {
    int N = 8;
    int ia[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
    int ja[8] = {0, 1, 2, 3, 4, 5, 6, 7};
    double a[8] = {1, 2, 3, 4, 4, 3, 2, 1};

    sparse_matrix_t A;
    struct matrix_descr descr = {SPARSE_MATRIX_TYPE_SYMMETRIC, SPARSE_FILL_MODE_UPPER, SPARSE_DIAG_NON_UNIT};
    mkl_sparse_d_create_csr(&amp;amp;A, SPARSE_INDEX_BASE_ZERO, N, N, ia, ia + 1, ja, a);

    double denA[64] = {1, 0, 0, 0, 0, 0, 0, 0,
                       0, 2, 0, 0, 0, 0, 0, 0,
                       0, 0, 3, 0, 0, 0, 0, 0,
                       0, 0, 0, 4, 0, 0, 0, 0,
                       0, 0, 0, 0, 4, 0, 0, 0,
                       0, 0, 0, 0, 0, 3, 0, 0,
                       0, 0, 0, 0, 0, 0, 2, 0,
                       0, 0, 0, 0, 0, 0, 0, 1};

    double egvalues[8];

    LAPACKE_dsyev(LAPACK_ROW_MAJOR, 'V', 'U', N, denA, N, egvalues);
    printmat("exact eigen values:", 1, N, N, egvalues, 15);
    printmat("exact eigen vectors:", N, N, N, denA, 15);

    double spE[8];
    double spEv[64];
    double Res[8];
    int k0 = 5;
    int k;
    int pm[128];
    mkl_sparse_ee_init(pm);
    pm[2] = 1;
    pm[6] = 1;
    pm[7] = 1;

    int info = mkl_sparse_d_ev("S", pm, A, descr, k0, &amp;amp;k, spE, spEv, Res);
    if (info != 0) {
        printf("Routine mkl_sparse_d_ev returns code of ERROR: %i", (int)info);
        return 1;
    }

    printf("#mode found/subspace %d %d \n", k, k0);
    printmat("estimated eigen values:", 1, k, k, spE, 15);
    printmat("estimated eigen vectors:", k, N, N, spEv, 15);
}

void printmat(const std::string &amp;amp;name, int m, int n, int lda, const double *mat, int prec) {
    std::ios::fmtflags OldFlags = std::cout.flags();
    std::cout &amp;lt;&amp;lt; name &amp;lt;&amp;lt; " :" &amp;lt;&amp;lt; std::endl;
    std::cout.unsetf(std::ios::floatfield);
    std::cout.setf(std::ios::fixed);
    std::cout.precision(prec);

    int width = prec + 3;
    for (int i = 0; i &amp;lt; m; i++) {
        for (int j = 0; j &amp;lt; n; j++) {
            std::cout &amp;lt;&amp;lt; std::setw(width) &amp;lt;&amp;lt; mat[i * lda + j];
            if (j != n - 1) std::cout &amp;lt;&amp;lt; "   ";
        }
        std::cout &amp;lt;&amp;lt; std::endl;
    }

    std::cout.flags(OldFlags);
    std::cout.precision(6);
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;and Makefile:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CC=icpc -std=c++11 -O3
CFLAGS=-I"${MKLROOT}/include"
LDFLAGS=-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl

minimal: minimal.cpp
	$(CC) $(CFLAGS) $^ ${LDFLAGS} -o $@&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;result is&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;exact eigen values: :
 1.000000000000000    1.000000000000000    2.000000000000000    2.000000000000000    3.000000000000000    3.000000000000000    4.000000000000000    4.000000000000000
exact eigen vectors: :
 1.000000000000000    0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    1.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    1.000000000000000   -0.000000000000000   -0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    1.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000    1.000000000000000    0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000    1.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000
 0.000000000000000    0.000000000000000    1.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000
 0.000000000000000    1.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000
Segmentation fault (core dumped)&lt;/LI-CODE&gt;
&lt;P&gt;can any one help me?&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 11:24:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1284806#M31384</guid>
      <dc:creator>fanzhenhao</dc:creator>
      <dc:date>2021-05-26T11:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1284955#M31386</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/127893"&gt;@fanzhenhao&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;
&lt;P&gt;Which version of MKL/oneMKL are you using? I suspect, not the latest oneMKL 2021.2.&lt;/P&gt;
&lt;P&gt;Can you try with oneMKL 2021.2?&lt;/P&gt;
&lt;P&gt;I've checked your reproducer and I see the crash for oneMKL 2021.1 but not for oneMKL 2021.2. Between 2021.1 and 2021.2 we have fixed an issue for mkl_sparse_?_ev which could cause the crash. The issue was not directly related to the fact of multiple eigenvalues being equal.&lt;/P&gt;
&lt;P&gt;Best,&lt;BR /&gt;Kirill&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 00:07:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1284955#M31386</guid>
      <dc:creator>Kirill_V_Intel</dc:creator>
      <dc:date>2021-05-27T00:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1284979#M31387</link>
      <description>&lt;P&gt;I also checked this example on lin/win os with the latest mkl 2021.2. Everything works. Please find out the output results I obtained ( i only added the mkl version into your 8x8 example)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$ ./a.out&lt;BR /&gt;Major version: 2021&lt;BR /&gt;Minor version: 0&lt;BR /&gt;Update version: 2&lt;BR /&gt;Product status: Product&lt;BR /&gt;Platform: Intel(R) 64 architecture&lt;BR /&gt;Processor optimization: Intel(R) Advanced Vector Extensions 2 (Intel(R) AVX2) enabled processors&lt;BR /&gt;exact eigen values: :&lt;BR /&gt;1.000000000000000 1.000000000000000 2.000000000000000 2.000000000000000 3.000000000000000 3.000000000000000 4.000000000000000 4.000000000000000&lt;BR /&gt;exact eigen vectors: :&lt;BR /&gt;1.000000000000000 0.000000000000000 -0.000000000000000 -0.000000000000000 -0.000000000000000 -0.000000000000000 -0.000000000000000 -0.000000000000000&lt;BR /&gt;0.000000000000000 0.000000000000000 -0.000000000000000 1.000000000000000 -0.000000000000000 -0.000000000000000 -0.000000000000000 -0.000000000000000&lt;BR /&gt;0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000 -0.000000000000000 1.000000000000000 -0.000000000000000 -0.000000000000000&lt;BR /&gt;0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000 -0.000000000000000 1.000000000000000&lt;BR /&gt;0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000 1.000000000000000 0.000000000000000&lt;BR /&gt;0.000000000000000 0.000000000000000 -0.000000000000000 0.000000000000000 1.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000&lt;BR /&gt;0.000000000000000 0.000000000000000 1.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000&lt;BR /&gt;0.000000000000000 1.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000&lt;BR /&gt;#mode found/subspace 5 5&lt;BR /&gt;estimated eigen values: :&lt;BR /&gt;-38.417097479072368 -32.130736776317789 1.917149680662010 2.069736657079272 2.078685516112698&lt;BR /&gt;estimated eigen vectors: :&lt;BR /&gt;0.288169623788171 0.084613141773030 0.002296639905500 0.102474464750271 -0.041051918962990 -0.028604202552957 -0.097697834031295 -0.791422317063795&lt;BR /&gt;0.274591207424757 -0.066020473633912 -0.039981838675984 0.009812577438120 -0.005807601128427 -0.027234252718160 0.387776058744686 -0.028155758328511&lt;BR /&gt;0.171773849005140 -0.195145536917235 -0.071734618996850 -0.011425401968798 -0.038679952834560 -0.102127481931804 -0.646123212257801 0.252186135848476&lt;BR /&gt;-0.696702821790961 0.124452896982733 0.043654897995420 0.025202102997553 0.005029418411288 0.041915089373964 0.072836574705455 -0.140420651126935&lt;BR /&gt;-0.184858373956651 -0.235909544774302 0.224689111751713 0.131370188779722 -0.006464048518765 0.226302939614696 -0.075046316413411 -0.081881213817877&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 03:21:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1284979#M31387</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2021-05-27T03:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1285009#M31388</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;Thank &lt;/SPAN&gt;&lt;SPAN&gt;you&lt;/SPAN&gt; &lt;SPAN&gt;for&lt;/SPAN&gt;&lt;SPAN&gt; checking the example. But the result seems totally wrong. The exact eigenvalues are [&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;3&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;4&lt;/SPAN&gt;&lt;SPAN&gt;] but the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;mkl_sparse_d_ev returns the smallest &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt; eigenvalues are [&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;38.417097479072368&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;32.130736776317789&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;1.917149680662010&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;2.069736657079272&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;2.078685516112698&lt;/SPAN&gt;&lt;SPAN&gt;].&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I have updated my mkl to&amp;nbsp;2021.2.0.296, and supplement a pm[9] code check.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;iomanip&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;string&amp;gt;

#include "mkl.h"
#include "mkl_solvers_ee.h"

void printmat(const std::string &amp;amp;name, int m, int n, int lda, const double *mat, int precision);

int main() {
    int N = 8;
    int ia[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
    int ja[8] = {0, 1, 2, 3, 4, 5, 6, 7};
    double a[8] = {1, 2, 3, 4, 4, 3, 2, 1};

    sparse_matrix_t A;
    struct matrix_descr descr = {SPARSE_MATRIX_TYPE_SYMMETRIC, SPARSE_FILL_MODE_UPPER, SPARSE_DIAG_NON_UNIT};
    mkl_sparse_d_create_csr(&amp;amp;A, SPARSE_INDEX_BASE_ZERO, N, N, ia, ia + 1, ja, a);

    double denA[64] = {1, 0, 0, 0, 0, 0, 0, 0,
                       0, 2, 0, 0, 0, 0, 0, 0,
                       0, 0, 3, 0, 0, 0, 0, 0,
                       0, 0, 0, 4, 0, 0, 0, 0,
                       0, 0, 0, 0, 4, 0, 0, 0,
                       0, 0, 0, 0, 0, 3, 0, 0,
                       0, 0, 0, 0, 0, 0, 2, 0,
                       0, 0, 0, 0, 0, 0, 0, 1};

    double egvalues[8];

    LAPACKE_dsyev(LAPACK_ROW_MAJOR, 'V', 'U', N, denA, N, egvalues);
    printmat("exact eigen values:", 1, N, N, egvalues, 15);
    printmat("exact eigen vectors:", N, N, N, denA, 15);

    double spE[8];
    double spEv[64];
    double Res[8];
    int k0 = 5;
    int k;
    int pm[128];
    mkl_sparse_ee_init(pm);
    pm[2] = 1;
    pm[6] = 1;
    pm[7] = 1;

    int info = mkl_sparse_d_ev("S", pm, A, descr, k0, &amp;amp;k, spE, spEv, Res);
    if (info != 0) {
        printf("Routine mkl_sparse_d_ev returns code of ERROR: %i", (int)info);
        return 1;
    }

    switch (pm[9]) {
        case 0:
            std::cout &amp;lt;&amp;lt; "The iterations stopped since convergence has been detected." &amp;lt;&amp;lt; std::endl;
            break;
        case -1:
            std::cout &amp;lt;&amp;lt; "Maximum number of iterations has been reached and even the \
residual norm estimates have not converged." &amp;lt;&amp;lt; std::endl;
            break;
        case -2:
            std::cout &amp;lt;&amp;lt; "maximum number of iterations has been reached despite the \
residual norm estimates have converged \
(but the true residuals for eigenpairs have not)." &amp;lt;&amp;lt; std::endl;
            break;
        case -3:
            std::cout &amp;lt;&amp;lt; "the iterations stagnated and even the residual norm estimates \
have not converged." &amp;lt;&amp;lt; std::endl;
            break;
        case -4:
            std::cout &amp;lt;&amp;lt; "The iterations stagnated while the eigenvalues have converged \
(but the true residuals for eigenpairs do not)." &amp;lt;&amp;lt; std::endl;
            break;
        default:
            std::cout &amp;lt;&amp;lt; "Unknow errors occurs." &amp;lt;&amp;lt; std::endl;
    };

    printf("#mode found/subspace %d %d \n", k, k0);
    printmat("estimated eigen values:", 1, k, k, spE, 15);
    printmat("estimated eigen vectors:", k, N, N, spEv, 15);
}

void printmat(const std::string &amp;amp;name, int m, int n, int lda, const double *mat, int prec) {
    std::ios::fmtflags OldFlags = std::cout.flags();
    std::cout &amp;lt;&amp;lt; name &amp;lt;&amp;lt; " :" &amp;lt;&amp;lt; std::endl;
    std::cout.unsetf(std::ios::floatfield);
    std::cout.setf(std::ios::fixed);
    std::cout.precision(prec);

    int width = prec + 3;
    for (int i = 0; i &amp;lt; m; i++) {
        for (int j = 0; j &amp;lt; n; j++) {
            std::cout &amp;lt;&amp;lt; std::setw(width) &amp;lt;&amp;lt; mat[i * lda + j];
            if (j != n - 1) std::cout &amp;lt;&amp;lt; "   ";
        }
        std::cout &amp;lt;&amp;lt; std::endl;
    }

    std::cout.flags(OldFlags);
    std::cout.precision(6);
}&lt;/LI-CODE&gt;
&lt;P&gt;it shows that&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;LI-CODE lang="markup"&gt;exact eigen values: :
 1.000000000000000    1.000000000000000    2.000000000000000    2.000000000000000    3.000000000000000    3.000000000000000    4.000000000000000    4.000000000000000
exact eigen vectors: :
 1.000000000000000    0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    1.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000   -0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    1.000000000000000   -0.000000000000000   -0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    1.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000    1.000000000000000    0.000000000000000
 0.000000000000000    0.000000000000000   -0.000000000000000    0.000000000000000    1.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000
 0.000000000000000    0.000000000000000    1.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000
 0.000000000000000    1.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000    0.000000000000000
maximum number of iterations has been reached despite the residual norm estimates have converged (but the true residuals for eigenpairs have not).
#mode found/subspace 5 5 
estimated eigen values: :
-38.417097479072368   -32.130736776317789    1.917149680662010    2.069736657079272    2.078685516112698
estimated eigen vectors: :
 0.288169623788171    0.084613141773030    0.002296639905500    0.102474464750271   -0.041051918962990   -0.028604202552957   -0.097697834031295   -0.791422317063795
 0.274591207424757   -0.066020473633912   -0.039981838675984    0.009812577438120   -0.005807601128427   -0.027234252718160    0.387776058744686   -0.028155758328511
 0.171773849005140   -0.195145536917235   -0.071734618996850   -0.011425401968798   -0.038679952834560   -0.102127481931804   -0.646123212257801    0.252186135848476
-0.696702821790961    0.124452896982733    0.043654897995420    0.025202102997553    0.005029418411288    0.041915089373964    0.072836574705455   -0.140420651126935
-0.184858373956651   -0.235909544774302    0.224689111751713    0.131370188779722   -0.006464048518765    0.226302939614696   -0.075046316413411   -0.081881213817877&lt;/LI-CODE&gt;
&lt;P&gt;it means that&amp;nbsp;maximum number of iterations has been reached despite the residual norm estimates have converged (but the true residuals for eigenpairs have not).&amp;nbsp;&lt;SPAN&gt;Is it a programming bug or the Krylov-Schur Algorithm can not handle matrices with&amp;nbsp;degenerate eigenvalues?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 06:07:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1285009#M31388</guid>
      <dc:creator>fanzhenhao</dc:creator>
      <dc:date>2021-05-27T06:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1285031#M31389</link>
      <description>&lt;P&gt;yes, I see the same outputs and it could be the problem with this EV solver. We will check and keep this thread updated.&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 07:40:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1285031#M31389</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2021-05-27T07:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: segment error on mkl_sparse_?_ev when the matrix has degenerate eigenvalues</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1285060#M31390</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 09:30:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/segment-error-on-mkl-sparse-ev-when-the-matrix-has-degenerate/m-p/1285060#M31390</guid>
      <dc:creator>fanzhenhao</dc:creator>
      <dc:date>2021-05-27T09:30:56Z</dc:date>
    </item>
  </channel>
</rss>

