<div dir="ltr">jeff, in mpi you can put in what you like, the result is always the same: unexpected fiddle-faddle. mp</div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-04 0:23 GMT+01:00 Jeff Hammond <span dir="ltr"><<a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><br><br>On Wed, Jan 3, 2018 at 1:07 AM, Thomas Jahns <<a href="mailto:jahns@dkrz.de" target="_blank">jahns@dkrz.de</a>> wrote:<br>><br>> On 01/02/18 20:52, Jeff Hammond wrote:<br>>><br>>> If a user passes a (base,size) pair that corresponds to a range of addresses that are not allocated and/or mapped, is that a correct MPI program?<br>><br>><br>> Such a thing wouldn't be a valid object pointer in C/C++ or a variable in Fortran, i.e. both languages prohibit this.<br><br></span>Which of the following MPI_Win_create calls are not using a valid object pointer according to ISO C and/or C++?<br><br>char a = '\0';<br><br>int main() {<br>..<br>char * x = malloc(1);<br>MPI_Win_create(x,1000,1,MPI_<wbr>INFO_NULL,MPI_COMM_WORLD,&win)<wbr>;<br>...<br>MPI_Win_create(&a,1000,1,MPI_<wbr>INFO_NULL,MPI_COMM_WORLD,&win)<wbr>;<br>..<br>foo(); // compiler cannot prove this function does not call<br> // mmap(0x10000, 1, PROT_READ|PROT_WRITE, MAP_FIXED|MAP_ANONYMOUS, -1, 4096);<br>..<br>MPI_Win_create(0x10000,1000,1,<wbr>MPI_INFO_NULL,MPI_COMM_WORLD,&<wbr>win);<br>..<span class=""><br>}<br> <br>>> The only text I can find that implies that buffers passed to MPI_Win_create have to be allocated is the following, assuming that one interprets "existing memory" this way.<br>>><br>>> "Each process specifies a window of existing memory that it exposes to RMA accesses by the processes in the group of comm." (MPI 3.1 11.2.1)<br>><br>><br>> Since MPI is a library standard I would still expect all the guarantees of the language standards involved to hold and the above to only be an additional clarification?<br><br></span>It's only a clarification. However, I don't think it's a good idea for the MPI standard to punt this off on ISO C, because not every implementation of MPI is an ISO C language lawyer, and very few users are.<span class=""><br><br>>> The Fortran-specific text is similarly suggestive, but it only says that a user can pass a simply contiguous array, not that such a thing is required.<br>>><br>>> "In Fortran, one can pass the first element of a memory region or a whole array, which must be ‘simply contiguous’"<br>><br>><br>> That's most probably because of the Fortran storage association "feature" which is more about how arrays were passed in pre-Fortran 90 times, i.e. it's legal for a caller C to pass some array element A(i) to a subprogram P accepting an array argument B(*) provided the effective size (that is the indices of B used in P match to valid indices of A).<br><br></span>The widespread use of MPI in the context of non-strict Fortran is a particularly good reason to clarify this ourselves rather than rely on ISO Fortran. As has been discussed many times in the passed, MPI relies on extensions and/or implementation-specific behavior with Fortran through the latest standard. Only with Fortran 2018 will this situation disappear.<span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">Jeff</font></span><span class=""><br><br>> Regards, Thomas<br>> --<br>> Thomas Jahns<br>> HD(CP)^2<br>> Abteilung Anwendungssoftware<br>><br>> Deutsches Klimarechenzentrum GmbH<br>> Bundesstraße 45a • D-20146 Hamburg • Germany<br>><br>> Phone: <a href="tel:+49%2040%20460094151" value="+4940460094151" target="_blank">+49 40 460094-151</a><br>> Fax: <a href="tel:+49%2040%20460094270" value="+4940460094270" target="_blank">+49 40 460094-270</a><br>> Email: Thomas Jahns <<a href="mailto:jahns@dkrz.de" target="_blank">jahns@dkrz.de</a>><br>> URL: <a href="http://www.dkrz.de" target="_blank">www.dkrz.de</a><br>><br>> Geschäftsführer: Prof. Dr. Thomas Ludwig<br>> Sitz der Gesellschaft: Hamburg<br>> Amtsgericht Hamburg HRB 39784<br>><br>><br></span><span class="">> ______________________________<wbr>_________________<br>> mpiwg-rma mailing list<br>> <a href="mailto:mpiwg-rma@lists.mpi-forum.org" target="_blank">mpiwg-rma@lists.mpi-forum.org</a><br>> <a href="https://lists.mpi-forum.org/mailman/listinfo/mpiwg-rma" target="_blank">https://lists.mpi-forum.org/<wbr>mailman/listinfo/mpiwg-rma</a><br><br><br><br><br></span><span class="">--<br>Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a><br></span></div></div>
<br>______________________________<wbr>_________________<br>
mpiwg-rma mailing list<br>
<a href="mailto:mpiwg-rma@lists.mpi-forum.org">mpiwg-rma@lists.mpi-forum.org</a><br>
<a href="https://lists.mpi-forum.org/mailman/listinfo/mpiwg-rma" rel="noreferrer" target="_blank">https://lists.mpi-forum.org/<wbr>mailman/listinfo/mpiwg-rma</a><br></blockquote></div><br></div>