<div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Thanks for the information.</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">For each static_init_4 call, there is a static_fini call. Is this specific to its static_init_4 call? Is there a pairing of calls that can not be broken? If we look at the static_fini call, the function arguments are the same. It seems that if we have two static_init_4 function calls, we can interchange their static_fini calls. Does that make sense?</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Suppose we have two loops, Loop-A and Loop-B ( Loop-A and Loop-B are identical in terms of iteration, chunk, increment, etc). One with omp for loop and other without it</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">#pragma omp for</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">{</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">  Loop-A</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">}</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Loop-B</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">If I move the static_fini call beyond Loop-B in IR; Should Loop-B be part of the Work Sharing environment and its iteration should be distributed similarly to Loop-A over the available threads?</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small">Thanks,</div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div><div class="gmail_default" style="font-family:courier new,monospace;font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 16, 2020 at 8:04 AM Churbanov, Andrey <<a href="mailto:Andrey.Churbanov@intel.com">Andrey.Churbanov@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div class="gmail-m_-4846176778215352823WordSection1">
<p class="MsoNormal">For static schedule the runtime does not track iterations.  The __kmpc_for_static_init_4 (or similar, depending on the iteration variable type) is the only runtime call for a statically scheduled loop (not counting leading barrier if any).
 After it compiler just loops over obtained range of iterations without involving runtime any more.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Regards,<u></u><u></u></p>
<p class="MsoNormal">Andrey<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b>From:</b> Openmp-dev <<a href="mailto:openmp-dev-bounces@lists.llvm.org" target="_blank">openmp-dev-bounces@lists.llvm.org</a>> <b>
On Behalf Of </b>Abid Malik via Openmp-dev<br>
<b>Sent:</b> Friday, March 13, 2020 9:35 PM<br>
<b>To:</b> <a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a><br>
<b>Subject:</b> [Openmp-dev] counts in the work sharing<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:"Courier New"">Hello,<br clear="all">
<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:"Courier New""><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:"Courier New"">I am looking into the void __kmp_for_static_init4 function which marks the start work sharing. </span><span style="font-size:9pt;font-family:Verdana,sans-serif;color:black;background:rgb(238,243,245)">The
 function computes the upper and lower bounds and stride to be used for the set of iterations to be executed by the current thread from the statically scheduled loop that is described by the initial values of the bround, stride, increment and chunk size.  How
 the record of iterations is kept. Which function/file should I look into to keep track of the iteration?</span><span style="font-size:12pt;font-family:"Courier New""><u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:"Courier New""><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:"Courier New""><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12pt;font-family:"Courier New"">Thanks,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">Abid M. Malik<br>
******************************************************<br>
"I have learned silence from the talkative, toleration from the intolerant, and kindness from the unkind"---Gibran<br>
"Success is not for the chosen few, but for the few who choose" --- John Maxwell<br>
"Being a good person does not depend on your religion or status in life, your race or skin color, political views or culture. IT DEPENDS ON HOW GOOD YOU TREAT OTHERS"--- Abid<br>
"The Universe is talking to us, and the language of the Universe is mathematics."----Abid<br>
 <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
<p><br>--------------------------------------------------------------------<br>Joint Stock Company Intel A/O<br>Registered legal address: Krylatsky Hills Business Park, <br>17 Krylatskaya Str., Bldg 4, Moscow 121614, <br>Russian Federation</p><p>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.</p>
</div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Abid M. Malik<br>******************************************************<br>"I have learned silence from the talkative, toleration from the intolerant, and kindness from the unkind"---Gibran<br>"Success is not for the chosen few, but for the few who choose" --- John Maxwell<br>"Being a good person does not depend on your religion or status in life, your race or skin color, political views or culture. IT DEPENDS ON HOW GOOD YOU TREAT OTHERS"--- Abid<br>"The Universe is talking to us, and the language of the Universe is mathematics."----Abid<br> </div></div></div>