<?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 Re: pardiso memory release problem in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-memory-release-problem/m-p/967443#M16296</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm an engineer working for MKL. I've reproduced the issue with MKL 8.0 beta. The program compiled in the debug mode stops under debugger inside _heapchk system module, while running well with no debugger. Is it the same in your environment?&lt;/P&gt;
&lt;P&gt;The samehas beenobserved with MKL 8.0 Gold, but MKL 8.0.1 coming soon will not contain this bug.&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 09 Nov 2005 18:59:43 GMT</pubDate>
    <dc:creator>michael_chuvelev</dc:creator>
    <dc:date>2005-11-09T18:59:43Z</dc:date>
    <item>
      <title>pardiso memory release problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-memory-release-problem/m-p/967442#M16295</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;this is the pardiso_sym.c example from MKL&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I just added&lt;/DIV&gt;
&lt;DIV&gt;
&lt;P&gt;_ASSERT ( _CrtCheckMemory());&lt;/P&gt;
&lt;P&gt;at the very end&lt;/P&gt;
&lt;P&gt;and the&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;/FONT&gt;#include&lt;FONT size="2"&gt; &lt;CRTDBG.H&gt;&lt;/CRTDBG.H&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;at top&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;there seems to be some writing to blocks after releaseing them with &lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;phase = -1, it's ok if phase is 0 (partial release)&lt;/P&gt;
&lt;P&gt;my full program with release runtime lib will crash after a while, I'm just not using phase = -1 at the moment.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;and idea ?&lt;/P&gt;
&lt;P&gt;I'm using MSVC NET 2003 and MKL beta 8, linking with mkl_c.lib and mkl_solver.lib and Single-threaded Debug (/MLd) runtime lib&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;thank's&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" size="2"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;PRE&gt;/*
********************************************************************************
*                              INTEL CONFIDENTIAL
*   Copyright(C) 2004 Intel Corporation. All Rights Reserved.
*   The source code contained  or  described herein and all documents related to
*   the source code ("Material") are owned by Intel Corporation or its suppliers
*   or licensors.  Title to the  Material remains with  Intel Corporation or its
*   suppliers and licensors. The Material contains trade secrets and proprietary
*   and  confidential  information of  Intel or its suppliers and licensors. The
*   Material  is  protected  by  worldwide  copyright  and trade secret laws and
*   treaty  provisions. No part of the Material may be used, copied, reproduced,
*   modified, published, uploaded, posted, transmitted, distributed or disclosed
*   in any way without Intel's prior express written permission.
*   No license  under any  patent, copyright, trade secret or other intellectual
*   property right is granted to or conferred upon you by disclosure or delivery
*   of the Materials,  either expressly, by implication, inducement, estoppel or
*   otherwise.  Any  license  under  such  intellectual property  rights must be
*   express and approved by Intel in writing.
*
********************************************************************************
*   Content : MKL DSS C example
*
********************************************************************************
*/
/* -------------------------------------------------------------------- */
/* Example program to show the use of the "PARDISO" routine */
/* on symmetric linear systems */
/* -------------------------------------------------------------------- */
/* This program can be downloaded from the following site: */
/* &lt;A href="http://www.computational.unibas.ch/cs/scicomp" target="_blank"&gt;http://www.computational.unibas.ch/cs/scicomp&lt;/A&gt; */
/* */
/* (C) Olaf Schenk, Department of Computer Science, */
/* University of Basel, Switzerland. */
/* Email: olaf.schenk@unibas.ch */
/* -------------------------------------------------------------------- */
#include "stdafx.h"
#include &lt;STDIO.H&gt;
#include &lt;CRTDBG.H&gt;
#include &lt;STDLIB.H&gt;
#include &lt;MATH.H&gt;
extern int omp_get_max_threads();
/* PARDISO prototype. */
#if defined(_WIN32) || defined(_WIN64)
#define pardiso_ PARDISO
#else
#define PARDISO pardiso_
#endif
extern "C" int PARDISO
	(void *, int *, int *, int *, int *, int *,
	double *, int *, int *, int *, int *, int *,
	int *, double *, double *, int *);

