[MPIWG Fortran] Profiling for MPI_SIZEOF?

Bill Long longb at cray.com
Thu May 15 16:28:31 CDT 2014


On May 15, 2014, at 4:00 PM, Jeff Hammond <jeff.science at gmail.com> wrote:

>>>> 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?

It’s actually 160 =  (10 * (1 + 15) ) where the 1 is for scalar, and the 15 for ranks 1..15.  Still, an annoying number.  If there is compiler support for assumed-rank, the total is 10, since the function result is independent of rank.

Cheers,
Bill



> 
> Jeff
> 
> 
> 
> -- 
> Jeff Hammond
> jeff.science at gmail.com
> http://jeffhammond.github.io/
> _______________________________________________
> 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