<?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: Error mkl_avx2.2.dll when calculating large array in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1409988#M33558</link>
    <description>&lt;P&gt;This is my mkl version:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"Intel(R) oneAPI Math Kernel Library Version 2022.1-Product Build 20220311 for Intel(R) 64 architecture applications"&lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 00:57:24 GMT</pubDate>
    <dc:creator>nvh10</dc:creator>
    <dc:date>2022-08-23T00:57:24Z</dc:date>
    <item>
      <title>Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1409742#M33553</link>
      <description>&lt;P&gt;I need to calculate the operation A*P*A' by mkl function&amp;nbsp;mkl_sparse_d_syprd.&lt;/P&gt;
&lt;P&gt;In the example below, A is the identity matrix and P is the matrix with all elements are one. In my code, for the small array with nstate=100 or 1000, the code can run well. However if the values of nstate=50000 or larger, the following error appears:&amp;nbsp; &lt;EM&gt;"Exception thrown at 0x00007FFDFB353C57 (mkl_avx2.2.dll) in Console22.exe: 0xC0000005: Access violation reading location 0x0000025986EEA108."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Please help me solve this problem. Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;    ! A=Identity matrix
    !P=matrix with all elements are one 
    
    program test_spblas
    use mkl_spblas
    implicit none
    integer, parameter :: nstate = 50000
    double precision,allocatable, dimension (:,:):: P,APAT
    integer, allocatable, dimension (:):: c_A,pB_A,pE_A
    double precision, allocatable, dimension (:):: v_A
    integer stat,nnz_A,i
    type(sparse_matrix_t) :: A_s
    nnz_A=nstate
    allocate(v_A(nnz_A),c_A(nnz_A),pB_A(nstate),pE_A(nstate))
    allocate(P(nstate,nstate),APAT(nstate,nstate))
    do i=1,nstate
        pB_A(i)=i
        pE_A(i)=i+1
        c_A(i)=i
    enddo
    v_A=1d0
    P=1d0
    APAT=0d0
    stat = mkl_sparse_d_create_csr(a_s,sparse_index_base_one,nstate,nstate,pb_a,pe_a,c_a,v_a)
    stat = mkl_sparse_d_syprd (sparse_operation_non_transpose,a_s, p, sparse_layout_column_major, nstate, 1d0, 0d0, apat,spaRSE_LAYOUT_COLUMN_MAJOR, nstate)
    end program test_spblas&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 03:12:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1409742#M33553</guid>
      <dc:creator>nvh10</dc:creator>
      <dc:date>2022-08-22T03:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1409852#M33556</link>
      <description>&lt;P&gt;Hi,&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please try running the code from Intel oneAPI command prompt and see if it is working there?&lt;/P&gt;