int main( void ) {
	/* Matrix data. */
	int n = 8;
	int ia[ 9] = { 1, 5,
 8, 10, 12, 15, 17, 18, 19 };
	int ja[18] = { 1, 3, 6, 7,
		2, 3, 5,
		3, 8,
		4, 7,
		5, 6, 7,
		6, 8,
		7,
		8 };
	double a[18] = { 7.0, 1.0, 2.0, 7.0,
		-4.0, 8.0, 2.0,
		1.0, 5.0,
		7.0, 9.0,
		5.0, 1.0, 5.0,
		-1.0, 5.0,
		11.0,
		5.0 };
	int mtype = -2; /* Real symmetric matrix */
	/* RHS and solution vectors. */
	double b[8], x[8];
	int nrhs = 1; /* Number of right hand sides. */
	/* 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. */
	int iparm[64];
	int maxfct, mnum, phase, error, msglvl;
	/* Auxiliary variables. */
	int i;
	double ddum; /* Double dummy */
	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 */
	/* Numbers of processors, value of OMP_NUM_THREADS */
	iparm[2] = 2;//omp_get_max_threads();
	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; /* Not in use */
	iparm[12] = 0; /* Not in use */
	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 */
	maxfct = 1; /* Maximum number of numerical factorizations. */
	mnum = 1; /* Which factorization to use. */
	msglvl = 1; /* Print statistical information in file */
	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, a, 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("
ERROR during symbolic factorization: %d", error);
		exit(1);
	}
	printf("
Reordering completed ... ");
	printf("
Number of nonzeros in factors = %d", iparm[17]);
	printf("
Number 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, a, 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("
ERROR during numerical factorization: %d", error);
		exit(2);
	}
	printf("
Factorization completed ... ");
/* -------------------------------------------------------------------- */
/* .. Back substitution and iterative refinement. */
/* -------------------------------------------------------------------- */
	phase = 33;
	iparm[7] = 2; /* Max numbers of iterative refinement steps. */
	/* Set right hand side to one. */
	for (i = 0; i &amp;lt; n; i++) {
		b&lt;I&gt; = 1;
	}
	PARDISO (pt, &amp;amp;maxfct, &amp;amp;mnum, &amp;amp;mtype, &amp;amp;phase,
		&amp;amp;n, a, ia, ja, &amp;amp;idum, &amp;amp;nrhs,
		iparm, &amp;amp;msglvl, b, x, &amp;amp;error);
	if (error != 0) {
		printf("
ERROR during solution: %d", error);
		exit(3);
	}
	printf("
Solve completed ... ");
	printf("
The solution of the system is: ");
	for (i = 0; i &amp;lt; n; i++) {
		printf("
 x [%d] = % f", i, x&lt;I&gt; );
	}
	printf ("
");
/* -------------------------------------------------------------------- */
/* .. 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);

	_ASSERT ( _CrtCheckMemory());

	return 0;
}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/MATH.H&gt;&lt;/STDLIB.H&gt;&lt;/CRTDBG.H&gt;&lt;/STDIO.H&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 24 Oct 2005 00:37:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-memory-release-problem/m-p/967442#M16295</guid>
      <dc:creator>dshor1</dc:creator>
      <dc:date>2005-10-24T00:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: pardiso memory release problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-memory-release-problem/m-p/967443#M16296</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm an engineer working for MKL. I've reproduced the issue with MKL 8.0 beta. The program compiled in the debug mode stops under debugger inside _heapchk system module, while running well with no debugger. Is it the same in your environment?&lt;/P&gt;
&lt;P&gt;The samehas beenobserved with MKL 8.0 Gold, but MKL 8.0.1 coming soon will not contain this bug.&lt;/P&gt;
&lt;P&gt;Regards.&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Nov 2005 18:59:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-memory-release-problem/m-p/967443#M16296</guid>
      <dc:creator>michael_chuvelev</dc:creator>
      <dc:date>2005-11-09T18:59:43Z</dc:date>
    </item>
    <item>
      <title>Re: pardiso memory release problem</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-memory-release-problem/m-p/967444#M16297</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;good to know it will be fixed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;running well with no debugger, isn't a good thing, it's just mean nasty unpredictable bug may appear sometimes....&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Nov 2005 00:16:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/pardiso-memory-release-problem/m-p/967444#M16297</guid>
      <dc:creator>dshor1</dc:creator>
      <dc:date>2005-11-14T00:16:27Z</dc:date>
    </item>
  </channel>
</rss>

