<?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:Intel Vtune cannot find python source file in Analyzers</title>
    <link>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1243448#M19792</link>
    <description>&lt;P&gt;VTune offer full support for profiling python code and the tool should be able to display the source code in your python file as you expected. Could you please check if the function you are expecting to see in the VTune results, ran long enough?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Just to confirm that everything is working fine, I wrote a matrix multiplication code as shown below (don't worry about the accuracy of the code itself):&lt;/P&gt;&lt;P&gt;---------------------------------------------------&lt;/P&gt;&lt;P&gt;def matrix_mul(X, Y):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;result_matrix = [ [ 1 for i in range(len(X)) ] for j in range(len(Y[0])) ]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;# iterate through rows of X&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;for i in range(len(X)):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# iterate through columns of Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j in range(len(Y[0])):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# iterate through rows of Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for k in range(len(Y)):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result_matrix[i][j] += X[i][k] * Y[k][j]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return result_matrix&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Then I called this function (matrix_mul) on my Ubuntu machine with large enough matrices so that the overall execution time was in the order of few seconds. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I used the below command to start profiling (you can also see the VTune version I used):&lt;/P&gt;&lt;P&gt;/opt/intel/oneapi/vtune/2021.1.1/bin64/vtune -collect hotspots -knob enable-stack-collection=true -data-limit=500 -ring-buffer=10 -app-working-dir /usr/bin -- python3 /home/johnypau/MyIntel/temp/Python_matrix_mul/mat_mul_method.py&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Now open the VTune results in the GUI and under the bottom-up tab, order by "Module / Function / Call-stack" (or whatever preferred grouping is). &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You should be able to see the the module (mat_mul_method.py in my case) and the function "matrix_mul". If you double click, VTune should be able to load the sources too. Please let me know if you still have difficulties viewing your code. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Johny&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 05 Jan 2021 13:55:30 GMT</pubDate>
    <dc:creator>Johny_P_Intel</dc:creator>
    <dc:date>2021-01-05T13:55:30Z</dc:date>
    <item>
      <title>Intel Vtune cannot find python source file</title>
      <link>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1241693#M19759</link>
      <description>&lt;P data-unlink="true"&gt;This is an old problem as is demonstrated as in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;https://community.intel.com/t5/Analyzers/Unable-to-view-source-code-when-analyzing-results/td-p/1153210&amp;nbsp;. I have tried all the listed methods,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;none of them works&lt;/STRONG&gt;, and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;I cannot find any more solutions on the internet&lt;/STRONG&gt;. Basically vtune cannot find the custom python source file no matter what is tried. &lt;A href="https://yesornogenerator.com/what-i-should-do-right-now-generator/" target="_self"&gt;I&lt;/A&gt; am using the most recently version as of speaking. Please let me whether there is a solution.&lt;/P&gt;
&lt;P&gt;For example, if you run the following program.&lt;/P&gt;
&lt;PRE class="lang-py s-code-block hljs python"&gt;&lt;CODE&gt;&lt;SPAN class="hljs-function"&gt;&lt;SPAN class="hljs-keyword"&gt;def&lt;/SPAN&gt; &lt;SPAN class="hljs-title"&gt;myfunc&lt;/SPAN&gt;(&lt;SPAN class="hljs-params"&gt;*args&lt;/SPAN&gt;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;
    &lt;SPAN class="hljs-comment"&gt;# Do a lot of things. &lt;/SPAN&gt;

&lt;SPAN class="hljs-keyword"&gt;if&lt;/SPAN&gt; __name__ = &lt;SPAN class="hljs-string"&gt;'__main__'&lt;/SPAN&gt;:
    &lt;SPAN class="hljs-comment"&gt;# Do something and call myfunc&lt;/SPAN&gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Call this script&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;main.py&lt;/CODE&gt;. Now use the newest vtune version (I have using Ubuntu 18.04), run the vtune-gui and basic hotspot analysis. You will not found any information on this file. However, a huge pile of information on Python and its other codes are found (related to your python environment). In theory, you should be able to find the source of&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;main.py&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;as well as cost on each line in that script. However, that is simply not happening.&lt;/P&gt;
&lt;P&gt;Desired behavior: I would really like to find the source file and function in the top-down manual (or any really). Any advice is welcome.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 17:21:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1241693#M19759</guid>
      <dc:creator>Rhonda99</dc:creator>
      <dc:date>2020-12-29T17:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Intel Vtune cannot find python source file</title>
      <link>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1241926#M19760</link>
      <description>&lt;P&gt;Hi Rhonda,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;
&lt;P&gt;As this question is specifically about running a python application using Intel Vtune Profiler, we are moving this query to&amp;nbsp;&lt;A href="https://community.intel.com/t5/Analyzers/bd-p/analyzers" target="_self"&gt;Intel Analyzers Forum&lt;/A&gt;&amp;nbsp; for a faster resolution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Chithra&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Dec 2020 07:04:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1241926#M19760</guid>
      <dc:creator>ChithraJ_Intel</dc:creator>
      <dc:date>2020-12-30T07:04:58Z</dc:date>
    </item>
    <item>
      <title>Re:Intel Vtune cannot find python source file</title>
      <link>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1242383#M19767</link>
      <description>&lt;P&gt;Hi Rhonda,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We are forwarding your query to Subject Matter Experts who can help you to solve this issue.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chithra&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Dec 2020 11:28:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1242383#M19767</guid>
      <dc:creator>ChithraJ_Intel</dc:creator>
      <dc:date>2020-12-31T11:28:07Z</dc:date>
    </item>
    <item>
      <title>Re:Intel Vtune cannot find python source file</title>
      <link>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1243448#M19792</link>
      <description>&lt;P&gt;VTune offer full support for profiling python code and the tool should be able to display the source code in your python file as you expected. Could you please check if the function you are expecting to see in the VTune results, ran long enough?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Just to confirm that everything is working fine, I wrote a matrix multiplication code as shown below (don't worry about the accuracy of the code itself):&lt;/P&gt;&lt;P&gt;---------------------------------------------------&lt;/P&gt;&lt;P&gt;def matrix_mul(X, Y):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;result_matrix = [ [ 1 for i in range(len(X)) ] for j in range(len(Y[0])) ]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;# iterate through rows of X&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;for i in range(len(X)):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# iterate through columns of Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for j in range(len(Y[0])):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;# iterate through rows of Y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for k in range(len(Y)):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;result_matrix[i][j] += X[i][k] * Y[k][j]&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return result_matrix&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Then I called this function (matrix_mul) on my Ubuntu machine with large enough matrices so that the overall execution time was in the order of few seconds. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I used the below command to start profiling (you can also see the VTune version I used):&lt;/P&gt;&lt;P&gt;/opt/intel/oneapi/vtune/2021.1.1/bin64/vtune -collect hotspots -knob enable-stack-collection=true -data-limit=500 -ring-buffer=10 -app-working-dir /usr/bin -- python3 /home/johnypau/MyIntel/temp/Python_matrix_mul/mat_mul_method.py&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Now open the VTune results in the GUI and under the bottom-up tab, order by "Module / Function / Call-stack" (or whatever preferred grouping is). &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;You should be able to see the the module (mat_mul_method.py in my case) and the function "matrix_mul". If you double click, VTune should be able to load the sources too. Please let me know if you still have difficulties viewing your code. &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Johny&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 05 Jan 2021 13:55:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1243448#M19792</guid>
      <dc:creator>Johny_P_Intel</dc:creator>
      <dc:date>2021-01-05T13:55:30Z</dc:date>
    </item>
    <item>
      <title>Re:Intel Vtune cannot find python source file</title>
      <link>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1248524#M19891</link>
      <description>&lt;P&gt;Hi Rhonda99,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;  Can we assume that this issue is resolved? Did you get a chance to try this again as suggested above? &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Johny&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jan 2021 10:25:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1248524#M19891</guid>
      <dc:creator>Johny_P_Intel</dc:creator>
      <dc:date>2021-01-21T10:25:56Z</dc:date>
    </item>
    <item>
      <title>Re:Intel Vtune cannot find python source file</title>
      <link>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1253966#M19964</link>
      <description>&lt;P&gt;This issue has been resolved and we will no longer respond to this thread.&amp;nbsp;If you require additional assistance from Intel, please start a new thread.&amp;nbsp;Any further interaction in this thread will be considered community only.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Johny&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Feb 2021 09:27:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Analyzers/Intel-Vtune-cannot-find-python-source-file/m-p/1253966#M19964</guid>
      <dc:creator>Johny_P_Intel</dc:creator>
      <dc:date>2021-02-08T09:27:04Z</dc:date>
    </item>
  </channel>
</rss>

