<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Forwarding this from the MPI-comments list to the Fortran working group...
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">Begin forwarded message:</div>
<br class="Apple-interchange-newline">
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Gilles Gouaillardet <<a href="mailto:gilles@rist.or.jp" class="">gilles@rist.or.jp</a>><br class="">
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">[Mpi-comments] MPI_Comm_spawn_multiple: parameter description and Fortran bindings</b><br class="">
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">February 6, 2018 at 3:04:00 AM EST<br class="">
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><<a href="mailto:mpi-comments@lists.mpi-forum.org" class="">mpi-comments@lists.mpi-forum.org</a>><br class="">
</span></div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class="">
<span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Reply-To:
</b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Comments on the MPI Standard <<a href="mailto:mpi-comments@lists.mpi-forum.org" class="">mpi-comments@lists.mpi-forum.org</a>><br class="">
</span></div>
<br class="">
<div class="">
<div class="">Dear MPI Forum,<br class="">
<br class="">
<br class="">
The description of the 'array_of_commands` parameter passed to 'MPI_Comm_spawn_multiple()' is not crystal clear IMHO.<br class="">
<br class="">
The standard simply states<br class="">
<br class="">
  MPI_COMM_SPAWN_MULTIPLE(count, array_of_commands, ...)<br class="">
  IN count number of commands (positive integer, significant to MPI<br class="">
  only at root | see advice to users)<br class="">
  IN array_of_commands programs to be executed (array of strings,<br class="">
  significant only at root)<br class="">
<br class="">
  Advice to users. The argument count is interpreted by MPI only at<br class="">
  the root, as is<br class="">
  array_of_argv. Since the leading dimension of array_of_argv is<br class="">
  count, a non-positive<br class="">
  value of count at a non-root node could theoretically cause a<br class="">
  runtime bounds check<br class="">
  error, even though array_of_argv should be ignored by the<br class="">
  subroutine. If this happens,<br class="">
  you should explicitly supply a reasonable value of count on the<br class="">
  non-root nodes. (End<br class="">
  of advice to users.)<br class="">
<br class="">
<br class="">
And the Fortran binding is<br class="">
<br class="">
MPI_COMM_SPAWN_MULTIPLE(COUNT, ARRAY_OF_COMMANDS, ...)<br class="">
INTEGER  COUNT<br class="">
CHARACTER*(*) ARRAY_OF_COMMANDS(*)<br class="">
<br class="">
<br class="">
Intuitively, it seems obvious that 'array_of_commands' is an array of 'count' commands.<br class="">
<br class="">
That being said, the standard does not state that, and it is unclear whether 'array_of_commands' should be<br class="">
<br class="">
NULL-terminated (so to speak) or not.<br class="">
<br class="">
<br class="">
Back to the Fortran binding, the following prototype, which is somehow consistent with 'array_of_argv',<br class="">
<br class="">
could (help to) clear the confusion. The same comments also apply to the Fortran 2008 binding.<br class="">
<br class="">
<br class="">
CHARACTER*(*) ARRAY_OF_COMMANDS(COUNT)<br class="">
<br class="">
<br class="">
<br class="">
Gilles<br class="">
_______________________________________________<br class="">
mpi-comments mailing list<br class="">
<a href="mailto:mpi-comments@lists.mpi-forum.org" class="">mpi-comments@lists.mpi-forum.org</a><br class="">
https://lists.mpi-forum.org/mailman/listinfo/mpi-comments<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
<div class="">
<div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<br class="Apple-interchange-newline">
-- </div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
Jeff Squyres</div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<a href="mailto:jsquyres@cisco.com" class="">jsquyres@cisco.com</a></div>
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
</div>
</div>
</div>
<br class="Apple-interchange-newline">
</div>
<br class="">
</div>
</body>
</html>