Hello All, <br><br>Can anyone tell me what is wrong with this simple code:<br><br>#define NUM_SPAWNS 4<br>double timer;<br>int i; <br>char str[100]; <br>int main( int argc, char *argv[] )<br>{<br>    MPI_Comm parentcomm, intercomm;<br>
    MPI_Comm comm, scomm;<br>    MPI_Init( &amp;argc, &amp;argv );<br>    MPI_Comm_get_parent( &amp;parentcomm );<br>    int np = NUM_SPAWNS;     <br>    int size; <br>    MPI_Comm_size( MPI_COMM_WORLD , &amp;size );<br>    if (parentcomm == MPI_COMM_NULL)<br>
    {<br>       scomm = MPI_COMM_WORLD; <br>       int errcodes[np];<br>       MPI_Comm_spawn( &quot;/home/test/Desktop/merge/./a.out&quot;, MPI_ARGV_NULL, np, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &amp;intercomm, errcodes );<br>
       MPI_Intercomm_merge( intercomm, 1, &amp;comm );<br>    }<br>    else<br>    {<br>        printf(&quot;I&#39;m the spawned.\n&quot;);<br>    }<br>    MPI_Finalize();<br>    return 0;<br>}<br><br>I called MPI_Intercomm_merge outside of if statement but I got the same error. <br>
Spawn is successfull. I have especially tested it. If I try to merge, i got the following error:<br><br>test@ubuntu:~/Desktop/merge$ mpirun -np 1 ./a.out<br>I&#39;m the spawned.<br>I&#39;m the spawned.<br>I&#39;m the spawned.<br>
I&#39;m the spawned.<br>Fatal error in MPI_Intercomm_merge: Other MPI error, error stack:<br>MPI_Intercomm_merge(288)..........: MPI_Intercomm_merge(comm=0x84000000, high=1, newintracomm=0xbf97ff40) failed<br>MPI_Intercomm_merge(263)..........: <br>
MPIR_Get_contextid(639)...........: <br>MPI_Allreduce(773)................: MPI_Allreduce(sbuf=MPI_IN_PLACE, rbuf=0xbf97fd18, count=64, MPI_INT, MPI_BAND, comm=0x84000002) failed<br>MPIR_Allreduce(289)...............: <br>
MPIC_Sendrecv(161)................: <br>MPIC_Wait(513)....................: <br>MPIDI_CH3I_Progress(150)..........: <br>MPID_nem_mpich2_blocking_recv(948): <br>MPID_nem_tcp_connpoll(1720).......: <br>state_commrdy_handler(1556).......: <br>
MPID_nem_tcp_recv_handler(1446)...: socket closed<br>rank 0 in job 21  ubuntu_38267   caused collective abort of all ranks<br>  exit status of rank 0: killed by signal 9 <br><br><br>Thanks In Advance, <br><br><br>