<?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 multiple calls to poisson solver produces odd results in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813681#M4120</link>
    <description>Well, I've reproduced your issue on MKL example by calling commit and solve step in loop. This issue could be resolved by 2 ways: &lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;First variant:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;loop&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{        &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;set f = f_old;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;dpar[0]=(bx-ax);&lt;/DIV&gt;&lt;DIV&gt;dpar[1]=(by-ay);&lt;/DIV&gt;&lt;DIV&gt;dpar[2]=(bz-az);&lt;/DIV&gt;&lt;DIV&gt;commit();&lt;/DIV&gt;&lt;DIV&gt;solve();&lt;/DIV&gt;&lt;DIV&gt;} &lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Second variant:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;loop&lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;{        &lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;set f = f_old;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;commit();&lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;solve();&lt;/DIV&gt;&lt;DIV style="padding: 0px; margin: 0px;"&gt;ipar[0]=9; // more detailed inIntel Math Kernel Library ReferenceManual&lt;/DIV&gt;&lt;DIV style="padding: 0px; margin: 0px;"&gt;} &lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;If these ways doesn't resolve your issue please wrote it here and I will try to find solution of problem on your example&lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;With best regards,&lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
    <pubDate>Fri, 28 Jan 2011 20:02:52 GMT</pubDate>
    <dc:creator>Alexander_K_Intel2</dc:creator>
    <dc:date>2011-01-28T20:02:52Z</dc:date>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813677#M4116</link>
      <description>Greetings,&lt;DIV&gt;I'm have difficulties with the 3D Poisson solver. I'm trying to implement it in a particle-in-cell code that requires Poisson's equation to be solved repeatedly on a constant grid with changes to the boundary conditions (possibly) and charge densities on the internal mesh points.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;According to the MKL guide, in the Sequence of Invoking PL Routines section, I should be able to initialize in the beginning, then loop the commit and solve routines, and clean up after the I'm done.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;If I only perform one iteration, the correct solution is produced. However, if I try to loop, without changing any parameters, and look at the solution afterwards it is different if nx=ny=nz is not satisfied. If nx=ny=nz IS satisfied, then a given number of iterations produces the same answer (as expected). The code is given below. If anyone notices any problems, please let me know.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;ThreeDCartPotSolver solver(64,64,64,1,1,1);&lt;SPAN style="white-space: pre;"&gt;		&lt;/SPAN&gt;//initialize solver class&lt;/P&gt;
