<?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 Hi, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PARDISO-for-complex-symmetric-matrix/m-p/1014589#M19395</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can I ask you to send us example of matrix on which you see the issue? It could help us to reproduce and fix it.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jun 2015 06:33:14 GMT</pubDate>
    <dc:creator>Alexander_K_Intel2</dc:creator>
    <dc:date>2015-06-02T06:33:14Z</dc:date>
    <item>
      <title>PARDISO for complex symmetric matrix</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PARDISO-for-complex-symmetric-matrix/m-p/1014588#M19394</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;

&lt;P&gt;I used PARDISO for complex symmetric matrix. The code is as follows:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;void PardisoSolver(int n, int nz, int *rowind, int *colind, MKL_Complex16 *a, int nrhs, MKL_Complex16 *x, MKL_Complex16 *b)
{
	//// coordinate format to CSR format
	int job[6];
	job[0] = 2; /// if job(1)=2, the matrix in the coordinate format is converted to the CSR format, 
	            /// and the column indices in CSR representation are sorted in the increasing order within each row.
	job[1] = 1; /// if job(2)=1, one-based indexing for the matrix in CSR format is used.
	job[2] = 1; /// if job(3)=1, one-based indexing for the matrix in coordinate format is used.
	job[3] = 0;
	job[4] = nz; /// job(5) = nzmax - maximum number of the non - zero elements allowed if job(1) = 0.
	job[5] = 0;  /// If job(6) = 0, all arrays acsr, ja, ia are filled in for the output storage.	
	int *ia = new int[n + 1], *ja = new int[nz];
	MKL_Complex16 *acsr = new MKL_Complex16[nz];
	int info;
	mkl_zcsrcoo(job, &amp;amp;n, acsr, ja, ia, &amp;amp;nz, a, rowind, colind, &amp;amp;info);


  MKL_INT mtype = 6;       /* complex symmetric matrix */


  /* RHS and solution vectors. */
  double res;

  /* Internal solver memory pointer pt,                  */
  /* 32-bit: int pt[64]; 64-bit: long int pt[64]         */
  /* or void *pt[64] should be OK on both architectures  */
  void *pt[64];

  /* Pardiso control parameters. */
  MKL_INT iparm[64];
  MKL_INT maxfct, mnum, phase, error, msglvl;

  /* Auxiliary variables. */
  MKL_INT i;

  MKL_Complex16 ddum;       /* Double dummy */
  MKL_INT idum;         /* Integer dummy. */
/* -------------------------------------------------------------------- */
/* .. Setup Pardiso control parameters. */
/* -------------------------------------------------------------------- */
  for (i = 0; i &amp;lt; 64; i++)
    {
      iparm&lt;I&gt; = 0;
    }
  iparm[0] = 1;         /* No solver default */
	//iparm[1] = 2;         /* Fill-in reordering from METIS */
	iparm[1] = 3;         ///!parallel(OpenMP) version of the nested dissection algorithm
	iparm[3] = 0;         /* No iterative-direct algorithm */
  iparm[4] = 0;         /* No user fill-in reducing permutation */
  iparm[5] = 0;         /* Write solution into x */
  iparm[6] = 0;         /* Not in use */
  iparm[7] = 2;         /* Max numbers of iterative refinement steps */
  iparm[8] = 0;         /* Not in use */
  iparm[9] = 13;        /* Perturb the pivot elements with 1E-13 */
  iparm[10] = 1;        /* Use nonsymmetric permutation and scaling MPS */
  iparm[11] = 0;        /* Conjugate transposed/transpose solve */
  iparm[12] = 1;        /* Maximum weighted matching algorithm is switched-on (default for non-symmetric) */
  iparm[13] = 0;        /* Output: Number of perturbed pivots */
  iparm[14] = 0;        /* Not in use */
  iparm[15] = 0;        /* Not in use */
  iparm[16] = 0;        /* Not in use */
  iparm[17] = -1;       /* Output: Number of nonzeros in the factor LU */
  iparm[18] = -1;       /* Output: Mflops for LU factorization */
  iparm[19] = 0;        /* Output: Numbers of CG Iterations */
	iparm[20] = 1;        /// !Apply 1x1 and 2x2 Bunch and Kaufman pivoting during the factorization process
	iparm[23] = 1;        /// !PARDISO uses new two - level factorization algorithm

  maxfct = 1;           /* Maximum number of numerical factorizations.  */
  mnum = 1;         /* Which factorization to use. */

  msglvl = 1;           /* Print statistical information  */
  error = 0;            /* Initialize error flag */

/* -------------------------------------------------------------------- */
/* .. Initialize the internal solver memory pointer. This is only */
/* necessary for the FIRST call of the PARDISO solver. */
/* -------------------------------------------------------------------- */
  for (i = 0; i &amp;lt; 64; i++)
    {
      pt&lt;I&gt; = 0;
    }
/* -------------------------------------------------------------------- */
/* ..  Reordering and Symbolic Factorization.  This step also allocates */
/*     all memory that is necessary for the factorization.              */
/* -------------------------------------------------------------------- */
  phase = 11;

  PARDISO (pt, &amp;amp;maxfct, &amp;amp;mnum, &amp;amp;mtype, &amp;amp;phase,
       &amp;amp;n, acsr, ia, ja, &amp;amp;idum, &amp;amp;nrhs, iparm, &amp;amp;msglvl, &amp;amp;ddum, &amp;amp;ddum, &amp;amp;error);

  if (error != 0)
    {
      printf ("\nERROR during symbolic factorization: %d", error);
      exit (1);
    }
  printf ("\nReordering completed ... ");
  printf ("\nNumber of nonzeros in factors  = %d", iparm[17]);
  printf ("\nNumber of factorization MFLOPS = %d", iparm[18]);

/* -------------------------------------------------------------------- */
/* ..  Numerical factorization.                                         */
/* -------------------------------------------------------------------- */
  phase = 22;

  PARDISO (pt, &amp;amp;maxfct, &amp;amp;mnum, &amp;amp;mtype, &amp;amp;phase,
       &amp;amp;n, acsr, ia, ja, &amp;amp;idum, &amp;amp;nrhs, iparm, &amp;amp;msglvl, &amp;amp;ddum, &amp;amp;ddum, &amp;amp;error);

  if (error != 0)
    {
      printf ("\nERROR during numerical factorization: %d", error);
      exit (2);
    }
  printf ("\nFactorization completed ...\n ");

/* -------------------------------------------------------------------- */
/* ..  Back substitution and iterative refinement.                      */
/* -------------------------------------------------------------------- */
  phase = 33;

	printf("\n\nSolving system...\n");
	PARDISO(pt, &amp;amp;maxfct, &amp;amp;mnum, &amp;amp;mtype, &amp;amp;phase,
		&amp;amp;n, acsr, ia, ja, &amp;amp;idum, &amp;amp;nrhs, iparm, &amp;amp;msglvl, b, x, &amp;amp;error);

	if (error != 0)
	{
		printf("\nERROR during solution: %d", error);
		exit(3);
	}
	// Compute residual
	res = residual(n, ia, ja, acsr, x, b);
	printf("\nRelative residual = %e", res);

/* -------------------------------------------------------------------- */
/* ..  Termination and release of memory.                               */
/* -------------------------------------------------------------------- */
  phase = -1;           /* Release internal memory. */

  PARDISO (pt, &amp;amp;maxfct, &amp;amp;mnum, &amp;amp;mtype, &amp;amp;phase,
       &amp;amp;n, &amp;amp;ddum, ia, ja, &amp;amp;idum, &amp;amp;nrhs,
       iparm, &amp;amp;msglvl, &amp;amp;ddum, &amp;amp;ddum, &amp;amp;error);
	delete[] ia;
	delete[] ja;
	delete[] acsr;
}

