<?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: Segmentation fault on declaring large array when mkl is linked in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504375#M34811</link>
    <description>&lt;P&gt;Thank you for your responses. After some digging it turns out that the problem is not with mkl itself, but rather with openmp. If the program is run with -mkl=sequential the issue disappears. Removing the -mkl flag altogether and adding the -fopenmp flag gives the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running Valgrind on the program returns an invalid read of size 8 in libiomp5.so as the reason for the segfault.&lt;/P&gt;&lt;P&gt;Unfortunately I can only link libraries installed on the cluster and I don't have a local machine with enough memory to test this program. I have tried linking the intel 2022 libraries, which is the latest installed version, but the same problem persists. The cluster runs on CentOS.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jul 2023 09:15:11 GMT</pubDate>
    <dc:creator>JaspervdK</dc:creator>
    <dc:date>2023-07-13T09:15:11Z</dc:date>
    <item>
      <title>Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1503799#M34796</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a curious issue where a very simple (Fortran) program produces a segmentation fault if mkl is linked in the compiler. The program looks like,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------&lt;/P&gt;&lt;P&gt;program main&lt;BR /&gt;implicit none&lt;BR /&gt;&amp;nbsp; integer :: N_total&lt;BR /&gt;&amp;nbsp; complex*16, allocatable, dimension(:,:) :: Z_matrix_c&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; N_total = 254571&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; print*, 'before allocation'&lt;BR /&gt;&amp;nbsp; allocate(Z_matrix_c(N_total, N_total))&lt;BR /&gt;&amp;nbsp; print*, 'After Z_matrix_C allocation'&lt;BR /&gt;end program main&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------&lt;/P&gt;&lt;P&gt;I know the complex*16 type declaration is not standard, but for legacy reasons I have to stick with it for now. The program allocates a very large (~ 1TB) array of double precision complex numbers. I am running this code on a cluster, where it works fine if I compile using ifort without any flags. If however I link the mkl library via -qmkl, the program segfaults upon entering the allocate statement. Curiously, if I increase the dimension of the array and make N_total say 270,000, the program also runs without issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have an idea what may be happening here? I am using the 2021 versions of ifort and mkl.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 20:48:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1503799#M34796</guid>
      <dc:creator>JaspervdK</dc:creator>
      <dc:date>2023-07-11T20:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504079#M34800</link>
      <description>&lt;P&gt;You could try to link this case against ILP64 libraries. Please check &lt;A href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html" target="_self"&gt;MKL Linker Adviser&lt;/A&gt; which libraries and compiler option you need to use.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 10:21:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504079#M34800</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2023-07-13T10:21:15Z</dc:date>
    </item>
    <item>
      <title>Re: Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504371#M34810</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting in Intel Communities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please let us know the OS details, and Cluster details you are using? Also, could you please provide us with the complete error you are getting while using the '-qmkl' option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And also, we recommend you try the latest Intel MKL 2023.1.0 and let us know if your issue still persists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;&lt;SPAN class="sub_section_element_selectors"&gt;Curiously, if I increase the dimension of the array and make N_total say 270,000, the program also runs without issue.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;Could you please let us know if you are using the '-qmkl' option and you did not face any error?&amp;nbsp;&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Varsha&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 09:17:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504371#M34810</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2023-07-13T09:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504375#M34811</link>
      <description>&lt;P&gt;Thank you for your responses. After some digging it turns out that the problem is not with mkl itself, but rather with openmp. If the program is run with -mkl=sequential the issue disappears. Removing the -mkl flag altogether and adding the -fopenmp flag gives the same error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running Valgrind on the program returns an invalid read of size 8 in libiomp5.so as the reason for the segfault.&lt;/P&gt;&lt;P&gt;Unfortunately I can only link libraries installed on the cluster and I don't have a local machine with enough memory to test this program. I have tried linking the intel 2022 libraries, which is the latest installed version, but the same problem persists. The cluster runs on CentOS.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 09:15:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504375#M34811</guid>
      <dc:creator>JaspervdK</dc:creator>
      <dc:date>2023-07-13T09:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504380#M34812</link>
      <description>&lt;P&gt;Yes if I increase the dimension of the array the program runs fine even with -qmkl turned on.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jul 2023 09:19:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1504380#M34812</guid>
      <dc:creator>JaspervdK</dc:creator>
      <dc:date>2023-07-13T09:19:18Z</dc:date>
    </item>
    <item>
      <title>Re:Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1506499#M34843</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please provide us with the complete command being used by you in running the code and let us know whether you are using ILP64 or LP64 libraries?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In addition, could you please let us know if you are able to run with Intel MKL (sequential as well as parallel) or if you are facing an issue with only OpenMP?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, please find the below link for using Intel Link Line Advisor which helps you with the link line commands to be provided while compiling your source.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html" rel="noopener noreferrer" target="_blank"&gt;https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Varsha&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Jul 2023 08:33:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1506499#M34843</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2023-07-20T08:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1506502#M34844</link>
      <description>&lt;P&gt;I compile the code as,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="none"&gt;ifort code.F90 -i8 -qopenmp -o run&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then ./run. In this case I get the segmentation fault. You can see I run in ILP64, however turning off the -i8 flag actually does not matter for my error. If I compile with MKL instead,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifort code.F90 -i8 -qmkl -o run&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the same segmentation fault. If I compile in sequential mode,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifort code.F90 -i8 -qmkl=sequential -o run&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then the segmentation fault disappears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: I just noticed in the Link Line advisor that ILP64 requires linking -qmkl-ilp64. Maybe this is the issue, once I have access to the cluster again I will test this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit 2: I now tried to compile as,&lt;/P&gt;&lt;LI-CODE lang="none"&gt;ifort code.F90 -i8 -qmkl-ilp64 -o run&lt;/LI-CODE&gt;&lt;P&gt;but I still get the segmentation fault.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2023 12:32:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1506502#M34844</guid>
      <dc:creator>JaspervdK</dc:creator>
      <dc:date>2023-07-20T12:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1507260#M34851</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coincidentally, the intel compilers installed on the cluster were being updated to the new 2023 versions this week. It turns out that my allocation program does not run into any error when I use the new updated compilers, so it seems that my problem was solved in the latest update. Thanks a lot for the help!&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jul 2023 12:24:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1507260#M34851</guid>
      <dc:creator>JaspervdK</dc:creator>
      <dc:date>2023-07-22T12:24:47Z</dc:date>
    </item>
    <item>
      <title>Re:Segmentation fault on declaring large array when mkl is linked</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1507617#M34857</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;gt;&amp;gt;Thanks a lot for the help!&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Have a Good Day!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Varsha&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Jul 2023 14:04:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Segmentation-fault-on-declaring-large-array-when-mkl-is-linked/m-p/1507617#M34857</guid>
      <dc:creator>VarshaS_Intel</dc:creator>
      <dc:date>2023-07-24T14:04:49Z</dc:date>
    </item>
  </channel>
</rss>

