[MPIWG Fortran] Type of MPI_Status

Bill Long longb at cray.com
Mon Mar 17 16:13:58 CDT 2014


On Mar 17, 2014, at 3:57 PM, Jeff Squyres (jsquyres) <jsquyres at cisco.com> wrote:

> On Mar 17, 2014, at 4:03 PM, Bill Long <longb at cray.com> wrote:
> 
>>> Yes, but my KIND is the default INTEGER kind -- not the C_INT kind.  Mine is solely for the purpose of making it BIND(C)-able:
>>> 
>>> ! Get the KIND value that will be compatible with C, but also be a              
>>> ! default INTEGER.  That way, all the BIND(C) types below will be               
>>> ! compatible with BIND(C) (because their member(s) will be BIND(C)              
>>> ! compatible).  
>> 
>> Better make sure there is a variable named INTEGER that is type default INTEGER for the statement below to work.  The more common usage is just KIND(0).
> 
> There is not -- this is what Craig told me to do.  :-)
> 
> He initially started with KIND(0), but then got all excited and told me to do KIND(INTEGER).
> 
> Is that incorrect?

Try adding IMPLICIT NONE in the scope and see how well that works out for you.  The argument to KIND is a variable or constant of intrinsic type.  The result is the kind parameter value for that variable or constant.  In your example, the result is the kind parameter value for the variable or named constant INTEGER.  KIND does not take the name of a type as its argument.  (And Fortran does not have reserved words, so INTEGER is a fine variable name.)


> 
>>> integer, parameter :: OMPI_INT_KIND = kind(INTEGER)
>> 
>> This does not appear to accomplish anything (other than irritate Rolf).  If INTEGER(OMPI_INT_KIND) is interoperable, and suitable for a BIND(C) interface, then so is INTEGER.  If you compile with -i8, OMPI_INT_KIND will switch from 4 to 8 (most implementations), but INTEGER would have the same effect. 
> 
> For gfortran upcoming4.9, at least, having this kind seemed to make a difference... I'll have to test again to make sure that is correct.

May need a discussion with Tobias about that.

Cheers,
Bill



> -- 
> Jeff Squyres
> jsquyres at cisco.com
> For corporate legal information go to: http://www.cisco.com/web/about/doing_business/legal/cri/
> 
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran

Bill Long                                                                       longb at cray.com
Fortran Technical Suport  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101





More information about the mpiwg-fortran mailing list