&lt;P&gt;Please do let us know the MKL version with which you are working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Vidya.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:25:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1409852#M33556</guid>
      <dc:creator>VidyalathaB_Intel</dc:creator>
      <dc:date>2022-08-22T12:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1409988#M33558</link>
      <description>&lt;P&gt;This is my mkl version:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"Intel(R) oneAPI Math Kernel Library Version 2022.1-Product Build 20220311 for Intel(R) 64 architecture applications"&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 00:57:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1409988#M33558</guid>
      <dc:creator>nvh10</dc:creator>
      <dc:date>2022-08-23T00:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1410039#M33559</link>
      <description>&lt;P&gt;This is what I got from oneAPI command prompt :&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ifort test_spblas.f90 /Qiopenmp /Qopenmp-targets:spir64 /module:"D:\Fortran\oneAPI\mkl\2021.2.0\include\intel64\ilp64" /DMKL_ILP64 /4I8 -I"D:\Fortran\oneAPI\mkl\2021.2.0\include" /MD /fpp&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ifort: command line warning #10148: option '/Qiopenmp' not supported&lt;BR /&gt;ifort: command line warning #10148: option '/Qopenmp-targets:spir64' not supported&lt;BR /&gt;test.f90(30): error #6633: The type of the actual argument differs from the type of the dummy argument. [PB_A]&lt;BR /&gt;stat = mkl_sparse_d_create_csr(a_s,sparse_index_base_one,nstate,nstate,pb_a,pe_a,c_a,v_a)&lt;BR /&gt;---------------------------------------------------------------------------^&lt;BR /&gt;test.f90(30): error #6633: The type of the actual argument differs from the type of the dummy argument. [PE_A]&lt;BR /&gt;stat = mkl_sparse_d_create_csr(a_s,sparse_index_base_one,nstate,nstate,pb_a,pe_a,c_a,v_a)&lt;BR /&gt;--------------------------------------------------------------------------------^&lt;BR /&gt;test.f90(30): error #6633: The type of the actual argument differs from the type of the dummy argument. [C_A]&lt;BR /&gt;stat = mkl_sparse_d_create_csr(a_s,sparse_index_base_one,nstate,nstate,pb_a,pe_a,c_a,v_a)&lt;BR /&gt;-------------------------------------------------------------------------------------^&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 04:30:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1410039#M33559</guid>
      <dc:creator>nvh10</dc:creator>
      <dc:date>2022-08-23T04:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1410060#M33561</link>
      <description>&lt;P&gt;This is my last try. I used this command:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ifort /DMKL_DIRECT_CALL /fpp test.f90 mkl_intel_lp64.lib mkl_core.lib mkl_intel_thread.lib /Qopenmp -I"D:\Fortran\oneAPI\mkl\2021.2.0\include"/include&lt;/LI-CODE&gt;
