<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hui,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The library was built on one of our internal build servers, and run on a different machine of course. But I don't think it's a configure issue. I did a quick test and it's definitely possible for the address of a pointer
 to not be 8-byte aligned:<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>
<div>[nradclif@heron ~]$ cat test_align.c<br>
#include <stdlib.h><br>
#include <stdio.h><br>
<br>
int main()<br>
{<br>
    int *c;<br>
<br>
    struct<br>
    {<br>
        int a;<br>
        int *b;<br>
    } __attribute__((packed)) s;<br>
<br>
    c = (int *)&s.b;<br>
<br>
    fprintf(stdout, "c = %p\n", c);<br>
<br>
    return 0;<br>
}<br>
[nradclif@heron ~]$ ./test_align.x<br>
c = 0x7ffe3d4e2c44</div>
<div><br>
</div>
<div><br>
</div>
<div>I'll have to talk to the user to get more details about their code.<br>
</div>
</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<meta content="text/html; charset=UTF-8">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<br>
<div class="OutlineElement Ltr SCXW111908216 BCX2" style="direction:ltr">
<p class="Paragraph SCXW111908216 BCX2" style="font-weight:normal; font-style:normal; vertical-align:baseline; background-color:transparent; color:windowtext; text-align:left; margin-left:0px; margin-right:0px; padding-left:0px; padding-right:0px; text-indent:0px">
<span class="TextRun SCXW111908216 BCX2" style="color:rgb(38,202,211); font-weight:bold; font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">Nick
 Radcliffe  </span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">Software
 Engineer</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">
 | Cray Inc.</span></span><span class="EOP SCXW111908216 BCX2" style="font-size:11pt; line-height:18px; font-family:Arial,Arial_MSFontService,sans-serif"> </span></p>
</div>
<div class="OutlineElement Ltr SCXW111908216 BCX2" style="direction:ltr">
<p class="Paragraph SCXW111908216 BCX2" style="font-weight:normal; font-style:normal; vertical-align:baseline; background-color:transparent; color:windowtext; text-align:left; margin-left:0px; margin-right:0px; padding-left:0px; padding-right:0px; text-indent:0px">
<span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">2131 Lindau
 Ln #1000 </span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">|
</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">Bloomington</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">,
</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">MN</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">
</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">55425</span></span><span class="EOP SCXW111908216 BCX2" style="font-size:11pt; line-height:18px; font-family:Arial,Arial_MSFontService,sans-serif"> </span></p>
</div>
<div class="OutlineElement Ltr SCXW111908216 BCX2" style="direction:ltr">
<p class="Paragraph SCXW111908216 BCX2" style="font-weight:normal; font-style:normal; vertical-align:baseline; background-color:transparent; color:windowtext; text-align:left; margin-left:0px; margin-right:0px; padding-left:0px; padding-right:0px; text-indent:0px">
<span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">+1-</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">651</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">-</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">605</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">-</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">8864</span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">  </span></span><span class="TextRun SCXW111908216 BCX2" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">nradclif</span></span><a rel="noreferrer" target="_blank" href="mailto:email@cray.com" class="Hyperlink SCXW111908216 BCX2" style="text-decoration:none; color:inherit" id="LPNoLP"><span class="TextRun Underlined SCXW111908216 BCX2" style="color:rgb(153,140,135); text-decoration:underline; font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">@cray.com</span></span></a><span class="TextRun SCXW111908216 BCX2" style="color:rgb(38,202,211); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">  </span></span><a title="Ctrl+Click or tap to follow the link" rel="noreferrer" target="_blank" href="http://www.cray.com" class="Hyperlink SCXW111908216 BCX2" style="text-decoration:none; color:inherit" id="LPNoLP"><span class="TextRun Underlined SCXW111908216 BCX2" style="color:rgb(38,202,211); font-weight:bold; text-decoration:underline; font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px" lang="EN-US"><span class="NormalTextRun SCXW111908216 BCX2" style="background-color:inherit">www.cray.com</span></span></a></p>
<p></p>
</div>
<div class="OutlineElement Ltr SCXW111908216 BCX2" style="direction:ltr">
<div class="TableContainer SCXW111908216 BCX2"></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Zhou, Hui <zhouh@anl.gov><br>
<b>Sent:</b> Thursday, June 20, 2019 1:13:43 PM<br>
<b>To:</b> discuss@mpich.org<br>
<b>Cc:</b> Nick Radcliffe<br>
<b>Subject:</b> Re: [mpich-discuss] Incorrect error checking?</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">That’s interesting. It means the `configure` was finding pointers has to 8-bytes aligned but the user code is having pointers that are 4-byte aligned. I suspect the user did not build
 the library on the same machine it runs? I am also curious that which architecture actually are not allowing the 4-byte aligned pointers. Nick, is it possible to trace where the questioned mpi library was configured?
