<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=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<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:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Verdana",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
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 lang="EN-GB" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Welcome!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">The first thing to do is to look at the manual that accompanies the code. (See
<a href="http://llvm.org/svn/llvm-project/openmp/trunk/runtime/doc/">http://llvm.org/svn/llvm-project/openmp/trunk/runtime/doc/</a> or the equivalent place in your checked out code). It should clearly be updated (since it hasn’t been built since 2015); maybe
 this could be your first commit request…), but it does try to give you  some introduction. For scheduling look at the chapter on Work Sharing. That also points you at the functions you should be interested in, and the enumerations which list the supported
 schedules.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I expect that your new schedules will need to use the dynamic schedule interface, since that has a call into the runtime for each chunk
 of iterations a thread should execute, whereas the static schedule interface calls the runtime only once, then computes the iteration locally from the chunked block-cyclic distribution described by that initial call.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">For prototyping purposes, it is probably easiest to add some new call of your own (do
<b>not </b>use the </span><span style="font-size:10.0pt;font-family:"Lucida Console";color:#1F497D;mso-fareast-language:EN-US">omp_*</span><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"> namespace!)
 to set a flag inside the runtime that you can then check in the dynamic loop initialization code to choose your schedule at the next dynamic loop.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">So, something like<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";color:#1F497D;mso-fareast-language:EN-US">      ay_set_schedule_magic();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";color:#1F497D;mso-fareast-language:EN-US">#pragma omp for schedule(dynamic)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";color:#1F497D;mso-fareast-language:EN-US">      for (…)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";color:#1F497D;mso-fareast-language:EN-US">          … etc …<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Lucida Console";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">You’d then also need to define ay_set_schedule_magic() somewhere in the runtime and export it, and also have a null version of that
 in another shared library so that you can to the comparison between your code and the existing schedules on the same executable.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">You
<i>could </i>just force all dynamic loops to use your new schedule (via some envirable you checked for), but that may be more confusing, since it’s harder to do experiments on real code with many dynamic loops.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">If you want to do history based scheduling (remembering how a particular lexical loop behaved and using that information the next time
 it is executed), note that the first argument to all of these functions is a pointer to an ident_t which, in turn, points to a source location string. (With the Intel compiler you need to compile the code with –parallel-source-info=2 to get the full filename
 in there; I’m not sure what LLVM does about that). Without that flag there is still some source info it’s just not complete.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">(Hmm… it looks as if clang puts in the source file info without requiring extra compiler flags, look at
<a href="https://godbolt.org/z/HseSot">https://godbolt.org/z/HseSot</a> and note the
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:teal">.L__unnamed_2:</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:blue">.asciz</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black">
</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:#A31515">";/tmp/compiler-explorer-compiler1181022-56-1lbfx2g.w69k/example.cpp;square;4;9;;"</span><span style="font-size:12.0pt;font-family:"Times New Roman",serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">for instance).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">(If you’re not familiar with the compiler explorer, it may prove useful to you as a quick way to see what code is generated for a given
 OpenMP construct).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Good luck, and keep asking.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">-- Jim<br>
<br>
Jim Cownie <james.h.cownie@intel.com><br>
CVCG/DPD/TCAR (Technical Computing, Analyzers, and Runtimes)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D">Tel: +44 117 9071438</span><span style="color:#1F497D"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Openmp-dev [mailto:openmp-dev-bounces@lists.llvm.org]
<b>On Behalf Of </b>Akan Yilmaz via Openmp-dev<br>
<b>Sent:</b> Thursday, November 22, 2018 2:13 PM<br>
<b>To:</b> openmp-dev@lists.llvm.org<br>
<b>Subject:</b> [Openmp-dev] Additional Loop Scheduling Techniques<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="DE-CH">Hi all<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-CH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE-CH">I am completely new to the LLVM OpenMP runtime library. I am currently interested to implement additional loop scheduling techniques to the runtime library and then test them with different benchmarks. I wanted to ask
 you if one of you could help me getting things sorted out, like, which techniques are already implemented and where I can find documents to get more Information about the implementation that already exists. I am happy for every information!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-CH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="DE-CH">Have a nice day<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE-CH">Akan<o:p></o:p></span></p>
</div>
<p>---------------------------------------------------------------------<br>
Intel Corporation (UK) Limited<br>
Registered No. 1134945 (England)<br>
Registered Office: Pipers Way, Swindon SN3 1RJ<br>
VAT No: 860 2173 47</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></body>
</html>