<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)">
<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-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">Recursive data structures are important if you consider linked lists important. 
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Supporting these is challenging but not impossible, I would expect that if someone manages to implement a cost effective way to support linked lists we would add support to OpenMP with ease.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<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"> Finkel, Hal J. <hfinkel@anl.gov>
<br>
<b>Sent:</b> Friday, June 28, 2019 10:46 PM<br>
<b>To:</b> Alexey Bataev <Alexey.Bataev@ibm.com>; Li, Lingda <lli@bnl.gov><br>
<b>Cc:</b> Alexandre Eichenberger <alexe@us.ibm.com>; Chapman, Barbara (Contact) <barbara.chapman@stonybrook.edu>; Kevin K O'Brien <caomhin@us.ibm.com>; Carlo Bertolli <cbertol@us.ibm.com>; Deepak Eachempati <deachempat@cray.com>; Denny, Joel E. <dennyje@ornl.gov>;
 David Oehmke <doehmke@cray.com>; Ettore Tiotto <etiotto@ca.ibm.com>; fraggamuffin@gmail.com; Rokos, Georgios <georgios.rokos@intel.com>; Gheorghe-Teod Bercea <Gheorghe-Teod.Bercea@ibm.com>; gregory.rodgers@amd.com; Sharif, Hashim <hsharif3@illinois.edu>; Cownie,
 James H <james.h.cownie@intel.com>; Sjodin, Jan <Jan.Sjodin@amd.com>; James Beyer <jbeyer@nvidia.com>; Doerfert, Johannes <jdoerfert@anl.gov>; Jones, Jeff C <jeff.c.jones@intel.com>; josem@udel.edu; Robichaux, Joseph <joseph.robichaux@intel.com>; Jeff Heath
 <jrheath@ca.ibm.com>; khaldi.dounia@gmail.com; Kelvin Li <kli@ca.ibm.com>; Bobrovsky, Konstantin S <konstantin.s.bobrovsky@intel.com>; Kotsifakou, Maria <kotsifa2@illinois.edu>; Li, Lingda (Contact) <lildmh@gmail.com>; Lopez, Matthew Graham <lopezmg@ornl.gov>;
 lopezmg@ornl.org; Menard, Lorri <lorri.menard@intel.com>; Martin Kong <martin.richard.kong@gmail.com>; Sarah McNamara <mcnamara@ca.ibm.com>; Rice, Michael P <michael.p.rice@intel.com>; Matt Martineau <m.martineau@bristol.ac.uk>; oscar@ornl.gov; Jeeva Paudel
 <pjeeva01@ca.ibm.com>; Rao, Premanand M <premanand.m.rao@intel.com>; Krishnaiyer, Rakesh <rakesh.krishnaiyer@intel.com>; Narayanaswamy, Ravi <ravi.narayanaswamy@intel.com>; Monteleone, Robert <robert.monteleone@intel.com>; Lieberman, Ron <Ron.Lieberman@amd.com>;
 Samuel Antao <Samuel.Antao@ibm.com>; Jeffrey Sandoval <sandoval@cray.com>; Sunita Chandrasekaran <schandra@udel.edu>; sergey.y.ostanevich@gmail.com; Sergio Pino Gallardo <sergiop@udel.edu>; Dmitriev, Serguei N <serguei.n.dmitriev@intel.com>; Chan, SiuChi <siuchi.chan@amd.com>;
 Sunil Shrestha <sshrestha@cray.com>; Wilmarth, Terry L <terry.l.wilmarth@intel.com>; Tianyi Zhang <tzhan18@lsu.edu>; vadve@illinois.edu; Wang Chen <wdchen@ca.ibm.com>; Wael Yehia <wyehia@ca.ibm.com>; Tian, Xinmin <xinmin.tian@intel.com>; cfe-dev@lists.llvm.org;
 openmp-dev@lists.llvm.org<br>
<b>Subject:</b> Re: Comparison of 2 schemes to implement OpenMP 5.0 declare mapper codegen<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi, Alexey, Lingda,<o:p></o:p></p>
<p>I haven't been following this closely, so a few questions/comments:<o:p></o:p></p>
<p> 1. Recursive mappers are not supported in OpenMP 5, but do we expect that to change in the future?<o:p></o:p></p>
<p> 2. Our experience so far suggests that the most important optimization in this space is to limit the number of distinct host-to-device transfers (or data copies) on systems where data needs to be copied. In these schemes, where does that coalescing occur?<o:p></o:p></p>
<p> 3. So long as the mappers aren't recursive, I agree with Alexey that the total number of to-be-mapped components should be efficient to calculate. The counting function should simplify to a trivial expression in nearly all cases. The only case where it
 might not is where the type contains an array section with dynamic bounds, and the element type also has a mapper with an array section with dynamic bounds. In this case (similar to the unsupported recursive cases, which as an aside, we should probably support
 it as an extension) we could need to walk the data structure twice to precalculate the number of total components to map. However, this case is certainly detectable by static analysis of the declared mappers, and so I think that we can get the best of both
 worlds: we could use Alexey's proposed scheme except in cases where we truly need to walk the data-structure twice, in which case we could use Lingda's combined walk/push_back scheme. Is there any reason why that wouldn't work?<o:p></o:p></p>
<p>Thanks again,<o:p></o:p></p>
<p>Hal<o:p></o:p></p>
<div>
<p class="MsoNormal">On 6/28/19 9:00 AM, Alexey Bataev wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p><span style="font-size:10.0pt">Hi Lingda, thanks for your comments.</span><br>
<span style="font-size:10.0pt">We can allocate the buffer either by allocating it on the stack or calling OpenMP allocate function.</span><br>
<span style="font-size:10.0pt">With this solution, we allocate memory only once (no need to resize buffer after push_backs) and we do not need to call the runtime function to put map data to the buffer, compiler generated code can do it.</span><br>
<span style="font-size:10.0pt">But anyway, I agree, it would be good to hear some other opinions.</span><br>
<span style="font-size:10.0pt">--------------</span><br>
<span style="font-size:10.0pt">Best regards,</span><br>
<span style="font-size:10.0pt">Alexey Bataev</span><o:p></o:p></p>
</blockquote>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p><span style="font-size:10.0pt">...</span><o:p></o:p></p>
</blockquote>
<pre>-- <o:p></o:p></pre>
<pre>Hal Finkel<o:p></o:p></pre>
<pre>Lead, Compiler Technology and Programming Languages<o:p></o:p></pre>
<pre>Leadership Computing Facility<o:p></o:p></pre>
<pre>Argonne National Laboratory<o:p></o:p></pre>
</div>
</div>

<DIV>
<HR>
</DIV>
<DIV>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. </DIV>
<DIV>
<HR>
</DIV>
</body>
</html>