[MPIWG Fortran] F08 and pair types?

Bill Long longb at cray.com
Wed Dec 9 13:31:40 CST 2015


On Dec 9, 2015, at 7:45 AM, Jeff Squyres (jsquyres) <jsquyres at cisco.com> wrote:

>> 
>> But, the following would likely not be equivalent:
>> 
>> DOUBLE PRECISION :: IN(2, K)
>> 
>> and
>> 
>> TYPE MPI_DOUBLE_INT_TYPE
>>  SEQUENCE
>>  DOUBLE PRECISION :: VAL
>>  INTEGER :: LOC
>> END TYPE
>> 
>> TYPE(MPI_DOUBLE_INT_TYPE) :: IN(K)
> 
> Right -- I'm not trying to make those equivalent.
> 
> To be clear:
> 
> - the only one where we need this equivalence MPI_2INTEGER.
> - the intent is to deprecate MPI_2DOUBLE_PRECISION and MPI_2REAL
>  --> I assume that these are historical artifacts that were created before derived types existed
> - and then create 2 new types: MPI_DOUBLE_PRECISION_INTEGER and MPI_REAL_INTEGER
>  --> these will be analogous to their C counterparts (but using Fortran types, not C types)


There would be compatibility ramifications.  For the legacy Fortran interfaces, the called MPI_REDUCE function would be interpreting the memory incorrectly for the DOUBLE case for sure, and maybe the REAL case as well, since it is currently expecting the “LOC” values to be coming in as floating point values.  The DOUBLE case has the added problem of memory alignment differences.  Perhaps the new types should be permitted ONLY for the F08 interface. 

For the F08 interfaces, the arguments are coming in as TYPE(*),DIMENSION(..).   The assumed-rank argument is currently rank 2, with 2*K total elements.  The new incoming argument will be rank 1, with K elements, each of which is larger than with the old version.   The MPI_REDUCE code could be modified in this case, based on the type, element_size, and rank parts of the descriptor, to figure out whether the in/out arguments are the new or old convention and branch to code that does the right thing.  But it is still the case that this will cause recoding work in the MPI library routines.   

Cheers,
Bill




Bill Long                                                                       longb at cray.com
Fortran Technical Support  &                                  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