<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Just to be very clear, I believe that the Open MPI implementation is valid and in conformance to the standard (in this case).<div><br></div><div>Bill</div><div><br><div>
William Gropp<br>Director, Parallel Computing Institute<br>Thomas M. Siebel Chair in Computer Science<br>Chief Scientist, NCSA<br>University of Illinois Urbana-Champaign<br><br><br><br><br>
</div>
<br><div><div>On Jun 30, 2015, at 11:40 PM, Craig Rasmusen <<a href="mailto:rasmus@cas.uoregon.edu">rasmus@cas.uoregon.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">I looked at the Open MPI implementation and it looks like in Fortran we made them pointers to memory initialized in C so that MPI_INTEGER would have the same value across languages.<div><br></div><div>MPI_INTEGER is definitely not a Fortran parameter in the Open MPI implementation,</div><div><br></div><div>-craig</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 19, 2015 at 5:45 AM, William Gropp <span dir="ltr"><<a href="mailto:wgropp@illinois.edu" target="_blank">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">Given the intent of the wording with respect to C, I don’t think the test is valid (in C, the clear intent was that handles could be pointers resolved only at link time).<br>
<br>
Bill<br>
<div class="HOEnZb"><div class="h5"><br>
On Jun 18, 2015, at 10:19 PM, Bill Long <<a href="mailto:longb@cray.com">longb@cray.com</a>> wrote:<br>
<br>
><br>
> On Jun 18, 2015, at 5:52 PM, Junchao Zhang <<a href="mailto:jczhang@mcs.anl.gov">jczhang@mcs.anl.gov</a>> wrote:<br>
><br>
>> In OpenMPI F08, those predefined MPI datatypes are not "parameter variables". Thus OMPI failed to compile an MPICH F08 test, which has<br>
>><br>
>> INTEGER, PARAMETER :: nb=2<br>
>> TYPE(MPI_DATATYPE) :: types(nb)=(/MPI_DOUBLE_PRECISION, MPI_CHAR/)<br>
>><br>
>> Jeff Squyres and I discussed in emails. I don't know whether this is correct according to the MPI spec.<br>
><br>
> Given the wording in the spec, I’m not sure either. BTW, there is no such thing as a “parameter variable”. Something with the parameter attribute is a constant, and hence not a variable. It is true that an initialization expression in a type declaration is required to be a constant expression. If OMPI is declaring these datatypes as variables instead of constants, then there would be a problem compiling the above code using their module.<br>
><br>
> Cheers,<br>
> Bill<br>
><br>
><br>
><br>
>><br>
>><br>
>><br>
>> --Junchao Zhang<br>
>><br>
>> On Thu, Jun 18, 2015 at 12:48 PM, Bill Long <<a href="mailto:longb@cray.com">longb@cray.com</a>> wrote:<br>
>><br>
>> On Jun 18, 2015, at 11:05 AM, Junchao Zhang <<a href="mailto:jczhang@mcs.anl.gov">jczhang@mcs.anl.gov</a>> wrote:<br>
>><br>
>>> Hello, Fortran experts,<br>
>>> I am a little puzzled by MPI-3.1 Chapter 2.5.4,<br>
>><br>
>> Not surprising. The (mis)use of terminology is confusing at best.<br>
>><br>
>>><br>
>>> All named constants, with the exceptions noted below for Fortran, can be used in<br>
>>> initialization expressions or assignments, but not necessarily in array declarations or as<br>
>>> labels in C switch or Fortran select/case statements. This implies named constants<br>
>>> to be link-time but not necessarily compile-time constants.<br>
>><br>
>> In Fortran “named constant” is a defined term. They are declared with the PARAMETER attribute. And can be used in most places where literal constants can be used, including array declarations. They cannot be used as statement labels, though I think the reference to “Fortran select/case statements” intends to talk about case-values, and not labels. Named constants can be used as case-values.<br>
>><br>
>>><br>
>>> Then in F08, should MPI_INTEGER be declared as a parameter variable?<br>
>><br>
>> Yes. That’s what I did in my prototype mpi_f08 modules.<br>
>><br>
>>> If no, then I get an error when compiling this initialization expression with gfortran<br>
>>> type(MPI_Datatype) :: dtype = MPI_INTEGER<br>
>>><br>
>>> Error: Parameter 'mpi_integer' at (1) has not been declared or is a variable, which does not reduce to a constant expression<br>
>>><br>
>>> If yes, then of course I can use MPI_INTEGER in Fortran select/case.<br>
>><br>
>> Right.<br>
>><br>
>>><br>
>>> Another question is what is the meaning of "link-time constants". I could not find in MPI. Does it mean I can use MPI_INTEGER after main before MPI_Init?<br>
>><br>
>> I suspect this is a historical artifact where some special head standing was needed to correctly define MPI_INTEGER based on whether the code was compiled with -i4 or -i8 (or equivalent, depending on the compiler). For the modern case of using the mpi_f08 module, you just compile the mpi_f08 module twice (once with -i4 and once with -i8) and then have the compile command select the right actual module to reference based on how the using program unit is compiled. Generally, values of objects are not set at link time; addresses of objects are set at link time. MPI objects that represent addresses (MPI_BOTTOM ??) are examples. If MPI_INTEGER is accessible, you can reference it. If should not have anything to do with whether MPI_Init has been called.<br>
>><br>
>> Perhaps some of the MPI historians can shed more light on this terminology. I suspect it would be completely moot if we got rid of mpif.h.<br>
>><br>
>> Cheers,<br>
>> Bill<br>
>><br>
>><br>
>>><br>
>>> Thank you!<br>
>>><br>
>>> --Junchao Zhang<br>
>>> _______________________________________________<br>
>>> mpiwg-fortran mailing list<br>
>>> <a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
>>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.mpi-2Dforum.org_mailman_listinfo.cgi_mpiwg-2Dfortran&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=195OD1c98cxYlIPBUDzl00KueizThEKs34a9DvL37eY&m=cvjoq7P3v4rRYL3IGvqgUFxnz0nAhyZ54nBt-mFORHg&s=RVxgAcPGqRAwgdzqWhJT0vPRNodapoHRF7WqcvvdFYA&e=" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
>><br>
>> Bill Long <a href="mailto:longb@cray.com">longb@cray.com</a><br>
>> Fortran Technical Support & voice: <a href="tel:651-605-9024" value="+16516059024">651-605-9024</a><br>
>> Bioinformatics Software Development fax: <a href="tel:651-605-9142" value="+16516059142">651-605-9142</a><br>
>> Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101<br>
>><br>
>><br>
>> _______________________________________________<br>
>> mpiwg-fortran mailing list<br>
>> <a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.mpi-2Dforum.org_mailman_listinfo.cgi_mpiwg-2Dfortran&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=195OD1c98cxYlIPBUDzl00KueizThEKs34a9DvL37eY&m=cvjoq7P3v4rRYL3IGvqgUFxnz0nAhyZ54nBt-mFORHg&s=RVxgAcPGqRAwgdzqWhJT0vPRNodapoHRF7WqcvvdFYA&e=" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
>><br>
>> _______________________________________________<br>
>> mpiwg-fortran mailing list<br>
>> <a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
>> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.mpi-2Dforum.org_mailman_listinfo.cgi_mpiwg-2Dfortran&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=195OD1c98cxYlIPBUDzl00KueizThEKs34a9DvL37eY&m=cvjoq7P3v4rRYL3IGvqgUFxnz0nAhyZ54nBt-mFORHg&s=RVxgAcPGqRAwgdzqWhJT0vPRNodapoHRF7WqcvvdFYA&e=" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
><br>
> Bill Long <a href="mailto:longb@cray.com">longb@cray.com</a><br>
> Fortran Technical Support & voice: <a href="tel:651-605-9024" value="+16516059024">651-605-9024</a><br>
> Bioinformatics Software Development fax: <a href="tel:651-605-9142" value="+16516059142">651-605-9142</a><br>
> Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101<br>
><br>
><br>
> _______________________________________________<br>
> mpiwg-fortran mailing list<br>
> <a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
> <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.mpi-2Dforum.org_mailman_listinfo.cgi_mpiwg-2Dfortran&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=195OD1c98cxYlIPBUDzl00KueizThEKs34a9DvL37eY&m=cvjoq7P3v4rRYL3IGvqgUFxnz0nAhyZ54nBt-mFORHg&s=RVxgAcPGqRAwgdzqWhJT0vPRNodapoHRF7WqcvvdFYA&e=" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
<br>
_______________________________________________<br>
mpiwg-fortran mailing list<br>
<a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.mpi-2Dforum.org_mailman_listinfo.cgi_mpiwg-2Dfortran&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=195OD1c98cxYlIPBUDzl00KueizThEKs34a9DvL37eY&m=cvjoq7P3v4rRYL3IGvqgUFxnz0nAhyZ54nBt-mFORHg&s=RVxgAcPGqRAwgdzqWhJT0vPRNodapoHRF7WqcvvdFYA&e=" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
</div></div></blockquote></div><br></div>
_______________________________________________<br>mpiwg-fortran mailing list<br><a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</blockquote></div><br></div></body></html>