title: MPI programs hanging up
body: <p>I installed mpich2 on my Ubuntu 14.04 laptop with the following command:</p>
  
  <pre><code>sudo apt-get install libcr-dev mpich2 mpich2-doc
  </code></pre>
  
  <p>This is the code I'm trying to execute:</p>
  
  <pre><code>#include &lt;mpi.h&gt;
  #include &lt;stdio.h&gt;
  
  int main()
  {
      int myrank, size;
      MPI_Init(NULL, NULL);
      MPI_Comm_rank(MPI_COMM_WORLD, &amp;myrank);
      MPI_Comm_size(MPI_COMM_WORLD, &amp;size);
  
      printf("Hello world! I am %d of %d\n", myrank, size);
  
      MPI_Finalize();
      return 0;
  }
  </code></pre>
  
  <p>Compiling it as <code>mpicc helloworld.c</code> gives no errors. But when I execute the program as: <code>mpirun -np 5 ./a.out</code>  There is no output, the program just keeps executing as if it were in an infinite loop. On pressing Ctrl+C, this is what I get:</p>
  
  <pre><code>$ mpirun -np 5 ./a.out                                                                                                                                                        
  ^C[mpiexec@user] Sending Ctrl-C to processes as requested
  [mpiexec@user] Press Ctrl-C again to force abort
  [mpiexec@user] HYDU_sock_write (./utils/sock/sock.c:291): write error (Bad file descriptor)
  [mpiexec@user] HYD_pmcd_pmiserv_send_signal (./pm/pmiserv/pmiserv_cb.c:170): unable to write data to proxy
  [mpiexec@user] ui_cmd_cb (./pm/pmiserv/pmiserv_pmci.c:79): unable to send signal downstream
  [mpiexec@user] HYDT_dmxu_poll_wait_for_event (./tools/demux/demux_poll.c:77): callback returned error status
  [mpiexec@user] HYD_pmci_wait_for_completion (./pm/pmiserv/pmiserv_pmci.c:197): error waiting for event
  [mpiexec@user] main (./ui/mpich/mpiexec.c:331): process manager error waiting for completion
  </code></pre>
  
  <p>I couldn't get any solution on googling. What is causing this error?</p>