<div class=""><br class="">
<div class="">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="color:rgb(0,0,0); letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
<div dir="auto" class="" style="word-wrap:break-word; line-break:after-white-space">
<div style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
— </div>
<div style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
Hui Zhou</div>
<div style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
T: 630-252-3430</div>
<div style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<br class="">
</div>
<br class="x_Apple-interchange-newline">
</div>
</div>
<br class="x_Apple-interchange-newline">
</div>
<br class="x_Apple-interchange-newline">
</div>
<br class="x_Apple-interchange-newline">
<br class="x_Apple-interchange-newline">
</div>
<div><br class="">
<blockquote type="cite" class="">
<div class="">On Jun 20, 2019, at 1:04 PM, Nick Radcliffe via discuss <<a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div id="x_divtagdefaultwrapper" dir="ltr" class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-size:12pt; font-family:Calibri,Helvetica,sans-serif">
<div class="" style="margin-top:0px; margin-bottom:0px">Ken,<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">The reason I brought this up is that a user's (valid) code was failing due to this parameter check. It's possible to use an address that's not 8 byte aligned to store a pointer to an int, i.e.,</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px">    int *x;</div>
<div class="" style="margin-top:0px; margin-bottom:0px">    int *y;<br class="">
</div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class="">    x = malloc(16);<br class="">
    y = &x[1];</div>
<br class="">
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
<div class="" style="margin-top:0px; margin-bottom:0px">I would generally expect y to be 4 byte aligned in the above case. So sometimes this parameter check will cause a correct program to fail, right?<br class="">
</div>
<div class="" style="margin-top:0px; margin-bottom:0px"><br class="">
</div>
<div id="x_Signature" class="">
<div id="x_divtagdefaultwrapper" dir="ltr" class="" style="font-size:12pt; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br class="">
<div class="x_BCX2 x_Ltr x_SCXW111908216 x_OutlineElement" style="direction:ltr">
<div class="" style="margin:0px; font-weight:normal; font-style:normal; vertical-align:baseline; background-color:transparent; color:windowtext; text-align:left; padding-left:0px; padding-right:0px; text-indent:0px">
<span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(38,202,211); font-weight:bold; font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">Nick
 Radcliffe  </span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">Software
 Engineer</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit"><span class="x_Apple-converted-space"> </span>|
 Cray Inc.</span></span><span class="x_EOP x_SCXW111908216 x_BCX2" style="font-size:11pt; line-height:18px; font-family:Arial,Arial_MSFontService,sans-serif"> </span></div>
</div>
<div class="x_BCX2 x_Ltr x_SCXW111908216 x_OutlineElement" style="direction:ltr">
<div class="" style="margin:0px; font-weight:normal; font-style:normal; vertical-align:baseline; background-color:transparent; color:windowtext; text-align:left; padding-left:0px; padding-right:0px; text-indent:0px">
<span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">2131
 Lindau Ln #1000<span class="x_Apple-converted-space"> </span></span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">|<span class="x_Apple-converted-space"> </span></span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">Bloomington</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">,<span class="x_Apple-converted-space"> </span></span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">MN</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit"><span class="x_Apple-converted-space"> </span></span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">55425</span></span><span class="x_EOP x_SCXW111908216 x_BCX2" style="font-size:11pt; line-height:18px; font-family:Arial,Arial_MSFontService,sans-serif"> </span></div>
