<?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 Also, you cannot use the same in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114235#M73470</link>
    <description>&lt;P&gt;Also, you cannot use the same signal for multiple threads. Each thread should use a different signal value, you might consider using a reference to a thread stack local variable or a unique variable to the thread, such as the thread ID. *** The OpenMP omp_get_thread_num() will not be a unique number in the event of nested parallelism, so be careful about using that for a unique number.&lt;/P&gt;

&lt;P&gt;As mentioned by others, you should also have a signal wait.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
    <pubDate>Thu, 17 Mar 2016 18:32:06 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2016-03-17T18:32:06Z</dc:date>
    <item>
      <title>Segfault with asynchronous offload</title>
      <link>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114232#M73467</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I am facing a segmentation fault problem when I try to perform asynchronous offload at a later point which I believe is the time when the function returned.&lt;/P&gt;

&lt;P&gt;here is the code&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;functionA

real :: WORKN(X,Y,Z)

!dir$ offload begin target(MIC:0)signal(1)out(WORKN)
   do k=1,km
           .
           !Lots of code
!dir$ end offload

end function A


functionB

real :: Dummy

.
.
! Do Whatever

.
.
.
end function B




program run

!$OMP PARALLEL DO DEFAULT(SHARED) !this OMP is dummy i.e num_blockblock is 1, can be removed

do iblock=1,num_blocks

      call functionA(iblock) !here is the async offload

enddo

!$OMP END PARALLEL DO


!$OMP PARALLEL DO DEFAULT(SHARED)

do iblock=1,num_blocks

      call functionB(iblock) get segfault when B is running

enddo

!$OMP END PARALLEL DO

end program run
    &lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 07:17:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114232#M73467</guid>
      <dc:creator>aketh_t_</dc:creator>
      <dc:date>2016-03-17T07:17:11Z</dc:date>
    </item>
    <item>
      <title>Where do you wait for the</title>
      <link>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114233#M73468</link>
      <description>&lt;P&gt;Where do you wait for the async offload to be completed. &amp;nbsp;I don't see it in the code you posted. &amp;nbsp;I could speculate that &amp;nbsp;the async offload completed after your main program exited since I don't see the wait for the async offload.&lt;BR /&gt;
	Best if you can provide us a small reproduce.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 16:36:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114233#M73468</guid>
      <dc:creator>Ravi_N_Intel</dc:creator>
      <dc:date>2016-03-17T16:36:21Z</dc:date>
    </item>
    <item>
      <title>Without the save attribute,</title>
      <link>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114234#M73469</link>
      <description>&lt;P&gt;Without the save attribute, WORKN is a stack variable. You issue an offload which writes into it, and then you return from the function. At some point in time, a write to WORKN occurs, potentially, outside the stack, or into the stack frame of another function.&lt;/P&gt;

&lt;P&gt;That is most likely the cause of the problem.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 16:39:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114234#M73469</guid>
      <dc:creator>Rajiv_D_Intel</dc:creator>
      <dc:date>2016-03-17T16:39:39Z</dc:date>
    </item>
    <item>
      <title>Also, you cannot use the same</title>
      <link>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114235#M73470</link>
      <description>&lt;P&gt;Also, you cannot use the same signal for multiple threads. Each thread should use a different signal value, you might consider using a reference to a thread stack local variable or a unique variable to the thread, such as the thread ID. *** The OpenMP omp_get_thread_num() will not be a unique number in the event of nested parallelism, so be careful about using that for a unique number.&lt;/P&gt;

&lt;P&gt;As mentioned by others, you should also have a signal wait.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2016 18:32:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114235#M73470</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-03-17T18:32:06Z</dc:date>
    </item>
    <item>
      <title>The problem was the missing</title>
      <link>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114236#M73471</link>
      <description>&lt;P&gt;The problem was the missing wait statement. Thank you guys.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2016 08:47:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Segfault-with-asynchronous-offload/m-p/1114236#M73471</guid>
      <dc:creator>aketh_t_</dc:creator>
      <dc:date>2016-03-18T08:47:40Z</dc:date>
    </item>
  </channel>
</rss>

