<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'>Hi Terry,<br><br>-    bool uninitialized;<br>+    volatile kmp_int8 uninitialized; // 0=initialized, 1=uninitialized, 2=initialization in progress<br><br>Can you please define these in an enum so we can use names instead of the numbers directly (even if the variable itself is a volatile int). I'd rather that than having to remember what the values mean.<br><br>+    numPerLevel[0] = 4;<br>+    numPerLevel[1] = nprocs/4;<br>+    if (nprocs%4) numPerLevel[1]++;<br>+<br>+    for (int i=noaff_maxLevels-1; i>=0; --i) // count non-empty levels to get depth<br>+        if (numPerLevel[i] != 1 || noaff_depth > 1) // only count one top-level '1'<br>+            noaff_depth++;<br>+<br>+    kmp_uint32 branch = 4;<br>+    if (numPerLevel[0] == 1) branch = nprocs/4;<br>+    if (branch<4) branch=4;<br>+    for (kmp_uint32 d=0; d<noaff_depth-1; ++d) { // optimize hierarchy width<br>+        while (numPerLevel[d] > branch || (d==0 && numPerLevel[d]>4)) { // max 4 on level 0!<br>+            if (numPerLevel[d] & 1) numPerLevel[d]++;<br>+            numPerLevel[d] = numPerLevel[d] >> 1;<br>+            if (numPerLevel[d+1] == 1) noaff_depth++;<br>+            numPerLevel[d+1] = numPerLevel[d+1] << 1;<br>         }<br>+        if(numPerLevel[0] == 1) {<br>+            branch = branch >> 1;<br>+            if (branch<4) branch = 4;<br>+        }<br>+    }<br><br>I realize that this is a pre-existing issue, but what's so special about 4? Can we add a comment explaining that, and maybe make a constant (max_branch or similar) to hold this special number? Is this just a heuristic value used when we have affinity enabled but don't actually have affinity information?<br><br>Thanks again,<br>Hal<br><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Terry L Wilmarth" <terry.l.wilmarth@intel.com><br><b>To: </b>"Terry L Wilmarth" <terry.l.wilmarth@intel.com>, openmp-dev@dcs-maillist2.engr.illinois.edu<br><b>Sent: </b>Friday, April 10, 2015 4:08:01 PM<br><b>Subject: </b>Re: [Openmp-dev] Hierarchy generation patch<br><br>


<style><!--

@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:Gisha;
        panose-1:2 11 5 2 4 2 4 2 2 3;}

p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
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;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Gisha",sans-serif;
        color:windowtext;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Gisha",sans-serif;
        color:#4D7479;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.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>

<div class="WordSection1">
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Gisha",sans-serif; color: rgb(77, 116, 121);">*<b>ping</b>*</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Gisha",sans-serif; color: rgb(77, 116, 121);"> </span></p>
<div>
<div style="border-right: medium none; border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(225, 225, 225) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b>From:</b> openmp-dev-bounces@cs.uiuc.edu [mailto:openmp-dev-bounces@cs.uiuc.edu]
<b>On Behalf Of </b>Wilmarth, Terry L<br>
<b>Sent:</b> Friday, April 03, 2015 11:57 AM<br>
<b>To:</b> openmp-dev@dcs-maillist2.engr.illinois.edu<br>
<b>Subject:</b> [Openmp-dev] Hierarchy generation patch</p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Gisha",sans-serif;">Here’s another patch to the hierarchy generation:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Gisha",sans-serif;">1. hierarchy_gen_fixed.patch:  These are improvements to generation of the hierarchy used by hierarchical barrier. They improve how the generation reacts to affinity set to none,
 or disabled, or no affinity available, or oversubscription.</span></p>
<p class="MsoNormal" style=""><span style="font-size: 8pt; font-family: "Gisha",sans-serif;">--<br>
Terry L. Wilmarth<br>
<a href="mailto:terry.l.wilmarth@intel.com" target="_blank">terry.l.wilmarth@intel.com</a>   217/403-4251<br>
Intel/SSG/DPD/TCAR/RAD/Threading Runtimes  </span></p>
<p class="MsoNormal"> </p>
</div>
<br>_______________________________________________<br>Openmp-dev mailing list<br>Openmp-dev@dcs-maillist2.engr.illinois.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev<br></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>