<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">Hello all,
</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><br></span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">There are
some spawn commands in my program. Now I want to specify the nodes of my new
spawned processes. <span style> </span>I am trying to use a
hostfile for this but<span style>  </span>I couldn’t do it successfully.
<span style> </span>New processes are still spawned on next
available nodes. </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">I added my
code and outputs of my console. </span></p>

<p class="MsoNoSpacing"><b style><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">My hostfile: </span></b></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">root@rck00:~&gt;
cat /shared/mpihosts</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">rck03</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">rck04</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">rck05</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">Can somebody
help me? What is the problem? Can this be a bug? <br></span></p><p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><br></span></p>

<p class="MsoNoSpacing"><b><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">Here is
my code and output of my program:</span></b><br></p><p class="MsoNoSpacing">#include
&quot;mpi.h&quot;</p><p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">#include
&lt;stdio.h&gt;</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">#include
&lt;stdlib.h&gt;</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">#define
NUM_SPAWNS 3</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">int main(
int argc, char *argv[] )</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">{</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>int errcodes[NUM_SPAWNS];</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>MPI_Comm parentcomm, intercomm;</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>int len; </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>char name[MPI_MAX_PROCESSOR_NAME];</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>int rank; </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>MPI_Init( &amp;argc, &amp;argv );</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>MPI_Comm_get_parent( &amp;parentcomm );</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> <span style>   </span>MPI_Comm_rank(MPI_COMM_WORLD,&amp;rank);</span></p>

<p class="MsoNoSpacing"><span style="font-size:12pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p><p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>if (parentcomm == MPI_COMM_NULL)</span></p>


<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>{</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>            </span>MPI_Info info; </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>            </span>MPI_Info_create( &amp;info );</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>            </span>MPI_Info_set(info,
&quot;hostfile&quot;, &quot;/shared/mpihosts&quot;);</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>     </span><span style>       </span>MPI_Comm_spawn(
&quot;/shared/spawn/./spawn&quot;, MPI_ARGV_NULL, NUM_SPAWNS, info, 0,
MPI_COMM_WORLD, &amp;intercomm, errcodes );</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>            </span>MPI_Get_processor_name(name,
&amp;len);</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>            </span>printf(&quot;I am parent process %d
on %s.<span style>  </span>\n&quot;, rank,<span style>  </span>name);</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>}</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>else</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>{</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>            </span>MPI_Get_processor_name(name,
&amp;len);</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>            </span>printf(&quot;I am a spawned process
%d on %s.\n&quot;, rank,<span style>  </span>name);</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>}</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>fflush(stdout);</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>MPI_Finalize();</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"><span style>    </span>return 0;</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">}</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"> </span></p>

<p class="MsoNoSpacing"><b style><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">output of my program:</span></b></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">root@rck00:~&gt;
mpirun -np 1 /shared/spawn/./spawn </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">I am
parent process 0 on rck00.<span style>  </span></span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">I am a
spawned process 0 on rck01.</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">I am a
spawned process 1 on rck02.</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">I am a
spawned process 2 on rck03.</span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US">Thanks in
advance, </span></p>

<p class="MsoNoSpacing"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;" lang="EN-US"> </span></p>