[mpich-devel] binding a new MPI type with fortran

Jeff Hammond jhammond at alcf.anl.gov
Fri Mar 29 16:56:05 CDT 2013


> So we went the other way around and changed the type of MPI_Pattern from
> void* to integer and now fortran interfaces are being generated correctly.
>
>
> You are aware, I hope, that (the default) Integers can be 32 bits or 64 bits
> with 64-bit compilers?  As far as I am aware, the Fortran standard does not
> prescribe that default Kind Integers be the same size as pointers.  I don't
> know what the MPI standard says or assumes on this topic.

There's an easy solution to that:
http://mpi-forum.org/docs/mpi-3.0/mpi30-report.pdf :-)

Many MPI routines take unadulterated INTEGER arguments but I know of
no implementation that does safe down-casting to the underlying C
implementation, which inevitably uses C int arguments whenever INTEGER
is prescribe, using 64-bit integers with the Fortran interface is very
dangerous.

Jeff

-- 
Jeff Hammond
Argonne Leadership Computing Facility
University of Chicago Computation Institute
jhammond at alcf.anl.gov / (630) 252-5381
http://www.linkedin.com/in/jeffhammond
https://wiki.alcf.anl.gov/parts/index.php/User:Jhammond


More information about the devel mailing list