<div dir="ltr">My point is, with the C_INT implementation of MPI_Status, there should be no compilation warnings AND runtime errors, even if INTEGER kind is not c_int, since users can only operate MPI_Status through their public interfaces, in which we take care of data conversion.<div>
<br></div><div>But for other arguments of type INTEGER or array of INTEGERs, I can not change their type. Users pass in an array of INTEGERs, I can not pretend they are c_int and don't do conversion. </div></div><div class="gmail_extra">
<br clear="all"><div><div dir="ltr">--Junchao Zhang</div></div>
<br><br><div class="gmail_quote">On Sat, Mar 15, 2014 at 3:33 AM, Rolf Rabenseifner <span dir="ltr"><<a href="mailto:rabenseifner@hlrs.de" target="_blank">rabenseifner@hlrs.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Junchao,<br>
<br>
With the erratum ticket #415, your implementation<br>
with INTEGER(C_INT) is clearly wrong,<br>
but who cares as long as an application programmer cannot<br>
write an application code that produces compilation errors<br>
or warnings or infos due to your wrong implementation<br>
of TYPE(MPI_Status).<br>
<br>
I do not exactly now the rules about Fortran subroutine<br>
prototype and overloading where handing over a INTEGER rank<br>
or a INTEGER(C_INT) rank may cause to choose different interfaces.<br>
<br>
Maybe that Bill Long should comment on such strange things<br>
before you define any field within TYPE(MPI_Status) or<br>
any dummy argument in a routine declaration as INTEGER(C_INT)<br>
instead of INTEGER as defined in MPI-3.0.<br>
<div class="im HOEnZb"><br>
Best regards<br>
Rolf<br>
<br>
----- Original Message -----<br>
> From: "Junchao Zhang" <<a href="mailto:jczhang@mcs.anl.gov">jczhang@mcs.anl.gov</a>><br>
> To: "MPI-WG Fortran working group" <a href="http://mpi-forum.org" target="_blank">mpi-forum.org</a>><br>
</div><div class="HOEnZb"><div class="h5">> Sent: Saturday, March 15, 2014 12:11:35 AM<br>
> Subject: Re: [MPIWG Fortran] Type of MPI_Status<br>
><br>
><br>
><br>
> Not sure if it is worth discussing. Even if INTEGER and C_INT are of<br>
> different size, I think I can still use C_INT in MPI_Status.<br>
><br>
><br>
><br>
> TYPE, BIND(C) :: MPI_Status<br>
> INTEGER(C_INT) :: MPI_SOURCE, MPI_TAG, MPI_ERROR<br>
> ... ! other fields<br>
> END TYPE MPI_Status<br>
><br>
><br>
> Since MPI_Status is a derived datatype, users access it through its<br>
> public interfaces(i.e., %MPI_SOURCE, ..., MPI_STATUS_SIZE).<br>
> As long as MPI_STATUS_SIZE >= sizeof(MPI_STATUS)/sizeof(INTEGER), who<br>
> cares its internals.<br>
><br>
><br>
><br>
><br>
><br>
> --Junchao Zhang<br>
><br>
><br>
> On Thu, Mar 13, 2014 at 10:56 AM, Rolf Rabenseifner <<br>
> <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a> > wrote:<br>
><br>
><br>
> Jeff is right.<br>
> Bill's theoretical statement is also correct.<br>
><br>
> And ticket#415 is also correct because it resolves an inconsistency<br>
> within the mpi_f08 interface.<br>
><br>
> Strange theoretical discussions are also there for<br>
> long Fortran INTEGER may not be identical with some shorter<br>
> INTEGER(C_int).<br>
> As a side effect also solved by this ticket.<br>
><br>
><br>
> Rolf<br>
><br>
> ----- Original Message -----<br>
><br>
> > From: "Jeff Hammond" < <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a> ><br>
> > To: "MPI-WG Fortran working group" <a href="http://mpi-forum.org" target="_blank">mpi-forum.org</a> ><br>
> > Sent: Thursday, March 13, 2014 4:12:56 PM<br>
> > Subject: Re: [MPIWG Fortran] Type of MPI_Status<br>
> ><br>
> > MPI should test for interoperability of Fortran's default integer<br>
> > and<br>
> > light the machine room on fire if it is not.<br>
> ><br>
> > Jeff<br>
> ><br>
> > On Thu, Mar 13, 2014 at 8:58 AM, Bill Long < <a href="mailto:longb@cray.com">longb@cray.com</a> ><br>
> > wrote:<br>
> > > This does raise an earlier issue that it is<br>
><br>
><br>
> > > possible that Fortran’s default INTEGER is not an interoperable<br>
> > > type, and thus the MPI_Status type should not be a BIND(C) type<br>
> > > if<br>
> > > it has INTEGER components. Having BIND(C) does allow you to<br>
> > > declare a C global name MPI_STATUS_IGNORE in Fortran, which<br>
> > > solves<br>
> > > one problem nicely. I don’t see any advantage to having INTEGER<br>
> > > components (as opposed to INTEGER(C_Int), for example). So this<br>
> > > seems to represent the worse of the two options.<br>
> > ><br>
> > > Cheers,<br>
> > > Bill<br>
> > ><br>
> > ><br>
> > ><br>
> > > On Mar 13, 2014, at 8:36 AM, Jeff Squyres (jsquyres)<br>
> > > < <a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a> > wrote:<br>
> > ><br>
> > >> Done. Good catch:<br>
> > >><br>
> > >> <a href="https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/415" target="_blank">https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/415</a><br>
> > >><br>
> > >> This is a trivial ticket, but if you could make sure it's ok,<br>
> > >> I'll<br>
> > >> send it to the mpi-forum list so that it can get added to the<br>
> > >> next meeting's agenda.<br>
> > >><br>
> > >><br>
> > >> On Mar 13, 2014, at 1:51 AM, Rolf Rabenseifner<br>
> > >> < <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a> > wrote:<br>
> > >><br>
> > >>> Jeff and Junchao,<br>
> > >>><br>
> > >>> it is a missing word INTEGER in this part of the sentence<br>
> > >>><br>
> > >>> In whole MPI these three values are in Fortran INTEGER and<br>
> > >>> nothing else<br>
> > >>><br>
> > >>> Junchao, thank you for the hint that an erratum is neede<br>
> > >>> to prevent from such misinterpretation<br>
> > >>><br>
> > >>> Jeff, please can you file the errata ticket resulting in<br>
> > >>><br>
> > >>> ... containing three public INTEGER fields named ...<br>
> > >>><br>
> > >>> Best regards<br>
> > >>> Rolf<br>
> > >>><br>
> > >>><br>
> > >>> ----- Original Message -----<br>
> > >>>> From: "Junchao Zhang" < <a href="mailto:jczhang@mcs.anl.gov">jczhang@mcs.anl.gov</a> ><br>
> > >>>> To: "MPI-WG Fortran working group"<br>
><br>
><br>
> > >>>> <a href="http://mpi-forum.org" target="_blank">mpi-forum.org</a> ><br>
> > >>>> Sent: Thursday, March 13, 2014 4:49:49 AM<br>
> > >>>> Subject: [MPIWG Fortran] Type of MPI_Status<br>
> > >>>><br>
> > >>>><br>
> > >>>><br>
> > >>>><br>
> > >>>> Hello,<br>
> > >>>><br>
> > >>>><br>
> > >>>> p30 of MPI3 says "In Fortran with USE mpi or INCLUDE ’mpif.h’,<br>
> > >>>> status<br>
> > >>>> is an array of INTEGERs of size MPI_STATUS_SIZE. ..., With<br>
> > >>>> Fortran<br>
> > >>>> USE mpi_f08, status is defined as the Fortran BIND(C) derived<br>
> > >>>> type<br>
> > >>>> TYPE(MPI_Status) containing three public fields named<br>
> > >>>> MPI_SOURCE<br>
> > >>>> ,<br>
> > >>>> MPI_TAG , and MPI_ERROR"<br>
> > >>>><br>
> > >>>> In other words, it does't say type of the three public fields<br>
> > >>>> must be<br>
> > >>>> INTEGER. So, in mpi_f08, can I declare MPI_Status as<br>
> > >>>><br>
> > >>>><br>
> > >>>> TYPE, BIND(C) :: MPI_Status<br>
> > >>>> INTEGER(C_INT) :: MPI_SOURCE, MPI_TAG, MPI_ERROR<br>
> > >>>> ... ! other fields<br>
> > >>>> END TYPE MPI_Status<br>
> > >>>><br>
> > >>>><br>
> > >>>> I find it makes MPI_Status binding easier. Since this type is<br>
> > >>>> interoperable with C, I do not need to allocate temp variables<br>
> > >>>> to do<br>
> > >>>> type conversion when INTEGER is not a C_INT.<br>
> > >>>><br>
> > >>>><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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
> > >>><br>
> > >>> --<br>
> > >>> Dr. Rolf Rabenseifner . . . . . . . . . .. email<br>
> > >>> <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a><br>
> > >>> High Performance Computing Center (HLRS) . phone<br>
> > >>> <a href="tel:%2B%2B49%280%29711%2F685-65530" value="+4971168565530">++49(0)711/685-65530</a><br>
> > >>> University of Stuttgart . . . . . . . . .. fax ++49(0)711 /<br>
> > >>> 685-65832<br>
> > >>> Head of Dpmt Parallel Computing . . .<br>
> > >>> <a href="http://www.hlrs.de/people/rabenseifner" target="_blank">www.hlrs.de/people/rabenseifner</a><br>
> > >>> Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room<br>
> > >>> 1.307)<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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
> > >><br>
> > >><br>
> > >> --<br>
> > >> Jeff Squyres<br>
> > >> <a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a><br>
> > >> For corporate legal information go to:<br>
> > >> <a href="http://www.cisco.com/web/about/doing_business/legal/cri/" target="_blank">http://www.cisco.com/web/about/doing_business/legal/cri/</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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
> > ><br>
> > > Bill Long<br>
> > > <a href="mailto:longb@cray.com">longb@cray.com</a><br>
> > > Fortran Technical Suport & voice:<br>
> > > <a href="tel:651-605-9024" value="+16516059024">651-605-9024</a><br>
> > > Bioinformatics Software Development fax:<br>
> > > <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<br>
> > > 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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Jeff Hammond<br>
> > <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
><br>
> --<br>
> Dr. Rolf Rabenseifner . . . . . . . . . .. email <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a><br>
> High Performance Computing Center (HLRS) . phone <a href="tel:%2B%2B49%280%29711%2F685-65530" value="+4971168565530">++49(0)711/685-65530</a><br>
> University of Stuttgart . . . . . . . . .. fax <a href="tel:%2B%2B49%280%29711%20%2F%20685-65832" value="+4971168565832">++49(0)711 / 685-65832</a><br>
> Head of Dpmt Parallel Computing . . . <a href="http://www.hlrs.de/people/rabenseifner" target="_blank">www.hlrs.de/people/rabenseifner</a><br>
> Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307)<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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" 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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
<br>
--<br>
Dr. Rolf Rabenseifner . . . . . . . . . .. email <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a><br>
High Performance Computing Center (HLRS) . phone <a href="tel:%2B%2B49%280%29711%2F685-65530" value="+4971168565530">++49(0)711/685-65530</a><br>
University of Stuttgart . . . . . . . . .. fax <a href="tel:%2B%2B49%280%29711%20%2F%20685-65832" value="+4971168565832">++49(0)711 / 685-65832</a><br>
Head of Dpmt Parallel Computing . . . <a href="http://www.hlrs.de/people/rabenseifner" target="_blank">www.hlrs.de/people/rabenseifner</a><br>
Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307)<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="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a></div></div></blockquote></div><br></div>