<div dir="ltr">I'd rather deprecate MPI_Comm_spawn_multiple than try to wrap my head around this one.<div><div><br></div><div>Jeff<br><br>On Thu, Feb 8, 2018 at 1:44 PM, Jeff Squyres (jsquyres) <<a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a>> wrote:<br>><br>> Forwarding this from the MPI-comments list to the Fortran working group...<br>><br>><br>> Begin forwarded message:<br>><br>> From: Gilles Gouaillardet <<a href="mailto:gilles@rist.or.jp">gilles@rist.or.jp</a>><br>> Subject: [Mpi-comments] MPI_Comm_spawn_multiple: parameter description and Fortran bindings<br>> Date: February 6, 2018 at 3:04:00 AM EST<br>> To: <<a href="mailto:mpi-comments@lists.mpi-forum.org">mpi-comments@lists.mpi-forum.org</a>><br>> Reply-To: Comments on the MPI Standard <<a href="mailto:mpi-comments@lists.mpi-forum.org">mpi-comments@lists.mpi-forum.org</a>><br>><br>> Dear MPI Forum,<br>><br>><br>> The description of the 'array_of_commands` parameter passed to 'MPI_Comm_spawn_multiple()' is not crystal clear IMHO.<br>><br>> The standard simply states<br>><br>>   MPI_COMM_SPAWN_MULTIPLE(count, array_of_commands, ...)<br>>   IN count number of commands (positive integer, significant to MPI<br>>   only at root | see advice to users)<br>>   IN array_of_commands programs to be executed (array of strings,<br>>   significant only at root)<br>><br>>   Advice to users. The argument count is interpreted by MPI only at<br>>   the root, as is<br>>   array_of_argv. Since the leading dimension of array_of_argv is<br>>   count, a non-positive<br>>   value of count at a non-root node could theoretically cause a<br>>   runtime bounds check<br>>   error, even though array_of_argv should be ignored by the<br>>   subroutine. If this happens,<br>>   you should explicitly supply a reasonable value of count on the<br>>   non-root nodes. (End<br>>   of advice to users.)<br>><br>><br>> And the Fortran binding is<br>><br>> MPI_COMM_SPAWN_MULTIPLE(COUNT, ARRAY_OF_COMMANDS, ...)<br>> INTEGER  COUNT<br>> CHARACTER*(*) ARRAY_OF_COMMANDS(*)<br>><br>><br>> Intuitively, it seems obvious that 'array_of_commands' is an array of 'count' commands.<br>><br>> That being said, the standard does not state that, and it is unclear whether 'array_of_commands' should be<br>><br>> NULL-terminated (so to speak) or not.<br>><br>><br>> Back to the Fortran binding, the following prototype, which is somehow consistent with 'array_of_argv',<br>><br>> could (help to) clear the confusion. The same comments also apply to the Fortran 2008 binding.<br>><br>><br>> CHARACTER*(*) ARRAY_OF_COMMANDS(COUNT)<br>><br>><br>><br>> Gilles<br>> _______________________________________________<br>> mpi-comments mailing list<br>> <a href="mailto:mpi-comments@lists.mpi-forum.org">mpi-comments@lists.mpi-forum.org</a><br>> <a href="https://lists.mpi-forum.org/mailman/listinfo/mpi-comments">https://lists.mpi-forum.org/mailman/listinfo/mpi-comments</a><br>><br>><br>><br>> -- <br>> Jeff Squyres<br>> <a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a><br>><br>><br>><br>><br>> _______________________________________________<br>> mpiwg-fortran mailing list<br>> <a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>> <a href="https://lists.mpi-forum.org/mailman/listinfo/mpiwg-fortran">https://lists.mpi-forum.org/mailman/listinfo/mpiwg-fortran</a><br><br><br><br><br>--<br>Jeff Hammond<br><a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/">http://jeffhammond.github.io/</a><br><div class="gmail_extra">
</div></div></div></div>