</div>
<div class="x_BCX2 x_Ltr x_SCXW111908216 x_OutlineElement" style="direction:ltr">
<div class="" style="margin:0px; font-weight:normal; font-style:normal; vertical-align:baseline; background-color:transparent; color:windowtext; text-align:left; padding-left:0px; padding-right:0px; text-indent:0px">
<span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">+1-</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">651</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">-</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">605</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">-</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">8864</span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">  </span></span><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(153,140,135); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">nradclif</span></span><a rel="noreferrer" target="_blank" href="mailto:email@cray.com" class="x_SCXW111908216 x_BCX2 x_Hyperlink" id="LPNoLP" title="Ctrl+Click or tap to follow the link" style="text-decoration:none; color:inherit"><span class="x_BCX2 x_TextRun x_Underlined x_SCXW111908216" lang="EN-US" style="color:rgb(153,140,135); text-decoration:underline; font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">@cray.com</span></span></a><span class="x_TextRun x_SCXW111908216 x_BCX2" lang="EN-US" style="color:rgb(38,202,211); font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">  </span></span><a title="Ctrl+Click or tap to follow the link" rel="noreferrer" target="_blank" href="http://www.cray.com/" class="x_SCXW111908216 x_BCX2 x_Hyperlink" id="LPNoLP" style="text-decoration:none; color:inherit"><span class="x_BCX2 x_TextRun x_Underlined x_SCXW111908216" lang="EN-US" style="color:rgb(38,202,211); font-weight:bold; text-decoration:underline; font-size:11pt; font-family:Arial,Arial_MSFontService,sans-serif; line-height:18px"><span class="x_SCXW111908216 x_NormalTextRun x_BCX2" style="background-color:inherit">www.cray.com</span></span></a></div>
<p class="" style="margin-top:0px; margin-bottom:0px"></p>
</div>
<div class="x_BCX2 x_Ltr x_SCXW111908216 x_OutlineElement" style="direction:ltr">
<div class="x_TableContainer x_SCXW111908216 x_BCX2"></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; display:inline-block; width:848.671875px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important"></span>
<div id="x_divRplyFwdMsg" dir="ltr" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">From:</b><span class="x_Apple-converted-space"> </span>Raffenetti, Kenneth J. via discuss <<a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a>><br class="">
<b class="">Sent:</b><span class="x_Apple-converted-space"> </span>Wednesday, June 19, 2019 2:44:40 PM<br class="">
<b class="">To:</b><span class="x_Apple-converted-space"> </span><a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a><br class="">
<b class="">Cc:</b><span class="x_Apple-converted-space"> </span>Raffenetti, Kenneth J.<br class="">
<b class="">Subject:</b><span class="x_Apple-converted-space"> </span>Re: [mpich-discuss] Incorrect error checking?</font>
<div class=""> </div>
</div>
<div class="x_BodyFragment" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<font size="2" class=""><span class="" style="font-size:11pt">
<div class="x_PlainText">Upon further thought, it's just trying to catch a common error, and uses<span class="x_Apple-converted-space"> </span><br class="">
alignment to detect it since the type information is lost thru the<span class="x_Apple-converted-space"> </span><br class="">
interface. In testing on x86_64, it doesn't appear that it will catch<span class="x_Apple-converted-space"> </span><br class="">
the intended error.<br class="">
<br class="">
As Thomas pointed out in another reply, there are also some issues with<span class="x_Apple-converted-space"> </span><br class="">
the implementation, though it is correct that we require intptr_t to<span class="x_Apple-converted-space"> </span><br class="">
build MPICH. At the very least, we could patch to use sizeof(void *) vs.<span class="x_Apple-converted-space"> </span><br class="">
sizeof(intptr_t). Or we can still remove the check since the use-case is<span class="x_Apple-converted-space"> </span><br class="">
so narrow. The preprocessor guard also depends on a AC_TRY_RUN that I'd<span class="x_Apple-converted-space"> </span><br class="">
prefer to delete, to be honest.<br class="">
<br class="">
Ken<br class="">
<br class="">
On 6/19/19 9:27 AM, Raffenetti, Kenneth J. via discuss wrote:<br class="">
> Nick,<br class="">
><span class="x_Apple-converted-space"> </span><br class="">
> I agree this check looks like nonsense. IMO, we can just delete it and<br class="">
> the others like it. I will create a PR.<br class="">
><span class="x_Apple-converted-space"> </span><br class="">
> Ken<br class="">
><span class="x_Apple-converted-space"> </span><br class="">
> On 6/18/19 5:25 PM, Nick Radcliffe via discuss wrote:<br class="">
>> I recently noticed that a parameter check in MPII_Win_get_attr looks a<br class="">
>> bit off:<br class="">
>><br class="">
>><br class="">
>>               /* A common user error is to pass the address of a 4-byte<br class="">
>>                * int when the address of a pointer (or an address-sized int)<br class="">
>>                * should have been used.  We can test for this specific<br class="">
>>                * case.  Note that this code assumes sizeof(intptr_t) is<br class="">
>>                * a power of 2. */<br class="">
>>               if ((intptr_t) attribute_val & (sizeof(intptr_t) - 1)) {<br class="">
>>                   MPIR_ERR_SETANDSTMT(mpi_errno, MPI_ERR_ARG, goto<br class="">
>> fn_fail, "**attrnotptr");<br class="">
>>               }<br class="">
>><br class="">
>><br class="">
>> The comment indicates that the check is testing "attribute_val" to see<br class="">
>> if a pointer to int was passed in, rather than a double pointer or<br class="">
>> pointer to an integer that can store an address. But the check seems to<br class="">
>> only be testing for 8 byte alignment (and failing if not aligned). Am I<br class="">
>> missing something here?<br class="">
>><br class="">
>><br class="">
>><br class="">
>> Nick Radcliffe  Software Engineer| Cray Inc.<br class="">
>><br class="">
>> 2131 Lindau Ln #1000 | Bloomington, MN55425<br class="">
>><br class="">
>> +1-651-605-8864  nradclif@<a href="http://cray.com" class="">cray.com</a> <<a href="mailto:email@cray.com" class="">mailto:email@cray.com</a>>  www.cray.com<br class="">
>> <<a href="http://www.cray.com/" class="">http://www.cray.com</a>><br class="">
>><br class="">
>><br class="">
>> _______________________________________________<br class="">
>> discuss mailing list     <a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a><br class="">
>> To manage subscription options or unsubscribe:<br class="">
>><span class="x_Apple-converted-space"> </span><a href="https://lists.mpich.org/mailman/listinfo/discuss" class="">https://lists.mpich.org/mailman/listinfo/discuss</a><br class="">
>><br class="">
> _______________________________________________<br class="">
> discuss mailing list     <a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a><br class="">
> To manage subscription options or unsubscribe:<br class="">
><span class="x_Apple-converted-space"> </span><a href="https://lists.mpich.org/mailman/listinfo/discuss" class="">https://lists.mpich.org/mailman/listinfo/discuss</a><br class="">
><span class="x_Apple-converted-space"> </span><br class="">
_______________________________________________<br class="">
discuss mailing list     <a href="mailto:discuss@mpich.org" class="">discuss@mpich.org</a><br class="">
To manage subscription options or unsubscribe:<br class="">
<a href="https://lists.mpich.org/mailman/listinfo/discuss" class="">https://lists.mpich.org/mailman/listinfo/discuss</a><br class="">
</div>
</span></font></div>
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">discuss
 mailing list     </span><a href="mailto:discuss@mpich.org" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">discuss@mpich.org</a><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">To
 manage subscription options or unsubscribe:</span><br class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="https://lists.mpich.org/mailman/listinfo/discuss" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://lists.mpich.org/mailman/listinfo/discuss</a></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>