<?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 dcopy problem with very large arrays in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979247#M17341</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have run into a problem when using dcopy with very large arrays.&amp;nbsp; Specifically, I am using dcopy to initialize a very large array to zero before doing other operations, and the dcopy is not setting all of the array to zero.&amp;nbsp; I think it is having a problem when the input n (ie, the length of the array) is greater than 2^31.&amp;nbsp; Attached is a simple piece of c++ that demonstrates the issue when run.&amp;nbsp; When compiled and run on my system, it gives the following output:&lt;/P&gt;
&lt;P&gt;testing use of dcopy on very large arrays&lt;BR /&gt;trying length = 2147483647&lt;BR /&gt;manually setting dbl_array to 1&lt;BR /&gt;using dcopy to set dbl_array to 0&lt;BR /&gt;trying length = 2147483649&lt;BR /&gt;manually setting dbl_array to 1&lt;BR /&gt;using dcopy to set dbl_array to 0&lt;BR /&gt;problem with dbl_array&lt;BR /&gt;dbl_array[0] = 1&lt;/P&gt;
&lt;P&gt;A few notes / some more information:&lt;/P&gt;
&lt;P&gt;1)&amp;nbsp; I have found the same problem with dscal and daxpy when n exceed 2^31.&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp; I am using/linking with the ILP64 version of MKL.&amp;nbsp; I switched to the ILP64 version of MKL so that I could work with matrices that have more than 2^31 entries.&amp;nbsp; My compile and link command looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; icpc dcopy_test.cc -DMKL_ILP64 -mkl&lt;/P&gt;
&lt;P&gt;3)&amp;nbsp; I am compiling/running this on a scientific linux 6.2 (ie, a redhat like) system.&amp;nbsp; The system is dual xeon e5-2667 with 128 GB memory, so it isn't running out of memory space.&lt;/P&gt;
&lt;P&gt;4)&amp;nbsp; I am compiling with icpc, whose version is:&lt;/P&gt;
&lt;P&gt;Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 12.1.4.319 Build 20120410&lt;/P&gt;
&lt;P&gt;5)&amp;nbsp; I am using the MKL libraries from composer_xe_2011_sp1.10.319.&amp;nbsp; Specifially, an ldd on the simple executable gives:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; linux-vdso.so.1 =&amp;gt;&amp;nbsp; (0x00007fffdbfff000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libmkl_intel_lp64.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007f65bcf3f000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libmkl_intel_thread.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64/libmkl_intel_thread.so (0x00007f65bbebf000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libmkl_core.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64/libmkl_core.so (0x00007f65bae49000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libiomp5.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libiomp5.so (0x00007f65bab57000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libm.so.6 =&amp;gt; /lib64/libm.so.6 (0x0000003349800000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libstdc++.so.6 =&amp;gt; /usr/lib64/libstdc++.so.6 (0x0000003354400000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libgcc_s.so.1 =&amp;gt; /lib64/libgcc_s.so.1 (0x0000003354000000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libpthread.so.0 =&amp;gt; /lib64/libpthread.so.0 (0x0000003349400000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libc.so.6 =&amp;gt; /lib64/libc.so.6 (0x0000003348c00000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libdl.so.2 =&amp;gt; /lib64/libdl.so.2 (0x0000003349000000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /lib64/ld-linux-x86-64.so.2 (0x0000003348800000)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any insight.&lt;/P&gt;
&lt;P&gt;Mark Muller&lt;/P&gt;
&lt;P&gt;markmuller@gmail.com&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2013 17:34:01 GMT</pubDate>
    <dc:creator>Mark_Muller</dc:creator>
    <dc:date>2013-08-20T17:34:01Z</dc:date>
    <item>
      <title>dcopy problem with very large arrays</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979247#M17341</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I have run into a problem when using dcopy with very large arrays.&amp;nbsp; Specifically, I am using dcopy to initialize a very large array to zero before doing other operations, and the dcopy is not setting all of the array to zero.&amp;nbsp; I think it is having a problem when the input n (ie, the length of the array) is greater than 2^31.&amp;nbsp; Attached is a simple piece of c++ that demonstrates the issue when run.&amp;nbsp; When compiled and run on my system, it gives the following output:&lt;/P&gt;
&lt;P&gt;testing use of dcopy on very large arrays&lt;BR /&gt;trying length = 2147483647&lt;BR /&gt;manually setting dbl_array to 1&lt;BR /&gt;using dcopy to set dbl_array to 0&lt;BR /&gt;trying length = 2147483649&lt;BR /&gt;manually setting dbl_array to 1&lt;BR /&gt;using dcopy to set dbl_array to 0&lt;BR /&gt;problem with dbl_array&lt;BR /&gt;dbl_array[0] = 1&lt;/P&gt;
&lt;P&gt;A few notes / some more information:&lt;/P&gt;
&lt;P&gt;1)&amp;nbsp; I have found the same problem with dscal and daxpy when n exceed 2^31.&lt;/P&gt;
&lt;P&gt;2)&amp;nbsp; I am using/linking with the ILP64 version of MKL.&amp;nbsp; I switched to the ILP64 version of MKL so that I could work with matrices that have more than 2^31 entries.&amp;nbsp; My compile and link command looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; icpc dcopy_test.cc -DMKL_ILP64 -mkl&lt;/P&gt;
&lt;P&gt;3)&amp;nbsp; I am compiling/running this on a scientific linux 6.2 (ie, a redhat like) system.&amp;nbsp; The system is dual xeon e5-2667 with 128 GB memory, so it isn't running out of memory space.&lt;/P&gt;
&lt;P&gt;4)&amp;nbsp; I am compiling with icpc, whose version is:&lt;/P&gt;
&lt;P&gt;Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 12.1.4.319 Build 20120410&lt;/P&gt;
&lt;P&gt;5)&amp;nbsp; I am using the MKL libraries from composer_xe_2011_sp1.10.319.&amp;nbsp; Specifially, an ldd on the simple executable gives:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; linux-vdso.so.1 =&amp;gt;&amp;nbsp; (0x00007fffdbfff000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libmkl_intel_lp64.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64/libmkl_intel_lp64.so (0x00007f65bcf3f000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libmkl_intel_thread.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64/libmkl_intel_thread.so (0x00007f65bbebf000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libmkl_core.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/mkl/lib/intel64/libmkl_core.so (0x00007f65bae49000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libiomp5.so =&amp;gt; /opt/intel/composer_xe_2011_sp1.10.319/compiler/lib/intel64/libiomp5.so (0x00007f65bab57000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libm.so.6 =&amp;gt; /lib64/libm.so.6 (0x0000003349800000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libstdc++.so.6 =&amp;gt; /usr/lib64/libstdc++.so.6 (0x0000003354400000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libgcc_s.so.1 =&amp;gt; /lib64/libgcc_s.so.1 (0x0000003354000000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libpthread.so.0 =&amp;gt; /lib64/libpthread.so.0 (0x0000003349400000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libc.so.6 =&amp;gt; /lib64/libc.so.6 (0x0000003348c00000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; libdl.so.2 =&amp;gt; /lib64/libdl.so.2 (0x0000003349000000)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /lib64/ld-linux-x86-64.so.2 (0x0000003348800000)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any insight.&lt;/P&gt;
&lt;P&gt;Mark Muller&lt;/P&gt;
&lt;P&gt;markmuller@gmail.com&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 17:34:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979247#M17341</guid>
      <dc:creator>Mark_Muller</dc:creator>
      <dc:date>2013-08-20T17:34:01Z</dc:date>
    </item>
    <item>
      <title>Hi, Thanks for reporting the</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979248#M17342</link>
      <description>&lt;P&gt;Hi, Thanks for reporting the problem and providing a reproducer. I'm investigating this and will report back here as soon as I find anything.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 23:07:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979248#M17342</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-08-20T23:07:11Z</dc:date>
    </item>
    <item>
      <title>Hi Mark,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979249#M17343</link>
      <description>&lt;P&gt;Hi Mark,&lt;/P&gt;
&lt;P&gt;The compiler option "-mkl" does not support MKL ILP64 interface. Quoting from the MKL user guide (http://software.intel.com/sites/products/documentation/doclib/mkl_sa/11/mkl_userguide_lnx/index.htm#GUID-4CD563F6-40A0-41E7-89C9-9F30B80DA693.htm )&lt;BR /&gt;======&lt;BR /&gt;On Intel® 64 architecture systems, for each variant of the -mkl option, the compiler links your application using the LP64 interface.&lt;BR /&gt;If you specify any variant of the -mkl compiler option, the compiler automatically includes the Intel MKL libraries. In cases not covered by the option, use the Link-line Advisor or see Linking in Detail. &lt;BR /&gt;========&lt;BR /&gt;When a program is compiled/linked with "-mkl", the compiler chooses to pick the MKL LP64 interface library. This can be confirmed by looking at the output of ldd,&lt;BR /&gt;libmkl_intel_lp64.so is the MKL LP64 interface library and we can see that it is being used. As the test program uses arrays of sizes greater than 2^31, but links with LP64 interface library it causes errors.&lt;BR /&gt;&lt;BR /&gt;If I explicitly link the test program with MKL and run (see below),&amp;nbsp; then I do not get any errors.&lt;BR /&gt;&lt;BR /&gt;[linux-host]$icpc&amp;nbsp; -openmp -DMKL_ILP64 -I$MKLROOT/include dcopy-test.cpp&amp;nbsp; -L$MKLROOT/lib/intel64 -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -lpthread -lm -o mklExplicitLinked.out&lt;BR /&gt;[linux-host]$ ./mklExplicitLinked.out &lt;BR /&gt;&lt;BR /&gt;testing use of dcopy on very large arrays&lt;BR /&gt;trying length = 2147483647&lt;BR /&gt;manually setting dbl_array to 1&lt;BR /&gt;using dcopy to set dbl_array to 0&lt;BR /&gt;trying length = 2147483649&lt;BR /&gt;manually setting dbl_array to 1&lt;BR /&gt;using dcopy to set dbl_array to 0&lt;BR /&gt;everything worked OK&lt;BR /&gt;&lt;BR /&gt;For more options on how-to explicitly link with MKL, please see the handy webtool "MKL Link Line Advisor": &lt;A href="http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor" target="_blank"&gt;http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 23:17:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979249#M17343</guid>
      <dc:creator>Vamsi_S_Intel</dc:creator>
      <dc:date>2013-08-20T23:17:15Z</dc:date>
    </item>
    <item>
      <title>Thanks to Vamsi for your</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979250#M17344</link>
      <description>&lt;P&gt;Thanks to Vamsi for your excellent explanation!&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2013 23:23:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979250#M17344</guid>
      <dc:creator>Zhang_Z_Intel</dc:creator>
      <dc:date>2013-08-20T23:23:43Z</dc:date>
    </item>
    <item>
      <title>Take a look at mkl_types.h</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979251#M17345</link>
      <description>Take a look at &lt;STRONG&gt;mkl_types.h&lt;/STRONG&gt; header file and you will see the following declaration:

...
/* MKL LP64 integer types */
#ifndef MKL_INT
    #define MKL_INT &lt;STRONG&gt;int&lt;/STRONG&gt;
#endif
#ifndef MKL_UINT
    #define MKL_UINT &lt;STRONG&gt;unsigned int&lt;/STRONG&gt;
#endif
...

On a 64-bit platform &lt;STRONG&gt;int&lt;/STRONG&gt; is a 32-bit integer type ( the same is applicable for &lt;STRONG&gt;long&lt;/STRONG&gt; ).</description>
      <pubDate>Thu, 22 Aug 2013 05:28:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/dcopy-problem-with-very-large-arrays/m-p/979251#M17345</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-08-22T05:28:00Z</dc:date>
    </item>
  </channel>
</rss>

