<?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 Gennady, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-peak-mem-usage-does-not-reset/m-p/1011431#M19237</link>
    <description>&lt;P&gt;&lt;A href="https://software.intel.com/en-us/user/335030" style="font-size: 11px; line-height: 16.5px; background-color: rgb(238, 238, 238);"&gt;Gennady&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;From what i understand the code should behave as :&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_ENABLE) ; // enable counting&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;// various lines of code with allocations, deallocations, threading etc&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_RESET)&amp;nbsp;; // should reset &amp;nbsp;counters&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;&lt;SPAN style="line-height: 1.5;"&gt;printf( "memory peak : %lld\n", mkl_peak_mem_usage(MKL_PEAK_MEM)&amp;nbsp;&amp;nbsp;); // should print 0 (?)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;// do some calculations &amp;nbsp; (requires 30MB with a custom measure)&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;printf( "memory peak : %lld\n",&amp;nbsp;mkl_peak_mem_usage(MKL_PEAK_MEM)&amp;nbsp;&amp;nbsp;); // should print 30MB&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;// various lines of code with allocations, deallocations, threading etc&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_DISABLE); // disable counting&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;is this correct?&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;instead the output is :&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;1st print : 45MB&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;2nd print : 75MB&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;it is like the call to&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) does not reset peak memory to zero. If that is it's purpose of course.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Feb 2015 13:36:47 GMT</pubDate>
    <dc:creator>Konstantinos_K_</dc:creator>
    <dc:date>2015-02-17T13:36:47Z</dc:date>
    <item>
      <title>mkl_peak_mem_usage does not reset ?</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-peak-mem-usage-does-not-reset/m-p/1011429#M19235</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;i am using&amp;nbsp;mkl_peak_mem_usage to measure mkl memory usage and despite i use mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) , the counters are not zero. For example :&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_RESET)&amp;nbsp;&lt;/SPAN&gt;; // reset peak&lt;/P&gt;

&lt;P&gt;printf( "memory peak : %lld\n", &lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_RESET)&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;); // print peak and reset again&lt;/P&gt;

&lt;P&gt;// do some calculations&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;printf( "memory peak : %lld\n",&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_RESET)&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;); // print new peak and reset&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;the first peak print is 45MB,&amp;nbsp;the second peak print is 75MB and a custom calculation of memory needed in "do some calculations" is 75-45=30MB&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;my code is threaded using pthreads, and i also clear the mkl buffers using mkl_free_buffers and mkl_thread_free_buffers&lt;/P&gt;

&lt;P&gt;i have initialized with&amp;nbsp;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_ENABLE) at the start of my code&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;is there some error in&amp;nbsp;mkl_peak_mem_usage or maybe i do something wrong?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.0080003738403px; line-height: 19.5120010375977px;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2015 16:28:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-peak-mem-usage-does-not-reset/m-p/1011429#M19235</guid>
      <dc:creator>Konstantinos_K_</dc:creator>
      <dc:date>2015-02-16T16:28:19Z</dc:date>
    </item>
    <item>
      <title>Konstantinos, I am not sure</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-peak-mem-usage-does-not-reset/m-p/1011430#M19236</link>
      <description>&lt;P style="margin-top:0in;margin-right:0in;margin-bottom:.25in;margin-left:0in;
line-height:11.7pt"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;Konstantinos,&amp;nbsp;I am not sure understand what is the problem. Do you expect that the second time &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"&gt;mkl_peak_mem_usage&lt;/SPAN&gt;&lt;SPAN class="apple-converted-space"&gt;&lt;SPAN lang="EN-US" style="font-family: Arial, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif; color: rgb(51, 51, 51); background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"&gt;should return the same memory peak as a the first time? May be when you //do some calculation the second time, then this calculation required exactly 75 Mb of memory? &amp;nbsp; you also can have a look at the example - MKLROOT/&lt;/SPAN&gt;&lt;/SPAN&gt;examples/servicefuncsc/source/servicefuncs.c&amp;nbsp;&lt;/P&gt;

&lt;P style="margin-top:0in;margin-right:0in;margin-bottom:.25in;margin-left:0in;
line-height:11.7pt"&gt;&lt;SPAN lang="EN-US" style="font-size: 10pt; font-family: Arial, sans-serif;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="margin-top:0in;margin-right:0in;margin-bottom:.25in;margin-left:0in;
line-height:11.7pt"&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 13:12:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-peak-mem-usage-does-not-reset/m-p/1011430#M19236</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2015-02-17T13:12:00Z</dc:date>
    </item>
    <item>
      <title>Gennady,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-peak-mem-usage-does-not-reset/m-p/1011431#M19237</link>
      <description>&lt;P&gt;&lt;A href="https://software.intel.com/en-us/user/335030" style="font-size: 11px; line-height: 16.5px; background-color: rgb(238, 238, 238);"&gt;Gennady&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;From what i understand the code should behave as :&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_ENABLE) ; // enable counting&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;// various lines of code with allocations, deallocations, threading etc&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_RESET)&amp;nbsp;; // should reset &amp;nbsp;counters&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;&lt;SPAN style="line-height: 1.5;"&gt;printf( "memory peak : %lld\n", mkl_peak_mem_usage(MKL_PEAK_MEM)&amp;nbsp;&amp;nbsp;); // should print 0 (?)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;// do some calculations &amp;nbsp; (requires 30MB with a custom measure)&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;printf( "memory peak : %lld\n",&amp;nbsp;mkl_peak_mem_usage(MKL_PEAK_MEM)&amp;nbsp;&amp;nbsp;); // should print 30MB&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;// various lines of code with allocations, deallocations, threading etc&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_DISABLE); // disable counting&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;is this correct?&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;instead the output is :&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;1st print : 45MB&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;2nd print : 75MB&lt;/P&gt;

&lt;P style="font-size: 12px;"&gt;it is like the call to&amp;nbsp;&lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;mkl_peak_mem_usage(MKL_PEAK_MEM_RESET) does not reset peak memory to zero. If that is it's purpose of course.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 13:36:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/mkl-peak-mem-usage-does-not-reset/m-p/1011431#M19237</guid>
      <dc:creator>Konstantinos_K_</dc:creator>
      <dc:date>2015-02-17T13:36:47Z</dc:date>
    </item>
  </channel>
</rss>

