[MPIWG Fortran] Questions about MPI_Comm_spawn

Bill Long longb at cray.com
Tue Mar 25 10:17:04 CDT 2014


On Mar 25, 2014, at 10:13 AM, Junchao Zhang <jczhang at mcs.anl.gov> wrote:

> How to get the length? Use len(argv(i)) and select an arbitrary i ? 

len(argv) will do.  If the argument of LEN is an array, the result is the length of one element of the array.

Cheers,
Bill


> 
> --Junchao Zhang
> 
> 
> On Tue, Mar 25, 2014 at 9:59 AM, Bill Long <longb at cray.com> wrote:
> 
> On Mar 25, 2014, at 9:51 AM, Junchao Zhang <jczhang at mcs.anl.gov> wrote:
> 
> > Hello, Fortran experts,
> >
> >   p.377 of MPI3 defines prototype of MPI_Comm_spawn.
> >
> >   MPI_Comm_spawn(command, argv, maxprocs, info, root, comm, intercomm, array_of_errcodes, ierror)
> >      CHARACTER(LEN=*), INTENT(IN) ::  command, argv(*)
> >      ...
> >
> > I can understand that command is a variable-length character. I fetch its length by len(command). The Fortran compiler needs to pass in data of command, as well as length of command.
> > But I can't understand argv(*). I interpret it as an assumed-size array of variable-length characters. Does that imply each argv(i) could have different lengths, e.g., len(argv(1)) may be different from len(argv(2))?
> > I think it is unreasonable, since if that, the compiler has to pass in length of every element of argv(*).
> 
> 
> It is unreasonable.  All elements of a character array have the same length.
> 
> Cheers,
> Bill
> 
> 
> >
> > Thank you
> > --Junchao Zhang
> > _______________________________________________
> > 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
> 
> 
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
> 
> _______________________________________________
> 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