[MPIWG Fortran] [Mpi-comments] MPI_Comm_spawn_multiple: parameter description and Fortran bindings
longb at cray.com
Thu Feb 8 16:07:22 CST 2018
> On Feb 8, 2018, at 3:44 PM, Jeff Squyres (jsquyres) <jsquyres at cisco.com> wrote:
>> And the Fortran binding is
>> MPI_COMM_SPAWN_MULTIPLE(COUNT, ARRAY_OF_COMMANDS, ...)
>> INTEGER COUNT
>> CHARACTER*(*) ARRAY_OF_COMMANDS(*)
Note that the character*(*) syntax is archaic (as of 25+ years ago). The normal way of writing this is character(*).
>> Intuitively, it seems obvious that 'array_of_commands' is an array of 'count' commands.
That is what I would assume. The user would be responsible for declaring the array elements large enough to hold the longest command. (All the elements of the array have the same length).
>> That being said, the standard does not state that, and it is unclear whether 'array_of_commands' should be
>> NULL-terminated (so to speak) or not.
Fortran characters are NOT null terminated.
>> Back to the Fortran binding, the following prototype, which is somehow consistent with 'array_of_argv',
>> could (help to) clear the confusion. The same comments also apply to the Fortran 2008 binding.
>> CHARACTER*(*) ARRAY_OF_COMMANDS(COUNT)
This is also fine, and clearer in terms of the expected minimum size of ARRAY_OF_COMMANDS.
Bill Long longb at cray.com
Principal Engineer, Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9143
Cray Inc./ 2131 Lindau Lane/ Suite 1000/ Bloomington, MN 55425
More information about the mpiwg-fortran