[MPI3 Fortran] MPI_INIT issues

Bill Long longb at cray.com
Wed Feb 20 13:56:27 CST 2013


Nick typically has access to crappier implementations than I, so I'll 
defer to his unfortunate experience.

In terms of the interface, I think I would prefer just making MPI_Init 
effectively generic, with the allow calls:

   integer :: ierror
   character(:),allocatable :: args(:)


   call MPI_Init( )            ! Existing form
   call MPI_Init (ierror)  ! Existing form including optional status

   call MPI_Init (args)    ! New form

   call MPI_Init (args,ierror)  ! New form with the optional status 
argument.

Both arguments are INTENT(OUT). The array arg is allocated inside 
MPI_Init with a length parameter equal to the maximum length of the 
arguments or the command.  The bounds are 0:nargs.  On return arg(0) 
would be the command text, and arg(i:ubound(arg),1)) would be the 
arguments.  The number of arguments is size(arg)-1.  [Redundantly, the 
number of arguments could be returned as another argument.]

Just my gut feeling that this would be more intuitive to the MPI users.

I'm less keen on the versions in the ticket because:

1) They look too much like wrappers to the Fortran intrinsics, prompting 
the obvious question of why not just call the intrinsics directly, and

2) The caller needs to determine either the maximum command/argument 
length somehow, or settle for an upper bound on the length, since the 
length of the character variable has to be known in the caller.


Cheers,
Bill



On 2/20/13 12:17 PM, N.M. Maclaren wrote:
> On Feb 20 2013, Bill Long wrote:
>>
>> I would expect the same output whether the parallelism was native or
>> MPI.  So, it seems like it might be a solution in search of a problem.
>
> I wouldn't.  I have used a couple of MPIs where the arguments got through
> to only the local (to mpiexec) or first process; I can't remember if I
> ever experimented where there was no local MPI process and such MPIs.
> On at least one, they didn't get through at all.
>
> If I can guess the issue, the usual solution is (in any language) to
> read the command arguments (or unpick environment variables) on process
> zero and broadcast them.  If that doesn't get them, at least all
> processes get the same ones and some other kludge can be tried.  That's
> really all that is needed.
>
>
> Regards,
> Nick Maclaren.
>
>
>
> _______________________________________________
> mpi3-fortran mailing list
> mpi3-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran

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