<?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 thanks for the example. Do in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166168#M28262</link>
    <description>&lt;P&gt;thanks for the example. Do you see the problem happens on some specific CPU and OS types?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 19 Apr 2020 03:57:16 GMT</pubDate>
    <dc:creator>Gennady_F_Intel</dc:creator>
    <dc:date>2020-04-19T03:57:16Z</dc:date>
    <item>
      <title>random malloc error in d_commit_trig_transform</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166165#M28259</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I'm experiencing a random malloc error in d_commit_trig_transform.&amp;nbsp; It's persistent, but happens at different times during the code execution as this routine is called repeatedly.&amp;nbsp; I'm currently testing on a Mac using the latest available Intel C++ compiler and MKL versions.&amp;nbsp; The routine that contains the d_commit_trig_transform call is given below.&amp;nbsp; The error occurs regardless of the number of cores used, but usually after a few thousand calls.&amp;nbsp; Does anything look suspicious in the code below?&amp;nbsp; Any advice would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void TwoDCylRZPotSolver::RHSVectorDST()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/*&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; This method performs the discrete sine transform of the first kind (DST-I) on&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; rhsvector in preparation to solve the linear tridiagonal system.&amp;nbsp; The transform&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; is performed in chunk sizes of nz.&amp;nbsp; Due to the manner in which the DST is&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; calculated, an input array (a) of size nz+2 must be used with a[0]=a[nz+1]=0,&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; and a[1 to nz]=data.&amp;nbsp; A normalization factor of sqrt(2/(nz+1)) must be applied&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; when copying the transformed data back into rhsvector.&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double normfac=sqrt(2/double(nz+1));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;#pragma omp parallel for&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(int i=0; i&amp;lt;nrad; i++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int error, ipar[128],n=nz+1,tt_type=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;double dpar[5*(nz+2)/2+2];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DFTI_DESCRIPTOR_HANDLE handle = 0; //data structures used in transform&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double datatemp[nz+2];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatemp[0]=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datatemp[nz+1]=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;d_init_trig_transform(&amp;amp;n,&amp;amp;tt_type,ipar,dpar,&amp;amp;error);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; d_commit_trig_transform(datatemp,&amp;amp;handle,ipar,dpar,&amp;amp;error);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //copy data from rhsvector&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(int j=0; j&amp;lt;nz; j++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;datatemp[j+1]=rhsvector[i*nz+j];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//perform transformation&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;d_backward_trig_transform(datatemp,&amp;amp;handle,ipar,dpar,&amp;amp;error);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;//copy transformed data back to rhsvector&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;for(int j=0; j&amp;lt;nz; j++)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;rhsvector[i*nz+j]=normfac*datatemp[j+1];&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;free_trig_transform(&amp;amp;handle,ipar,&amp;amp;error);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if(error != 0)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;cout&amp;lt;&amp;lt;"Error = "&amp;lt;&amp;lt;error&amp;lt;&amp;lt;" in free_trig_transform in method RHSVectorDST."&amp;lt;&amp;lt;endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 20:40:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166165#M28259</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2020-04-17T20:40:02Z</dc:date>
    </item>
    <item>
      <title>We didn't see such an issue</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166166#M28260</link>
      <description>&lt;P&gt;We didn't see such an issue with this version of mkl. Could you give the standalone example to reproduce/investigate the problem on our side!&lt;/P&gt;</description>
      <pubDate>Sat, 18 Apr 2020 02:51:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166166#M28260</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-04-18T02:51:10Z</dc:date>
    </item>
    <item>
      <title>Hello Gennady,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166167#M28261</link>
      <description>&lt;P&gt;Hello Gennady,&lt;/P&gt;&lt;P&gt;Thanks for the reply.&amp;nbsp; I constructed a sample case (attached here) but it doesn't seem to fail.&amp;nbsp; However, in the code snippet I originally posted, almost all of the variables are created in the for loop scope, so it isn't very different.&amp;nbsp; One additional test I tried in the original code was to comment out the free_trig_transform() method.&amp;nbsp; If I do that then the error also doesn't occur, but the memory usage continually grows, as expected.&amp;nbsp; An example error output is :&lt;/P&gt;&lt;P&gt;WI_EIBT(57555,0x101d86dc0) malloc: Incorrect checksum for freed object 0x7fd8014064e8: probably modified after being freed.&lt;BR /&gt;Corrupt value: 0xbd9018dc3302c455&lt;BR /&gt;WI_EIBT(57555,0x101d86dc0) malloc: *** set a breakpoint in malloc_error_break to debug&lt;/P&gt;</description>
      <pubDate>Sat, 18 Apr 2020 17:04:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166167#M28261</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2020-04-18T17:04:47Z</dc:date>
    </item>
    <item>
      <title>thanks for the example. Do</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166168#M28262</link>
      <description>&lt;P&gt;thanks for the example. Do you see the problem happens on some specific CPU and OS types?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Apr 2020 03:57:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166168#M28262</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-04-19T03:57:16Z</dc:date>
    </item>
    <item>
      <title>I see no problem on my side :</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166169#M28263</link>
      <description>&lt;P&gt;I see no problem on my side : win64, statically Linkin with mkl 2020, openmp lnking.&lt;/P&gt;&lt;P&gt;AVX2 systems&lt;/P&gt;&lt;P&gt;Starting loop #1&lt;BR /&gt;Starting loop #2&lt;BR /&gt;Starting loop #3&lt;BR /&gt;Starting loop #4&lt;BR /&gt;....&lt;/P&gt;&lt;P&gt;Starting loop #1353966&lt;BR /&gt;Starting loop #1353967&lt;BR /&gt;Starting loop #1353968&lt;BR /&gt;Starting loop #1353969&lt;BR /&gt;Starting loop #1353970&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Apr 2020 08:33:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166169#M28263</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-04-19T08:33:09Z</dc:date>
    </item>
    <item>
      <title>The full code fails (after</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166170#M28264</link>
      <description>&lt;P&gt;The full code fails (after some time) on two platforms I've tested on, Mac (MKL 2020) and linux (MKL 2019) dynamically linked with openMP.&amp;nbsp; More interesting behavior I've just found is that if I declare ipar as int* ipar = new int[128] and DON'T delete it at the end of the loop, the code runs (with the expected memory growth) until I kill it.&amp;nbsp; If I "delete[] ipar" at the end of the loop, then the code fails as before.&amp;nbsp; Ipar should not be touched by anything outside of the loop it's declared in&lt;/P&gt;</description>
      <pubDate>Sun, 19 Apr 2020 15:18:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166170#M28264</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2020-04-19T15:18:18Z</dc:date>
    </item>
    <item>
      <title>In case you have the chance</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166171#M28265</link>
      <description>&lt;P&gt;In case you have the chance to try the full code, I'm attaching it here.&amp;nbsp; WI_EIBT.cpp is the main file.&amp;nbsp; Once compiled you place it in the same directory as the other files included in the archive (*.config, *.dat).&amp;nbsp; Execute the code via "./WI_EIBT WI_EIBT_100k_SC_dt2_6480V.config".&amp;nbsp; It will create a directory named "WI_EIBT_100k_SC_dt2_6480V" and start writing multiple datafiles in that directory and will also print status updates to the terminal.&amp;nbsp; It errors shortly after starting.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 14:31:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/random-malloc-error-in-d-commit-trig-transform/m-p/1166171#M28265</guid>
      <dc:creator>ringlenscl_msu_edu</dc:creator>
      <dc:date>2020-04-22T14:31:49Z</dc:date>
    </item>
  </channel>
</rss>