&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;However, the output shows that number of elements in U matrix is 1, and the res is very large.&lt;/P&gt;

&lt;P&gt;Then I output the full matrix (both upper and lower triangular part) and set mtype=13 and solve the matrix again. The result is correct. Could anyone help me to take a look at the problem?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zhanghong Tang&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2015 06:52:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PARDISO-for-complex-symmetric-matrix/m-p/1014588#M19394</guid>
      <dc:creator>Zhanghong_T_</dc:creator>
      <dc:date>2015-05-25T06:52:20Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PARDISO-for-complex-symmetric-matrix/m-p/1014589#M19395</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Can I ask you to send us example of matrix on which you see the issue? It could help us to reproduce and fix it.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jun 2015 06:33:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PARDISO-for-complex-symmetric-matrix/m-p/1014589#M19395</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2015-06-02T06:33:14Z</dc:date>
    </item>
    <item>
      <title>Dear Alex,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PARDISO-for-complex-symmetric-matrix/m-p/1014590#M19396</link>
      <description>&lt;P&gt;Dear Alex,&lt;/P&gt;

&lt;P&gt;A complete example is given here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/forums/topic/558881" target="_blank"&gt;https://software.intel.com/en-us/forums/topic/558881&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have also reported this issue and your developer has reproduced this problem.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Zhanghong Tang&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2015 23:18:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/PARDISO-for-complex-symmetric-matrix/m-p/1014590#M19396</guid>
      <dc:creator>Zhanghong_T_</dc:creator>
      <dc:date>2015-06-04T23:18:07Z</dc:date>
    </item>
  </channel>
</rss>

