title: Sending an int array via MPI_Send
body: <p>I'm new to MPI and i would like to send an <code>int</code> array via <code>MPI_Send</code> to another process. </p>
  
  <pre><code>// Code example
  
        int main(int argc, char ** argv)
        {
         int * array;
         int tag=1;
         int size;
         int rank;
         MPI_Status status;
         MPI_Init (&amp;argc,&amp;argv);
         MPI_Comm_size (MPI_COMM_WORLD,&amp;size);
         MPI_Comm_rank (MPI_COMM_WORLD,&amp;rank);
         if (rank == 0)
         {
           array = malloc (10 * sizeof(int)); // Array of 10 elements
           if (!array) // error checking
           {
            MPI_Abort (MPI_COMM_WORLD,1);
           }
         MPI_Send(&amp;array,10,MPI_INT,1,tag,MPI_COMM_WORLD);
         }
         if (rank == 1)
         {
          MPI_Recv (&amp;array,10,MPI_INT,0,tag,MPI_COMM_WORLD,&amp;status);
          // more code here
         }
        MPI_Finalize();
  // More code here
  </code></pre>
  
  <p>I would like to ask three things.</p>
  
  <ol>
  <li>Is this a SAFE way to send an array to another process-rank?</li>
  <li>Is this a syntax wise correct usage of <code>MPI_Send()</code> and <code>MPI_Recv()</code>?</li>
  <li>Is there a better way to send and receive an array without too much trouble?</li>
  </ol>
  
  <p>Any help is appreciated.</p>