<?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 Performance: offload vs native mode and  Fortran module in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Performance-offload-vs-native-mode-and-Fortran-module/m-p/1029074#M41285</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;System: Centos 7.0, compiler: parallel_studio_xe_2015, MPSS 3.4.2.&lt;/P&gt;

&lt;P&gt;I have Fortran code, when I compile in native mode. The running time is about 2.4 (seconds).&amp;nbsp; When I compile in offload the running time is about 5.2 (seconds). The transfer data size back to CPU in upload mode is about 144MB, which I estimated&amp;nbsp; is about 0.024 (seconds)&amp;nbsp; for&amp;nbsp; 6GB/s PCI Express. The data for offload from CPU to Xeon Phi is about 3.6MB. My question is why the offload code is much slower than the native mode code? To compile the offload code I run&lt;/P&gt;

&lt;P&gt;source /opt/intel/composer_xe_2015/bin/compilervars.sh&amp;nbsp; intel64&lt;/P&gt;

&lt;P&gt;then using ifort command.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have other questions regarding offload in Fortran:&lt;/P&gt;

&lt;P&gt;1.1) Using&amp;nbsp; data in module:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; MODULE&amp;nbsp; shared_data&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL&amp;nbsp;&amp;nbsp;&amp;nbsp; global_x(1000)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; END MODULE&amp;nbsp; shared_data&lt;/P&gt;

&lt;P&gt;subroutine fun1(y)&lt;/P&gt;

&lt;P&gt;use shared_data&lt;/P&gt;

&lt;P&gt;!access global_x here&lt;/P&gt;

&lt;P&gt;!&amp;nbsp; however global_x = 0 here?&lt;/P&gt;

&lt;P&gt;end subroutine&lt;/P&gt;

&lt;P&gt;subroutine fun2(y)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; calll fun1(y)&lt;/P&gt;

&lt;P&gt;end subroutine&lt;/P&gt;

&lt;P&gt;program MAIN&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; use shared_data&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; real&amp;nbsp;&amp;nbsp; y(10)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; global_x = 1.0&lt;/P&gt;

&lt;P&gt;&amp;nbsp; call fun2(y)&lt;/P&gt;

&lt;P&gt;end&lt;/P&gt;

&lt;P&gt;I try to use this module in subroutines which are offloaded to Xeon Phi. I have tried different Intel-specific directives or OpenMP 4.0 directives. However I could not transfer the value from CPU to Xeon Phi. Could anyone give a simple example how this can be done?&amp;nbsp; Note that the code works fine in native mode.&lt;/P&gt;

&lt;P&gt;1.2) Transfer&amp;nbsp; subarray of 2-D/N-D array to Xeon Phi in offload:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; I have array&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; real&amp;nbsp;&amp;nbsp; x(1000,5)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; I would like to offload to each Xeon Phi card x(:,i) , i=1:4&amp;nbsp; to 4 Xeon Phi cards to distribute work but when I put that in offload data directives, compiler reports errors of non-continous array.&amp;nbsp; How can this be done?&lt;/P&gt;

&lt;P&gt;&amp;nbsp; Many thanks in advance for your help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Dec 2014 17:07:14 GMT</pubDate>
    <dc:creator>Minh_H_</dc:creator>
    <dc:date>2014-12-19T17:07:14Z</dc:date>
    <item>
      <title>Performance: offload vs native mode and  Fortran module</title>
      <link>https://community.intel.com/t5/Software-Archive/Performance-offload-vs-native-mode-and-Fortran-module/m-p/1029074#M41285</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;System: Centos 7.0, compiler: parallel_studio_xe_2015, MPSS 3.4.2.&lt;/P&gt;

&lt;P&gt;I have Fortran code, when I compile in native mode. The running time is about 2.4 (seconds).&amp;nbsp; When I compile in offload the running time is about 5.2 (seconds). The transfer data size back to CPU in upload mode is about 144MB, which I estimated&amp;nbsp; is about 0.024 (seconds)&amp;nbsp; for&amp;nbsp; 6GB/s PCI Express. The data for offload from CPU to Xeon Phi is about 3.6MB. My question is why the offload code is much slower than the native mode code? To compile the offload code I run&lt;/P&gt;

&lt;P&gt;source /opt/intel/composer_xe_2015/bin/compilervars.sh&amp;nbsp; intel64&lt;/P&gt;

&lt;P&gt;then using ifort command.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I have other questions regarding offload in Fortran:&lt;/P&gt;

&lt;P&gt;1.1) Using&amp;nbsp; data in module:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; MODULE&amp;nbsp; shared_data&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL&amp;nbsp;&amp;nbsp;&amp;nbsp; global_x(1000)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; END MODULE&amp;nbsp; shared_data&lt;/P&gt;

&lt;P&gt;subroutine fun1(y)&lt;/P&gt;

&lt;P&gt;use shared_data&lt;/P&gt;

&lt;P&gt;!access global_x here&lt;/P&gt;

&lt;P&gt;!&amp;nbsp; however global_x = 0 here?&lt;/P&gt;

&lt;P&gt;end subroutine&lt;/P&gt;

&lt;P&gt;subroutine fun2(y)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; calll fun1(y)&lt;/P&gt;

&lt;P&gt;end subroutine&lt;/P&gt;

&lt;P&gt;program MAIN&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; use shared_data&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; real&amp;nbsp;&amp;nbsp; y(10)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; global_x = 1.0&lt;/P&gt;

&lt;P&gt;&amp;nbsp; call fun2(y)&lt;/P&gt;

&lt;P&gt;end&lt;/P&gt;

&lt;P&gt;I try to use this module in subroutines which are offloaded to Xeon Phi. I have tried different Intel-specific directives or OpenMP 4.0 directives. However I could not transfer the value from CPU to Xeon Phi. Could anyone give a simple example how this can be done?&amp;nbsp; Note that the code works fine in native mode.&lt;/P&gt;

&lt;P&gt;1.2) Transfer&amp;nbsp; subarray of 2-D/N-D array to Xeon Phi in offload:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; I have array&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; real&amp;nbsp;&amp;nbsp; x(1000,5)&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; I would like to offload to each Xeon Phi card x(:,i) , i=1:4&amp;nbsp; to 4 Xeon Phi cards to distribute work but when I put that in offload data directives, compiler reports errors of non-continous array.&amp;nbsp; How can this be done?&lt;/P&gt;

&lt;P&gt;&amp;nbsp; Many thanks in advance for your help.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; M&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Dec 2014 17:07:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Performance-offload-vs-native-mode-and-Fortran-module/m-p/1029074#M41285</guid>
      <dc:creator>Minh_H_</dc:creator>
      <dc:date>2014-12-19T17:07:14Z</dc:date>
    </item>
  </channel>
</rss>