&lt;P&gt;For nstate=10000. It's OK.&lt;/P&gt;
&lt;P&gt;But for nstate=50000. It's said:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;forrtl: severe (157): Program Exception - access violation
Image              PC                Routine            Line        Source
test.exe           00007FF7361CC128  Unknown               Unknown  Unknown
test.exe           00007FF736169AE2  Unknown               Unknown  Unknown
libiomp5md.dll     00007FFAE04B65D3  Unknown               Unknown  Unknown
libiomp5md.dll     00007FFAE0409877  Unknown               Unknown  Unknown
libiomp5md.dll     00007FFAE040B54C  Unknown               Unknown  Unknown
libiomp5md.dll     00007FFAE03C4CE1  Unknown               Unknown  Unknown
test.exe           00007FF736169477  Unknown               Unknown  Unknown
test.exe           00007FF736168012  Unknown               Unknown  Unknown
test.exe           00007FF736151818  Unknown               Unknown  Unknown
test.exe           00007FF7361D21BE  Unknown               Unknown  Unknown
test.exe           00007FF7361D2584  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FFB50CB7034  Unknown               Unknown  Unknown
ntdll.dll          00007FFB51C62651  Unknown               Unknown  Unknown&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Aug 2022 06:09:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1410060#M33561</guid>
      <dc:creator>nvh10</dc:creator>
      <dc:date>2022-08-23T06:09:41Z</dc:date>
    </item>
    <item>
      <title>Re:Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1411327#M33580</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing the details.&lt;/P&gt;&lt;P&gt;The issue is reproducible from our end as well.&lt;/P&gt;&lt;P&gt;We are working on this issue, we will get back to you soon.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidya.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Aug 2022 07:15:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1411327#M33580</guid>
      <dc:creator>VidyalathaB_Intel</dc:creator>
      <dc:date>2022-08-29T07:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1412548#M33610</link>
      <description>&lt;P&gt;Thank you very much for helping me!&lt;/P&gt;</description>
      <pubDate>Sat, 03 Sep 2022 02:13:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1412548#M33610</guid>
      <dc:creator>nvh10</dc:creator>
      <dc:date>2022-09-03T02:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1457081#M34280</link>
      <description>&lt;P&gt;Hi nvh10,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like there are a few things going on here, but the main one that is causing the overflow for nstate=50000 and not for nstate=10000 is the use of lp64.&amp;nbsp; This means that pointers are 64 bit addresses, but integers are only 32 bit integers.&amp;nbsp; Additionally, the internal implementation is actually in C language, so any 2D fortran pointers are actually collapsed and treated like 1D C arrays (you can see this in the module file with regards to the pointer DIMENSION(*)) . This normally works out, but may be to our disadvantage here in this case when dealing with integers and offsets...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It turns out that the range of int32 is [-2147483648, 2147483647] and the smallest int32 N such that N*N is in this range is N=46340.&amp;nbsp; So for 50000, if we are doing something like C[ row * ldc + col]&amp;nbsp; and row, ldc and col are 32 bit integers,&amp;nbsp; then it is possible (likely) they could overflow and end up negative, then be upcast (still negative) in some way in the address offset computation which results in a seg fault.&amp;nbsp; There are things we can do internally to make sure these addresses are computed using 64 bit integers which are compatible with the 64 bit addresses, and we will do this more carefully in the product, but otherwise, we need to be careful about this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We are still looking into some other aspects of the ilp64 solution where it appears that the ldb and ldc are sometimes incorrect when they get to our internal kernels.&amp;nbsp; Will update on that once more is understood.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps a bit so far &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;Spencer&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 23:56:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1457081#M34280</guid>
      <dc:creator>Spencer_P_Intel</dc:creator>
      <dc:date>2023-02-17T23:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1458346#M34284</link>
      <description>&lt;P&gt;Ok, here is the rest of the details.&amp;nbsp; It turns out that there was an additional issue in the mkl_spblas.f90 module file for mkl_sparse_x_syprd which prevented the ilp64 version from working properly.&amp;nbsp; We use ISO_C_BINDING 's to map this from the Fortran API you are calling to a C function implemented internally.&amp;nbsp; In the case of mkl_sparse_x_syprd,&amp;nbsp; there are two input arguments:&amp;nbsp; ldb and ldc which where being incorrectly mapped.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you change&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="pl-k"&gt;INTEGER(C_INT)&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;INTENT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;::&lt;/SPAN&gt;&lt;SPAN&gt; ldb&lt;BR /&gt;and&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;INTEGER(C_INT)&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;INTENT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;IN&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;::&lt;/SPAN&gt;&lt;SPAN&gt; ldc&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;to&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="pl-k"&gt;INTEGER&lt;/SPAN&gt;, &lt;SPAN class="pl-k"&gt;INTENT&lt;/SPAN&gt;(&lt;SPAN class="pl-k"&gt;IN&lt;/SPAN&gt;) &lt;SPAN class="pl-k"&gt;::&lt;/SPAN&gt; ldb&lt;BR /&gt;and&lt;BR /&gt;&lt;SPAN class="pl-k"&gt;INTEGER&lt;/SPAN&gt;, &lt;SPAN class="pl-k"&gt;INTENT&lt;/SPAN&gt;(&lt;SPAN class="pl-k"&gt;IN&lt;/SPAN&gt;) &lt;SPAN class="pl-k"&gt;::&lt;/SPAN&gt; ldc&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;then everything will work as desired.&amp;nbsp; The C_INT kind always maps to a 4 byte integer, but ldb and ldc should be a 4 or 8 byte integer depending on use of the compiler option ( -i8&amp;nbsp; on linux/mac )&amp;nbsp; or ( /4I8 on Windows) to make integer 8 bytes in Fortran.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;These are changes you can make yourself to the module file if this is necessary for another project immediately and will be fixed in the next oneMKL release (likely oneMKL 2023.1).&amp;nbsp; Thank you for sharing this issue, so we could fix it &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 19:01:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1458346#M34284</guid>
      <dc:creator>Spencer_P_Intel</dc:creator>
      <dc:date>2023-02-22T19:01:16Z</dc:date>
    </item>
    <item>
      <title>Re:Error mkl_avx2.2.dll when calculating large array</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1460426#M34299</link>
      <description>&lt;P&gt;Thank you again to raise the issue. The fixed will be available in oneMKL next release. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 01 Mar 2023 01:42:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Error-mkl-avx2-2-dll-when-calculating-large-array/m-p/1460426#M34299</guid>
      <dc:creator>Ruqiu_C_Intel</dc:creator>
      <dc:date>2023-03-01T01:42:58Z</dc:date>
    </item>
  </channel>
</rss>

