I think it is too useful to give up.<div><br></div><div>It seems crazy that there would not be OS calls like</div><div><br></div><div>  bool validAddress(void *add);</div><div><br></div><div>  Matt<br><br><div class="gmail_quote">
On Tue, Mar 30, 2010 at 11:55 AM, William Gropp <span dir="ltr"><<a href="mailto:wgropp@illinois.edu">wgropp@illinois.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">As long as you have a flat address space, this trick works.  The problem is (was) for systems with memory segments; in that case, &realarray[-1] might not be valid.<div><br></div><div>
Bill</div><div><div><div></div><div class="h5"><br><div><div>On Mar 30, 2010, at 12:30 PM, Barry Smith wrote:</div><br><blockquote type="cite"><div style="word-wrap:break-word"><div><br></div><div>   What do the PETSc developers think of this? Is it "<span style="font-family:Times">otherwise, the behavior is undefined, <em>even if the pointer is not dereferenced</em>."? </span></div>
<div><font face="Times"><br></font></div><div><font face="Times">   Whenever we work with global indices like  in FormFunctionLocal() we do this. </font></div><div><font face="Times"><br></font></div><div><font face="Times">    Is PETSc wrong to ever do this? Is there any other way to allow users to work with global indices in a simple way? Do we need to strip out all the FormFunctionLocals() from PETSc? Not the end of the world but it provides such a nice simple interface for simple problems it seems a pity to toss it.</font></div>
<div><font face="Times"><br></font></div><div><font face="Times">   Thanks</font></div><div><font face="Times"><br></font></div><div><font face="Times">   Barry</font></div><div><font face="Times"><br></font></div></div></blockquote>
</div><br></div></div><font color="#888888"><div> <span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div>William Gropp</div><div>Deputy Director for Research</div><div>Institute for Advanced Computing Applications and Technologies</div><div>Paul and Cynthia Saylor Professor of Computer Science</div><div>University of Illinois Urbana-Champaign</div>
<div><br></div></div><br></span></div></span><br> </div><br></font></div></div></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div>