[MPIWG Fortran] Profiling for MPI_SIZEOF?

Jeff Hammond jeff.science at gmail.com
Thu May 15 16:00:05 CDT 2014

>>> That said, the optimal implementation would be to write all of the specific versions (I’m seeing 10) for a generic named MPI_SIZEOF.  For each specific version, the executed code reduces to
>>>  size = storage_size(x)/8
>>> which the compiler will evaluate at compile time based on the type of x.
>> No, there's 10 * 7 versions, right?  One for each type (10), and then 1 for each rank.
>> The language in the MPI spec explicitly allows you to pass an array as the argument of x (although it does say that it will return the size of the base element -- not the array).
> You are right.  I just looked at one of the example specifics:
>   subroutine MPI_Sizeof_xint8 (x, size, ierror)
>        use,intrinsic :: iso_fortran_env, only: int8
>        integer(int8),dimension(..) :: x
>        INTEGER, intent(out) :: size
>        INTEGER, optional,  intent(out) :: ierror
>        size = storage_size(x)/8
>        if (present(ierror)) ierror = 0
>   end subroutine MPI_Sizeof_xint8
> which is declared assumed-rank, but specific type (which is the interesting thing here).  That’s how I got 10.  To get them all without assumed-rank, you need 10*15 (the Fortran standard allows array ranks  up to 15 now). All the more reason for no intercepting.

I vote for #1.  Does anyone thing that there are linkers that can
handle 10^15 symbols?


Jeff Hammond
jeff.science at gmail.com

More information about the mpiwg-fortran mailing list