<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:windowtext">Submitted a bug here: </span>
<a href="https://bugs.llvm.org/show_bug.cgi?id=42906">https://bugs.llvm.org/show_bug.cgi?id=42906</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks!<o:p></o:p></p>
<p class="MsoNormal">Simone<o:p></o:p></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="color:windowtext">From:</span></b><span style="color:windowtext"> Alexey Bataev <a.bataev@outlook.com>
<br>
<b>Sent:</b> Tuesday, August 6, 2019 12:02 PM<br>
<b>To:</b> Simone Atzeni <satzeni@nvidia.com>; openmp-dev@lists.llvm.org<br>
<b>Subject:</b> Re: [Openmp-dev] Runtime aborts when OMP_THREAD_LIMIT is set and "target teams" construct is used<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>No need to use -fopenmp-targets to reproduce the bug.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">$ clang -fopenmp test.c<o:p></o:p></p>
<p>$ OMP_THREAD_LIMIT=8 ./a.out<o:p></o:p></p>
<p>OMP: Warning #96: Cannot form a team with 192 threads, using 8 instead.<br>
OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set).<br>
Assertion failure at kmp_runtime.cpp(2434): other_threads[i].<br>
OMP: Error #13: Assertion failure at kmp_runtime.cpp(2434).<br>
OMP: Hint Please submit a bug report with this message, compile and run commands used, and machine configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information
 on submitting this issue, please see <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a>.<br>
[1]    148631 abort      OMP_THREAD_LIMIT=8 ./a.out<o:p></o:p></p>
<p>This is definitely a bug in OpenMP runtime. Better to submit a bug.<o:p></o:p></p>
<pre>-------------<o:p></o:p></pre>
<pre>Best regards,<o:p></o:p></pre>
<pre>Alexey Bataev<o:p></o:p></pre>
<div>
<p class="MsoNormal">06.08.2019 14:53, Simone Atzeni via Openmp-dev пишет:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I have this program: <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">#define N 100<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">int main()<o:p></o:p></p>
<p class="MsoNormal">{<o:p></o:p></p>
<p class="MsoNormal">    int x[N], y[N];<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">    for (int i = 0; i < N; i++) {<o:p></o:p></p>
<p class="MsoNormal">        y[i] = 1;<o:p></o:p></p>
<p class="MsoNormal">        x[i] = 1;<o:p></o:p></p>
<p class="MsoNormal">    }<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">#pragma omp target teams distribute parallel for<o:p></o:p></p>
<p class="MsoNormal">    for (int i = 0; i < N; i++){<o:p></o:p></p>
<p class="MsoNormal">        y[i] += x[i];<o:p></o:p></p>
<p class="MsoNormal">    }<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Compile and run in this way:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">$ clang -fopenmp -fopenmp-targets=x86_64-unknown-linux-gnu test.c -lomptarget<o:p></o:p></p>
<p class="MsoNormal">$ OMP_THREAD_LIMIT=8 OMP_TARGET_OFFLOAD=DISABLED ./a.out<o:p></o:p></p>
<p class="MsoNormal">OMP: Warning #96: Cannot form a team with 80 threads, using 8 instead.<o:p></o:p></p>
<p class="MsoNormal">OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set).<o:p></o:p></p>
<p class="MsoNormal">Segmentation fault (core dumped)<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I get the warning, but why does the runtime aborts?<o:p></o:p></p>
<p class="MsoNormal">Is this situation described in the Spec? I could not find anything specific.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I am using Clang/LLVM/OpenMP 8.0.1.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks.<o:p></o:p></p>
<p class="MsoNormal">Simone<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="5" width="100%" align="center">
</div>
</div>
<div>
<p class="MsoNormal">This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact
 the sender by reply email and destroy all copies of the original message. <o:p></o:p></p>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="5" width="100%" align="center">
</div>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Openmp-dev mailing list<o:p></o:p></pre>
<pre><a href="mailto:Openmp-dev@lists.llvm.org">Openmp-dev@lists.llvm.org</a><o:p></o:p></pre>
<pre><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><o:p></o:p></pre>
</blockquote>
</div>
</body>
</html>