<?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 Problem applying dsyevr to a large matrix in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780131#M1399</link>
    <description>I am attempting to diagonalize a 66113 X 66113 real symmetric matrix using LAPACK's dsyevr routine. Each element in the matrix is an 8-byte float. I am running MKL version 10.2 update 4 on a machine with16 Intel Xeon CPUs each running at 2.93GHz with 4 CPU cores. The machine has about 128GB of memory.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;While I am able to successfully diagonalize small matrices (the largest I've test is a 10 by 10), diagonalizing my large matrix has proven challenging. My code compiles and even seems to run fine, but after dsyevr has finished executing the parameter "info" is greater than 1, indicating that there was some kind of "internal error".&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Does anyone have any idea what might cause this internal error? There is no explicit segmentation fault. The code fully completes except the arrays with eigenvalues and eigenvectors come back empty.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;In case somebody thinks this may be a code related issue, I've included it below. The first is the C code that allocates memory, reads in files, etc. The next is the FORTRAN subroutine called by this C code. Finally, I include the linker that puts it all together.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;SPAN style="text-decoration: underline;"&gt;EigenFind.c&lt;/SPAN&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;////////////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV&gt;// This routine calculates the eigenvalues and eigenvectors of the symmetric matrix    //&lt;/DIV&gt;&lt;DIV&gt;// of doubles fwritten to the file "fnameANM" using the dsyevr LAPACK procedure. Since  //&lt;/DIV&gt;&lt;DIV&gt;// memory constraints restrict the creation of a huge, complete eigenvector file, only  //&lt;/DIV&gt;&lt;DIV&gt;// the il-th through iu-th eigenvalues and eigenvectors are returned where 1&amp;lt;=il&amp;lt;=    //&lt;/DIV&gt;&lt;DIV&gt;// iu&amp;lt;=nrows. The eigenvalues are stored from most positive to most negative. This    //&lt;/DIV&gt;&lt;DIV&gt;// routine is somewhat faster than the packed version.                  //&lt;/DIV&gt;&lt;DIV&gt;////////////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV&gt;void GetEigenvectors(char *fnameANM, long nrows, long il, long iu) {&lt;/DIV&gt;&lt;DIV&gt;double *w, *z, *work, rnrows, working, *EArray;&lt;/DIV&gt;&lt;DIV&gt;size_t size, ii, ee;&lt;/DIV&gt;&lt;DIV&gt;long info, lz, lzp, lisuppz, lwork, m, *iwork, liwork, iil, iiu, cc, rr;&lt;/DIV&gt;&lt;DIV&gt;info = NULL;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;printf("\\nThis routine returns eigenmode #%d (larger eigenvalue) through %d (smaller eigenvalue).\\n\\n",il,iu);&lt;/DIV&gt;&lt;DIV&gt;//dsyevr puts the largest Evl's Evc last, so this fixes that&lt;/DIV&gt;&lt;DIV&gt;long swap = iu;&lt;/DIV&gt;&lt;DIV&gt;iu = nrows - il + 1;&lt;/DIV&gt;&lt;DIV&gt;il = nrows - swap + 1;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;lz = iu-il+1;   //Number of eigenvectors to be returned.&lt;/DIV&gt;&lt;DIV&gt;lzp = lz;     //Same variable, but this doesn't get overwritten.&lt;/DIV&gt;&lt;DIV&gt;lisuppz = 4*lz;  //Size of the iwork array&lt;/DIV&gt;&lt;DIV&gt;lwork = 50*nrows; //Size of work array&lt;/DIV&gt;&lt;DIV&gt;liwork= 40*nrows; //Size of lwork array&lt;/DIV&gt;&lt;DIV&gt;//////////////////// In case of seg fault, try upping the size of these arrays.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;rnrows = nrows;&lt;/DIV&gt;&lt;DIV&gt;working = rnrows*rnrows;&lt;/DIV&gt;&lt;DIV&gt;size = floor(working+0.0001);&lt;/DIV&gt;&lt;DIV&gt;double *a = freadDMatrix(fnameANM,size);&lt;/DIV&gt;&lt;DIV&gt;printf("The final element of the average noise matrix is %f.\\n",a[size-1]);&lt;/DIV&gt;&lt;DIV&gt;w = (double *)malloc(nrows*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for w: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;z = (double *)malloc(nrows*lz*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for z: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;work = (double *)malloc(lwork*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for work: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;iwork = (long *)malloc(liwork*sizeof(long));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for iwork: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;lwork = -1; liwork = -1; //Start with -1 to find optimal values.&lt;/DIV&gt;&lt;DIV&gt;printf("\\n\\nUsing dsyevr to determine optimal sizes of lwork and iwork.\\n");&lt;/DIV&gt;&lt;DIV&gt;dsyevrf_(&amp;amp;nrows, a, &amp;amp;il, &amp;amp;iu, &amp;amp;m, w, z, &amp;amp;lz, &amp;amp;lisuppz, work, &amp;amp;lwork, iwork, &amp;amp;liwork, &amp;amp;info);&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;if(info==0) {&lt;/DIV&gt;&lt;DIV&gt; printf("Correct values of iwork and liwork found successfully after %d seconds.\\n\\n", tEnd-tBegin);&lt;/DIV&gt;&lt;DIV&gt; lwork = floor(work[0]+0.000001);  printf("minimum size of lwork = %d\\n",lwork);&lt;/DIV&gt;&lt;DIV&gt; liwork = iwork[0];         printf("minimum size of liwork = %d\\n",liwork);&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; free(work); free(iwork);&lt;/DIV&gt;&lt;DIV&gt; work = (double *)malloc(lwork*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt; printf("Regarding memory allocation for work: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt; iwork = (long *)malloc(liwork*sizeof(long));&lt;/DIV&gt;&lt;DIV&gt; printf("Regarding memory allocation for iwork: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;if(info&amp;lt;0) printf("Parameter %d had an illegal value.\\n",(-1*info));&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;////////////// THIS IS THE REAL EXECUTION OF THE EIGENMODE FINDER //////////////&lt;/DIV&gt;&lt;DIV&gt;printf("\\nExecuting dsyevrf.\\n");&lt;/DIV&gt;&lt;DIV&gt;dsyevrf_(&amp;amp;nrows, a, &amp;amp;il, &amp;amp;iu, &amp;amp;m, w, z, &amp;amp;lz, &amp;amp;lisuppz, work, &amp;amp;lwork, iwork, &amp;amp;liwork, &amp;amp;info);&lt;/DIV&gt;&lt;DIV&gt;tEnd = time(tloc);&lt;/DIV&gt;&lt;DIV&gt;printf("Exited dsyevrf.\\n\\n");&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;if(info&amp;lt;0) printf("Parameter %d had an illegal value.\\n",(-1*info));&lt;/DIV&gt;&lt;DIV&gt;if(info&amp;gt;1) printf("AN INTERNAL ERROR HAS OCCURRED\\nAN INTERNAL ERROR HAS OCCURRED\\n\\n");&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;void dspevxf_(long long *nrows, double *ap, long long *trisize, long long *il, long long *iu, long long *m, double *w, double *z, long *lz, double *work, long long *lwork, long long *iwork, long long *liwork, long&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;int main ()&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;long long ncells6 = 66113;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;///////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;///////////////////////////////// GetEigenvectors /////////////////////////////////////&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;///////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;char *fnameGCorr_sy = "/home/mj/PSnoise/noiseMat_Vec/GCorMat_R6sy_fwrite";&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;long il_ge = 1;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;long iu_ge = 10000;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;/*GetEigenvectors[1. Name of symmetric, fwritten ncells by ncells covariance function&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;           to be diagonalized&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;  2. Dimension of above matrix, also # of cells&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;  3. Value &amp;gt;= 1 equaling # of first eigenvector returned (1 is largest)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;  4. Value &amp;gt;= il and &amp;lt;= ncells equaling # of final eigenvector returned] */&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;GetEigenvectors(fnameGCorr_sy, ncells6, il_ge, iu_ge);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;B&gt;LAPACK_dspevx_f.f&lt;/B&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;c********************************************************************&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  subroutine dspevxf(n,ap,lap,il,iu,m,w,z,lz,work,lwork,iwork,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  +liwork,ifail,info)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c--------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   Calculates selected eigenvalues and eigenvectors of a&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   symmetric matrix T triangularly packed into ap.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   Based upon the dspevx routine.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c  &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   This routine is called from the C function GetEigenvectorsPacked&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   'N' should be used if only eigenvalues are desired.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   'V' should be used if both eigenvalues and eigenvalues are&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    desired.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   For the second parameter, 'A' means all eigenvalues will be&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    found. 'V' means all eigenvalues in the half-open interval&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    (vl,vu] will be found. 'I' mean the eigenvalues with indices&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    il through iu will be found.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   For the third parameter, 'U' means the symmetric matrix is&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    stored in the upper triangle of a and 'L' means its stored in&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the lower triangle.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "n" is the number of rows (columns) in the symmetric matrix&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "ap" is the nXn array packed into a size "lap" = n(n+1)/2 housing&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the symmetric matrix in its upper or lower triangle.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "vl" and "vu" are the lower and upper bounds respectively of the&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    interval to be searched for eigenvalues. "vl" &amp;lt;= "vu". These&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    values are referenced only if the second parameter = 'V'&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "il" and "iu" are the indices of the smallest and largest eigenvalues&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    to be returned such that 1&amp;lt;=il&amp;lt;=iu&amp;lt;=in. These values are referenced&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    only if the second parameter = 'I'&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "abstol" is the absolute error tolerance for the eigenvalues.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "z" is an output parameter. If 'N', this is not referenced. If&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    'V', then this will contain the "lz" eigenvectors specified by&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the range "il" through "iu".&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "m" is the total number of eigenvalues found.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "w" is the array to which the first m eigenvalues are stored.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "isuppz" contains, upon output, the indices indicating the non-zero&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    elements in "z". It has length "lisuppz".&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "work" is a workspace array of length "lwork" = 8n&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "iwork" is a workspace array of length "liwork" = 5n&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "ifail" is an integer array of length "n" containing the indices of&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the eigenvectors that failed to converge or, if "info"=0, the first&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    m elements of ifal are zero.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "info" is an integer. If all is ok, a 0 is output. If i, the&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    algorithm did not converge and i indicates the number of&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    elements of an intermediate tridiagonal form which did not&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    converge to zero. If -i, the ith parameter had an illegal&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    value.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   Using LAPACK.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  implicit none  &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  integer*8 n,lap,il,iu,m,lz,lwork,liwork,iwork(liwork),ifail(n),&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  +info&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  real*8 ap(lap),vl,vu,abstol,dlamch,w(n),z(n,lz),work(lwork)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  external dlamch&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  abstol = 2*dlamch('S')&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  print *, 'ap(final) = ', ap(lap)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  print *, 'About to compute eigenvectors',il,'through',iu,'.'&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  print *, 'n = ',n&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  call dspevx('V','I','L',n,ap,vl,vu,il,iu,abstol,m,w,z,n,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  +work,iwork,ifail,info)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  return&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  end&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;B&gt;Makefile&lt;/B&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;.f.o:&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;$(F77) -c $&amp;lt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;.c.o:&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;$(CC) -c $&amp;lt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;default:&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;all&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CC = gcc&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;F77 = ifort&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CL = ifort -nofor_main&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CL8= ifort -nofor_main -i8&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;INCF = -I/usr/site/intel_fortran/include   #FORTRAN INCLUDE FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;IMKLF = -I/usr/site/intel_fortran/mkl/include #FORTRAN MKL FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;INCC = -I/usr/site/intel_cpp/include   #C++ INCLUDE FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;IMKLC = -I/usr/site/intel_cpp/mkl/include #C++ MKL FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;LMKL = -Vaxlib -L/usr/site/intel_fortran/mkl/lib/em64t -lfftw3 -lmkl_core -lmkl_sequential -lmkl_intel_ilp64&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;eigen:&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;LAPACK_dspevx_f.oEigenFind.o&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;$(CL8) $^ $(LMKL) -o $@.o&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 13 Jul 2010 21:29:10 GMT</pubDate>
    <dc:creator>mspecian</dc:creator>
    <dc:date>2010-07-13T21:29:10Z</dc:date>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780131#M1399</link>
      <description>I am attempting to diagonalize a 66113 X 66113 real symmetric matrix using LAPACK's dsyevr routine. Each element in the matrix is an 8-byte float. I am running MKL version 10.2 update 4 on a machine with16 Intel Xeon CPUs each running at 2.93GHz with 4 CPU cores. The machine has about 128GB of memory.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;While I am able to successfully diagonalize small matrices (the largest I've test is a 10 by 10), diagonalizing my large matrix has proven challenging. My code compiles and even seems to run fine, but after dsyevr has finished executing the parameter "info" is greater than 1, indicating that there was some kind of "internal error".&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Does anyone have any idea what might cause this internal error? There is no explicit segmentation fault. The code fully completes except the arrays with eigenvalues and eigenvectors come back empty.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;In case somebody thinks this may be a code related issue, I've included it below. The first is the C code that allocates memory, reads in files, etc. The next is the FORTRAN subroutine called by this C code. Finally, I include the linker that puts it all together.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;SPAN style="text-decoration: underline;"&gt;EigenFind.c&lt;/SPAN&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;////////////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV&gt;// This routine calculates the eigenvalues and eigenvectors of the symmetric matrix    //&lt;/DIV&gt;&lt;DIV&gt;// of doubles fwritten to the file "fnameANM" using the dsyevr LAPACK procedure. Since  //&lt;/DIV&gt;&lt;DIV&gt;// memory constraints restrict the creation of a huge, complete eigenvector file, only  //&lt;/DIV&gt;&lt;DIV&gt;// the il-th through iu-th eigenvalues and eigenvectors are returned where 1&amp;lt;=il&amp;lt;=    //&lt;/DIV&gt;&lt;DIV&gt;// iu&amp;lt;=nrows. The eigenvalues are stored from most positive to most negative. This    //&lt;/DIV&gt;&lt;DIV&gt;// routine is somewhat faster than the packed version.                  //&lt;/DIV&gt;&lt;DIV&gt;////////////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV&gt;void GetEigenvectors(char *fnameANM, long nrows, long il, long iu) {&lt;/DIV&gt;&lt;DIV&gt;double *w, *z, *work, rnrows, working, *EArray;&lt;/DIV&gt;&lt;DIV&gt;size_t size, ii, ee;&lt;/DIV&gt;&lt;DIV&gt;long info, lz, lzp, lisuppz, lwork, m, *iwork, liwork, iil, iiu, cc, rr;&lt;/DIV&gt;&lt;DIV&gt;info = NULL;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;printf("\\nThis routine returns eigenmode #%d (larger eigenvalue) through %d (smaller eigenvalue).\\n\\n",il,iu);&lt;/DIV&gt;&lt;DIV&gt;//dsyevr puts the largest Evl's Evc last, so this fixes that&lt;/DIV&gt;&lt;DIV&gt;long swap = iu;&lt;/DIV&gt;&lt;DIV&gt;iu = nrows - il + 1;&lt;/DIV&gt;&lt;DIV&gt;il = nrows - swap + 1;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;lz = iu-il+1;   //Number of eigenvectors to be returned.&lt;/DIV&gt;&lt;DIV&gt;lzp = lz;     //Same variable, but this doesn't get overwritten.&lt;/DIV&gt;&lt;DIV&gt;lisuppz = 4*lz;  //Size of the iwork array&lt;/DIV&gt;&lt;DIV&gt;lwork = 50*nrows; //Size of work array&lt;/DIV&gt;&lt;DIV&gt;liwork= 40*nrows; //Size of lwork array&lt;/DIV&gt;&lt;DIV&gt;//////////////////// In case of seg fault, try upping the size of these arrays.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;rnrows = nrows;&lt;/DIV&gt;&lt;DIV&gt;working = rnrows*rnrows;&lt;/DIV&gt;&lt;DIV&gt;size = floor(working+0.0001);&lt;/DIV&gt;&lt;DIV&gt;double *a = freadDMatrix(fnameANM,size);&lt;/DIV&gt;&lt;DIV&gt;printf("The final element of the average noise matrix is %f.\\n",a[size-1]);&lt;/DIV&gt;&lt;DIV&gt;w = (double *)malloc(nrows*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for w: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;z = (double *)malloc(nrows*lz*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for z: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;work = (double *)malloc(lwork*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for work: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;iwork = (long *)malloc(liwork*sizeof(long));&lt;/DIV&gt;&lt;DIV&gt;printf("Regarding memory allocation for iwork: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;lwork = -1; liwork = -1; //Start with -1 to find optimal values.&lt;/DIV&gt;&lt;DIV&gt;printf("\\n\\nUsing dsyevr to determine optimal sizes of lwork and iwork.\\n");&lt;/DIV&gt;&lt;DIV&gt;dsyevrf_(&amp;amp;nrows, a, &amp;amp;il, &amp;amp;iu, &amp;amp;m, w, z, &amp;amp;lz, &amp;amp;lisuppz, work, &amp;amp;lwork, iwork, &amp;amp;liwork, &amp;amp;info);&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;if(info==0) {&lt;/DIV&gt;&lt;DIV&gt; printf("Correct values of iwork and liwork found successfully after %d seconds.\\n\\n", tEnd-tBegin);&lt;/DIV&gt;&lt;DIV&gt; lwork = floor(work[0]+0.000001);  printf("minimum size of lwork = %d\\n",lwork);&lt;/DIV&gt;&lt;DIV&gt; liwork = iwork[0];         printf("minimum size of liwork = %d\\n",liwork);&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; free(work); free(iwork);&lt;/DIV&gt;&lt;DIV&gt; work = (double *)malloc(lwork*sizeof(double));&lt;/DIV&gt;&lt;DIV&gt; printf("Regarding memory allocation for work: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt; iwork = (long *)malloc(liwork*sizeof(long));&lt;/DIV&gt;&lt;DIV&gt; printf("Regarding memory allocation for iwork: "); ErrnoDescription(errno);&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;if(info&amp;lt;0) printf("Parameter %d had an illegal value.\\n",(-1*info));&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;////////////// THIS IS THE REAL EXECUTION OF THE EIGENMODE FINDER //////////////&lt;/DIV&gt;&lt;DIV&gt;printf("\\nExecuting dsyevrf.\\n");&lt;/DIV&gt;&lt;DIV&gt;dsyevrf_(&amp;amp;nrows, a, &amp;amp;il, &amp;amp;iu, &amp;amp;m, w, z, &amp;amp;lz, &amp;amp;lisuppz, work, &amp;amp;lwork, iwork, &amp;amp;liwork, &amp;amp;info);&lt;/DIV&gt;&lt;DIV&gt;tEnd = time(tloc);&lt;/DIV&gt;&lt;DIV&gt;printf("Exited dsyevrf.\\n\\n");&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;if(info&amp;lt;0) printf("Parameter %d had an illegal value.\\n",(-1*info));&lt;/DIV&gt;&lt;DIV&gt;if(info&amp;gt;1) printf("AN INTERNAL ERROR HAS OCCURRED\\nAN INTERNAL ERROR HAS OCCURRED\\n\\n");&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;void dspevxf_(long long *nrows, double *ap, long long *trisize, long long *il, long long *iu, long long *m, double *w, double *z, long *lz, double *work, long long *lwork, long long *iwork, long long *liwork, long&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;int main ()&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;long long ncells6 = 66113;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;///////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;///////////////////////////////// GetEigenvectors /////////////////////////////////////&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;///////////////////////////////////////////////////////////////////////////////////////&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;char *fnameGCorr_sy = "/home/mj/PSnoise/noiseMat_Vec/GCorMat_R6sy_fwrite";&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;long il_ge = 1;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;long iu_ge = 10000;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;/*GetEigenvectors[1. Name of symmetric, fwritten ncells by ncells covariance function&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;           to be diagonalized&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;  2. Dimension of above matrix, also # of cells&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;  3. Value &amp;gt;= 1 equaling # of first eigenvector returned (1 is largest)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;  4. Value &amp;gt;= il and &amp;lt;= ncells equaling # of final eigenvector returned] */&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;GetEigenvectors(fnameGCorr_sy, ncells6, il_ge, iu_ge);&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;B&gt;LAPACK_dspevx_f.f&lt;/B&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;c********************************************************************&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  subroutine dspevxf(n,ap,lap,il,iu,m,w,z,lz,work,lwork,iwork,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  +liwork,ifail,info)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c--------------------------------------------------------------------&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   Calculates selected eigenvalues and eigenvectors of a&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   symmetric matrix T triangularly packed into ap.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   Based upon the dspevx routine.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c  &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   This routine is called from the C function GetEigenvectorsPacked&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   'N' should be used if only eigenvalues are desired.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   'V' should be used if both eigenvalues and eigenvalues are&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    desired.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   For the second parameter, 'A' means all eigenvalues will be&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    found. 'V' means all eigenvalues in the half-open interval&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    (vl,vu] will be found. 'I' mean the eigenvalues with indices&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    il through iu will be found.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   For the third parameter, 'U' means the symmetric matrix is&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    stored in the upper triangle of a and 'L' means its stored in&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the lower triangle.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "n" is the number of rows (columns) in the symmetric matrix&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "ap" is the nXn array packed into a size "lap" = n(n+1)/2 housing&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the symmetric matrix in its upper or lower triangle.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "vl" and "vu" are the lower and upper bounds respectively of the&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    interval to be searched for eigenvalues. "vl" &amp;lt;= "vu". These&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    values are referenced only if the second parameter = 'V'&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "il" and "iu" are the indices of the smallest and largest eigenvalues&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    to be returned such that 1&amp;lt;=il&amp;lt;=iu&amp;lt;=in. These values are referenced&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    only if the second parameter = 'I'&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "abstol" is the absolute error tolerance for the eigenvalues.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "z" is an output parameter. If 'N', this is not referenced. If&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    'V', then this will contain the "lz" eigenvectors specified by&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the range "il" through "iu".&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "m" is the total number of eigenvalues found.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "w" is the array to which the first m eigenvalues are stored.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "isuppz" contains, upon output, the indices indicating the non-zero&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    elements in "z". It has length "lisuppz".&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "work" is a workspace array of length "lwork" = 8n&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "iwork" is a workspace array of length "liwork" = 5n&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "ifail" is an integer array of length "n" containing the indices of&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    the eigenvectors that failed to converge or, if "info"=0, the first&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    m elements of ifal are zero.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   "info" is an integer. If all is ok, a 0 is output. If i, the&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    algorithm did not converge and i indicates the number of&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    elements of an intermediate tridiagonal form which did not&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    converge to zero. If -i, the ith parameter had an illegal&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c    value.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c   Using LAPACK.&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  implicit none  &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  integer*8 n,lap,il,iu,m,lz,lwork,liwork,iwork(liwork),ifail(n),&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  +info&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  real*8 ap(lap),vl,vu,abstol,dlamch,w(n),z(n,lz),work(lwork)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  external dlamch&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  abstol = 2*dlamch('S')&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  print *, 'ap(final) = ', ap(lap)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  print *, 'About to compute eigenvectors',il,'through',iu,'.'&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  print *, 'n = ',n&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  call dspevx('V','I','L',n,ap,vl,vu,il,iu,abstol,m,w,z,n,&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  +work,iwork,ifail,info)&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  return&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;  end&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;c&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;B&gt;Makefile&lt;/B&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;DIV id="_mcePaste"&gt;.f.o:&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;$(F77) -c $&amp;lt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;.c.o:&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;$(CC) -c $&amp;lt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;default:&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;all&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CC = gcc&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;F77 = ifort&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CL = ifort -nofor_main&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;CL8= ifort -nofor_main -i8&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;INCF = -I/usr/site/intel_fortran/include   #FORTRAN INCLUDE FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;IMKLF = -I/usr/site/intel_fortran/mkl/include #FORTRAN MKL FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;INCC = -I/usr/site/intel_cpp/include   #C++ INCLUDE FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;IMKLC = -I/usr/site/intel_cpp/mkl/include #C++ MKL FILES&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;LMKL = -Vaxlib -L/usr/site/intel_fortran/mkl/lib/em64t -lfftw3 -lmkl_core -lmkl_sequential -lmkl_intel_ilp64&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;eigen:&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;LAPACK_dspevx_f.oEigenFind.o&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;$(CL8) $^ $(LMKL) -o $@.o&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Jul 2010 21:29:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780131#M1399</guid>
      <dc:creator>mspecian</dc:creator>
      <dc:date>2010-07-13T21:29:10Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780132#M1400</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Could you please submit your test case as an attachment to your post? Looks like code your posted has been broken by the text editor.&lt;BR /&gt;&lt;BR /&gt;Could you also specify what "info" value did you obtain on exit of dsyevr() function?&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Artem</description>
      <pubDate>Wed, 14 Jul 2010 06:56:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780132#M1400</guid>
      <dc:creator>Artem_V_Intel</dc:creator>
      <dc:date>2010-07-14T06:56:19Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780133#M1401</link>
      <description>I tried two test cases. The first was the 3X3 matrix {2, -1, 0; -1, 2, -1; 0, -1, 2}. The other was a 10X10 matrix where the upper (or lower) triangle was the sequence of integers from 0 to 54. In other words the first row, first column was 0. The first row, second column (and second row, first column) was 1, and so on. Both cases returned the correct eigenvalues and eigenvectors.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I do not have the info parameter readily available. Until this error occurred I had not written a line to return it explicitly. I have another version of the diagonalization code running for packed storage with dspevx. If this also fails, I will have the value of info returned. However, these routines take a while to run...over two days in fact, so it's not a quick matter to simply recover the parameter.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I'm not aware of whether it is possible to parallelize this routine to run over multiple processors. Would you happen to know? Thank you very much for your generous attention.&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Jul 2010 14:36:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780133#M1401</guid>
      <dc:creator>mspecian</dc:creator>
      <dc:date>2010-07-14T14:36:35Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780134#M1402</link>
      <description>1)How we can investiagte the original problem (withdsyevr) you reported?&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&amp;gt;&amp;gt;&amp;gt; for packed storage with dspevx...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;2)Do you meandspevx executed &amp;gt; then 2 days!. What was the order of the input matrixes?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;3)The list of threaded functions, you can find into User's Guide, chapter 6,Using the Intel MKL Parallelism.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;/SPAN&gt;--Gennady&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Jul 2010 14:59:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780134#M1402</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2010-07-14T14:59:47Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780135#M1403</link>
      <description>1) Exactly. I'm running code that will test the same procedure with dspevx right now. If it finishes before there's resolution on this thread, I will post the results.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;2) dsyevr took about 2 days 6 hours to execute on my machine. The matrix is 66113 squared.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;3) Thanks for the reference. I had seen this before but it's good to get outside verification.&lt;/DIV&gt;</description>
      <pubDate>Wed, 14 Jul 2010 16:03:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780135#M1403</guid>
      <dc:creator>mspecian</dc:creator>
      <dc:date>2010-07-14T16:03:10Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780136#M1404</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;dsyevr calls dsytrd, which is threaded.&lt;BR /&gt;&lt;BR /&gt;Did you try other eigensolvers such as dsyev, dsyevd, dsyevx?&lt;BR /&gt;&lt;BR /&gt;What is the typical execution time for less size problem, say 10000, 20000, 40000 ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Michael.</description>
      <pubDate>Thu, 15 Jul 2010 08:01:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780136#M1404</guid>
      <dc:creator>Michael_C_Intel4</dc:creator>
      <dc:date>2010-07-15T08:01:39Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780137#M1405</link>
      <description>One more question, why do you link against mkl_sequential? You will definitely run in a single thread then. You probably need to link against threaded binary mkl_intel_thread instead.&lt;BR /&gt;&lt;BR /&gt;Michael.</description>
      <pubDate>Thu, 15 Jul 2010 08:07:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780137#M1405</guid>
      <dc:creator>Michael_C_Intel4</dc:creator>
      <dc:date>2010-07-15T08:07:55Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780138#M1406</link>
      <description>I do not recommend using dsyevr: unreliable, RRR algorithm is not parallelized and eigenvectors are of low accuracy. I hold the diagonalization, which allows memory 128GB diagonalizirovt matrix up to 175000 * 175000 and find just the right eigenvectors and eigenvalues.</description>
      <pubDate>Thu, 15 Jul 2010 15:52:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780138#M1406</guid>
      <dc:creator>yuriisig</dc:creator>
      <dc:date>2010-07-15T15:52:53Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780139#M1407</link>
      <description>&lt;DIV&gt;Hi Michael,&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks for replying. No, I have not tried the other eigensolvers yet. As I wrote above, I'm running through a sequential operation of dspevx right now, but I will certainly give those other routines a look. I have yet to do an execution time test for matrices of the size you mentioned. Once dsyevr failed, I've prioritized trying the other algorithms.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;To your second point about sequential versus threading, I wasn't acutely aware of the dsyevr - dsytrd connection. I can try the threaded version as well to see if it affects execution time.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I was wondering if you had a response to the comment below about the dsyevr algorithm being unreliable in general.&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Jul 2010 16:29:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780139#M1407</guid>
      <dc:creator>mspecian</dc:creator>
      <dc:date>2010-07-15T16:29:34Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780140#M1408</link>
      <description>You write that dsyevr is not parallelized. Do you have a response to the above comment, i.e. dsyevr calls dsytrd (which is parallelized) to reduce the matrix to tridiagonal form? I'm not sure what percentage of the execution time is spend on the reduction to tridiagonal form, but if it is significant, this might prove to be a useful speed-up.&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I should also mention that I am not concerned with all the eigenvectors. I'm using a version of Principal Component Analysis and need only the first chunk of eigenvectors (those associated with the largest positive eigenvalues) to be accurate. Can you comment on whether dsyevr can handle this task?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;You mention that you don't recommend dsyevr. What do you recommend instead? Is your lack of recommendation due to accuracy errors, or unreliability? I am still trying to identify why an internal error in this routine is occurring.&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Jul 2010 16:39:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780140#M1408</guid>
      <dc:creator>mspecian</dc:creator>
      <dc:date>2010-07-15T16:39:59Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780141#M1409</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1279212577250="81" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=484191" href="https://community.intel.com/en-us/profile/484191/" class="basic"&gt;mspecian&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;You write that dsyevr is not parallelized...&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I wrote that is not paralleled RRR algorithm, which is included in dsyevr: &lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=73653"&gt;http://software.intel.com/en-us/forums/showthread.php?t=73653&lt;/A&gt;(Unfortunately, now my page is not available). Intel MKL - very good package, but for your problem, he is not well suited. Most likely an internal error occurs because the RRR algorithm. Most time is spent on bringing to tridiagonal form for BLAS level 2. The rest you can quickly calculate, given that you do not need all the eigenvectors. Once again I say that dsyevr because RRR algorithm inaccurate and unreliable.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2010 17:22:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780141#M1409</guid>
      <dc:creator>yuriisig</dc:creator>
      <dc:date>2010-07-15T17:22:25Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780142#M1410</link>
      <description>Quick update: dspevx executed successfully (i.e. info = 0) but the eigenvalues returned were all zeros. All eigenvectors were zero vectors as well.</description>
      <pubDate>Sat, 17 Jul 2010 01:45:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780142#M1410</guid>
      <dc:creator>mspecian</dc:creator>
      <dc:date>2010-07-17T01:45:26Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780143#M1411</link>
      <description>The algorithms work with packed matrices in the Intel MKL is much slower than with square matrices.</description>
      <pubDate>Sat, 17 Jul 2010 06:34:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780143#M1411</guid>
      <dc:creator>yuriisig</dc:creator>
      <dc:date>2010-07-17T06:34:01Z</dc:date>
    </item>
    <item>
      <title>Problem applying dsyevr to a large matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780144#M1412</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1279377691953="63" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=484191" href="https://community.intel.com/en-us/profile/484191/" class="basic"&gt;mspecian&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;Quick update: dspevx executed successfully (i.e. info = 0) but the eigenvalues returned were all zeros. All eigenvectors were zero vectors as well.&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Propose to act as follows:&lt;BR /&gt;1. dsytrd&lt;BR /&gt;2. dstedc (To program this feature, it took 10 years.)This algorithm requires a lot of RAM, but fast and reliable.&lt;BR /&gt;3. dormtr (Apply this feature only to those eigenvectors tridiagonal matrix that you want).&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2010 14:50:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Problem-applying-dsyevr-to-a-large-matrix/m-p/780144#M1412</guid>
      <dc:creator>yuriisig</dc:creator>
      <dc:date>2010-07-17T14:50:21Z</dc:date>
    </item>
  </channel>
</rss>

