title: Error with C++ MPI program which use MPI_Send & MPI_Recv
body: <p>I am new with <code>MPI</code> and trying to write test program where I use <code>MPI_Send</code> and <code>MPI_Recv</code> to pass two numbers <code>"a"</code> and <code>"b"</code> between the root process which is <code>0</code> and the next which is <code>1</code>. But each time I get the same error: "Test.exe has triggered a breakpoint." Can you please help me?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "mpi.h"
  
  using namespace std;
  
  int main(int argc, char** argv) {
  
      int rank, size;
  
      MPI_Init(&amp;argc, &amp;argv);
      MPI_Comm_rank(MPI_COMM_WORLD, &amp;rank);
      MPI_Comm_size(MPI_COMM_WORLD, &amp;size);
  
      unsigned int a;
      unsigned int b;
      MPI_Status status;
  
      if (rank == 0) {
          a = 1;
          MPI_Send(&amp;a,1,MPI_INTEGER,1,MPI_ANY_TAG,MPI_COMM_WORLD);
          MPI_Recv(&amp;b, 1, MPI_INTEGER, 1, MPI_ANY_TAG, MPI_COMM_WORLD, MPI_STATUSES_IGNORE);
          printf("Root has now B: ", rank, b);
      }
      else {
          b = 2;
          MPI_Recv(&amp;a, 1, MPI_INTEGER, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &amp;status);
          MPI_Send(&amp;b, 1, MPI_INTEGER, 0, MPI_ANY_TAG, MPI_COMM_WORLD);
          printf("Proc 1 has now B: ", rank, a);
      }
  
      MPI_Finalize();
      return(0);  
  }
  </code></pre>