&lt;P&gt;	solver.setY0BoundPotsConst(10);&lt;SPAN style="white-space: pre;"&gt;					&lt;/SPAN&gt;//set boundary points constant (all dirichlet)&lt;/P&gt;
&lt;P&gt;	solver.setY1BoundPotsConst(10);&lt;/P&gt;
&lt;P&gt;	solver.setX0BoundPotsConst(-10);&lt;/P&gt;
&lt;P&gt;	solver.setX1BoundPotsConst(-10);&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;for(int s=0; s&amp;lt;100; s++)&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;//loop the solve routine (without altering boundary conditions).&lt;/P&gt;
&lt;P&gt;	{&lt;/P&gt;
&lt;P&gt;		solver.zeroSolutionVec();&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;//writes zeroes solution vector (f from MKL manual)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;		solver.commitSolver();&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;//commit&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;		solver.calcPotential();&lt;SPAN style="white-space: pre;"&gt;	&lt;/SPAN&gt;//solve&lt;/P&gt;
&lt;P&gt;	}&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;	solver.writePotData("cartpot.dat"); //writes out f to data file&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;IMG id="image_2A1A34C6E43147C09D23E478DA17531A" src="file:/Developer/opt/intel/composerxe-2011.0.085/Documentation/en_US/mkl/mkl_manual/pdes/Images/pdes_plr_InvokingSequence.jpg" /&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2011 18:02:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813677#M4116</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2011-01-28T18:02:58Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813678#M4117</link>
      <description>Hi,&lt;DIV&gt;As for me you have some problems with changed array ipar but I can't check it in your interfaces. Could you provide testcase that I could compiler and run on my side?&lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2011 19:06:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813678#M4117</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-01-28T19:06:56Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813679#M4118</link>
      <description>Hi Alexander,&lt;DIV&gt;I suspected that it might be something like that. I'll attach the files if you want to take a look at it. Thanks for your help.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Ryan&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2011 19:19:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813679#M4118</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2011-01-28T19:19:41Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813680#M4119</link>
      <description>Also check dpar[0]-dpar[2]. These values have different meaning before and after commit step, before commit step they store length of correspondent domain edge but after they store mesh size. So, if you call in loop {commit,solve} check that these parameters set as length of domain edge before each commit step. &lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2011 19:19:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813680#M4119</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-01-28T19:19:45Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813681#M4120</link>
      <description>Well, I've reproduced your issue on MKL example by calling commit and solve step in loop. This issue could be resolved by 2 ways: &lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;First variant:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV id="_mcePaste"&gt;loop&lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;{        &lt;/DIV&gt;&lt;DIV id="_mcePaste"&gt;set f = f_old;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;dpar[0]=(bx-ax);&lt;/DIV&gt;&lt;DIV&gt;dpar[1]=(by-ay);&lt;/DIV&gt;&lt;DIV&gt;dpar[2]=(bz-az);&lt;/DIV&gt;&lt;DIV&gt;commit();&lt;/DIV&gt;&lt;DIV&gt;solve();&lt;/DIV&gt;&lt;DIV&gt;} &lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Second variant:&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;loop&lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;{        &lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" id="_mcePaste"&gt;set f = f_old;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;commit();&lt;/DIV&gt;&lt;DIV style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;"&gt;solve();&lt;/DIV&gt;&lt;DIV style="padding: 0px; margin: 0px;"&gt;ipar[0]=9; // more detailed inIntel Math Kernel Library ReferenceManual&lt;/DIV&gt;&lt;DIV style="padding: 0px; margin: 0px;"&gt;} &lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;If these ways doesn't resolve your issue please wrote it here and I will try to find solution of problem on your example&lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;With best regards,&lt;/DIV&gt;&lt;DIV style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2011 20:02:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813681#M4120</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-01-28T20:02:52Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813682#M4121</link>
      <description>Hi Alexander,&lt;DIV&gt;Thanks for your help. I chose the first variant, and it worked perfectly. That probably would have taken me quite some time to find on my own. Thanks, again!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Ryan&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 28 Jan 2011 21:21:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813682#M4121</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2011-01-28T21:21:14Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813683#M4122</link>
      <description>Hi Ryan,&lt;DIV&gt;You are welcome, feel free to ask any question about Poisson library or other parts of MKL.&lt;/DIV&gt;&lt;DIV&gt;With best regards,&lt;/DIV&gt;&lt;DIV&gt;Alexander Kalinkin&lt;/DIV&gt;</description>
      <pubDate>Sat, 29 Jan 2011 02:04:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813683#M4122</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-01-29T02:04:27Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813684#M4123</link>
      <description>Hi Alexander,&lt;DIV&gt;I just wanted to update this thread with another issue I've found by looping over commit and solve. I noticed when I ran this loop thousands of times a memory leak developed. It disappeared when I changed the cycle to initialize-&amp;gt;commit-&amp;gt;solve-&amp;gt;free. I wanted to avoid initializing at every iteration as I didn't know how much overhead was involved in this process.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;The "Typical Order of Invoking PL Routines" figure in the MKL manual seems to indicate that initializing at the beginning of every iteration isn't required, so maybe this memory leak is a bug?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;Ryan&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Feb 2011 15:53:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813684#M4123</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2011-02-01T15:53:27Z</dc:date>
    </item>
    <item>
      <title>multiple calls to poisson solver produces odd results</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813685#M4124</link>
      <description>&lt;P&gt;Hi Rian,&lt;/P&gt;

&lt;P&gt;You are
right, if you choose first variant (dpar[0]=bx-ax and so on) the memory leak
appeared because it is not recommended way of use Poisson library in loop, it
is just a trick. Please choose second variant (set ipar[0]=9) then there is not
memory leaks and result of PL is correct. &lt;/P&gt;

&lt;P&gt;With best
regards,&lt;/P&gt;

&lt;P&gt;Alexander
Kalinkin&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 18:45:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/multiple-calls-to-poisson-solver-produces-odd-results/m-p/813685#M4124</guid>
      <dc:creator>Alexander_K_Intel2</dc:creator>
      <dc:date>2011-02-01T18:45:23Z</dc:date>
    </item>
  </channel>
</rss>

