<html 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:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{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;}
/* List Definitions */
@list l0
{mso-list-id:1667903180;
mso-list-type:hybrid;
mso-list-template-ids:932878934 1308372134 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word;-webkit-nbsp-mode: space;line-break:after-white-space">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">Beowulf <beowulf-bounces@beowulf.org> on behalf of Lawrence Stewart <stewart@serissa.com><br>
<b>Date: </b>Monday, September 20, 2021 at 9:17 AM<br>
<b>To: </b>Jim Cownie <jcownie@gmail.com><br>
<b>Cc: </b>Lawrence Stewart <stewart@serissa.com>, Douglas Eadline <deadline@eadline.org>, "beowulf@beowulf.org" <beowulf@beowulf.org><br>
<b>Subject: </b>Re: [Beowulf] [EXTERNAL] Re: Deskside clusters<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Well said. Expanding on this, caches work because of both temporal locality and
<o:p></o:p></p>
<div>
<p class="MsoNormal">spatial locality. Spatial locality is addressed by having cache lines be substantially<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">larger than a byte or word. These days, 64 bytes is pretty common. Some prefetch schemes, <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">like the L1D version that fetches the VA ^ 64 clearly affect spatial locality. Streaming <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">prefetch has an expanded notion of “spatial” I suppose!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">What puzzles me is why compilers seem not to have evolved much notion of cache management. It <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">seems like something a smart compiler could do. Instead, it is left to Prof. Goto and the folks<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">at ATLAS and BLIS to figure out how to rewrite algorithms for efficient cache behavior. To my<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">limited knowledge, compilers don’t make much use of PREFETCH or any non-temporal loads and stores<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">either. It seems to me that once the programmer helps with RESTRICT and so forth, then compilers could perfectly well dynamically move parts of arrays around to maximize cache use.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">-L<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:0in"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:0in">I suspect that there’s enough variability among cache implementation and the wide variety of algorithms that might use it that writing a smart-enough compiler is “hard” and “expensive”.<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:0in"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:0in">Leaving it to the library authors is probably the best “bang for the buck”.
<o:p></o:p></p>
<p class="MsoListParagraph" style="margin-left:0in"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:0in"><o:p> </o:p></p>
<p class="MsoListParagraph" style="margin-left:0in"><o:p> </o:p></p>
</div>
</div>
</body>
</html>