First the easy one, consider MPI_Comm_spawn. Currently argv is declared as<div><br></div><div><div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;"><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 13px;"> CHARACTER*(*) COMMAND, ARGV(*) </span></font></span></font></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 16px;"><br></span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica">
<span class="Apple-style-span" style="font-size: small;">But I think we should change it to</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br>
</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"> CHARACTER*(*) COMMAND, ARGV(:) </span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica">
<span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;">so that users don't have to pad an extra string with blanks.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;">But with MPI_Comm_spawn_multiple it becomes a little more complicated because argv becomes a two dimensional array. In reality the array is ragged (each argv list can be of different lengths) so it seems we are back to padding which I find ugly.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;">The alternative would be to create a derived type, say for the sake of argument TYPE(argv):</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"> TYPE argv</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"> character(len=?) :: command ! ? mark means I don't know what should go here for an allocatable</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"> character(len=?) :: argv(:)</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica">
<span class="Apple-style-span" style="font-size: small;"> integer :: error</span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"> END TYPE</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;">Then the user would create an array of argvs</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"> TYPE(argv) :: args(count)</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;">but would then have to allocate the components of the args separately. Since I try to ignore all string manipulation in Fortran, I don't really know of a good way to do this. Any body have a better ideas.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><span class="Apple-style-span" style="font-size: small;">-craig</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Helvetica"><font class="Apple-style-span" size="7"><span class="Apple-style-span" style="font-size: 42px;"><br></span></font></p></div></div>