<?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 How to get stack traces in a OMP loop in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-get-stack-traces-in-a-OMP-loop/m-p/1651150#M174673</link>
    <description>&lt;P&gt;I would like to print stack traces when a check fails, like the ones I get with the option "-trace"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;main.f90&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;program main
  implicit none
  
  integer :: i, a(10)
  
  !$OMP PARALLEL DO PRIVATE(i) SHARED(a)
  do i = 1, 10
    a(5 - i) = i
  end do
  
  write(*,*) a
endprogram&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Complied without -qopenmp I get the correct stack trace:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifx -check -trace main.f90; ./a.out&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;forrtl: severe (408): fort: (3): Subscript #1 of the array A has value 0 which is less than the lower bound of 1

Image              PC                Routine            Line        Source             
a.out              0000000000405228  main                        8  main.f90
a.out              000000000040517D  Unknown               Unknown  Unknown
libc.so.6          00007F5543A2A2AE  Unknown               Unknown  Unknown
libc.so.6          00007F5543A2A379  __libc_start_main     Unknown  Unknown
a.out              0000000000405085  Unknown               Unknown  Unknown&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With -qopenmp&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifx -check -trace -qopenmp main.f90; ./a.out&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;forrtl: severe (408): fort: (3): Subscript #1 of the array A has value -1 which is less than the lower bound of 1

forrtl: severe (408): fort: (3): Subscript #1 of the array A has value -2 which is less than the lower bound of 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ifx version: ifx (IFX) 2025.0.0 20241008&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Dec 2024 10:25:56 GMT</pubDate>
    <dc:creator>WiserOrb</dc:creator>
    <dc:date>2024-12-20T10:25:56Z</dc:date>
    <item>
      <title>How to get stack traces in a OMP loop</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-get-stack-traces-in-a-OMP-loop/m-p/1651150#M174673</link>
      <description>&lt;P&gt;I would like to print stack traces when a check fails, like the ones I get with the option "-trace"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;main.f90&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;program main
  implicit none
  
  integer :: i, a(10)
  
  !$OMP PARALLEL DO PRIVATE(i) SHARED(a)
  do i = 1, 10
    a(5 - i) = i
  end do
  
  write(*,*) a
endprogram&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Complied without -qopenmp I get the correct stack trace:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifx -check -trace main.f90; ./a.out&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;forrtl: severe (408): fort: (3): Subscript #1 of the array A has value 0 which is less than the lower bound of 1

Image              PC                Routine            Line        Source             
a.out              0000000000405228  main                        8  main.f90
a.out              000000000040517D  Unknown               Unknown  Unknown
libc.so.6          00007F5543A2A2AE  Unknown               Unknown  Unknown
libc.so.6          00007F5543A2A379  __libc_start_main     Unknown  Unknown
a.out              0000000000405085  Unknown               Unknown  Unknown&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With -qopenmp&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ifx -check -trace -qopenmp main.f90; ./a.out&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;forrtl: severe (408): fort: (3): Subscript #1 of the array A has value -1 which is less than the lower bound of 1

forrtl: severe (408): fort: (3): Subscript #1 of the array A has value -2 which is less than the lower bound of 1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ifx version: ifx (IFX) 2025.0.0 20241008&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 10:25:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-get-stack-traces-in-a-OMP-loop/m-p/1651150#M174673</guid>
      <dc:creator>WiserOrb</dc:creator>
      <dc:date>2024-12-20T10:25:56Z</dc:date>
    </item>
    <item>
      <title>Re:How to get stack traces in a OMP loop</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-get-stack-traces-in-a-OMP-loop/m-p/1653765#M174751</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/370372"&gt;@WiserOrb&lt;/a&gt;&lt;/P&gt;&lt;P&gt;thanks for reporting this. At the moment, I can only provide the workaround of setting OMP_NUM_THREADS=1. I am checking with the developers why this is happening for OMP_NUM_THREADS&amp;gt;1&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Jan 2025 15:59:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/How-to-get-stack-traces-in-a-OMP-loop/m-p/1653765#M174751</guid>
      <dc:creator>TobiasK</dc:creator>
      <dc:date>2025-01-02T15:59:18Z</dc:date>
    </item>
  </channel>
</rss>

