title: How to send a variable of type struct in MPI_Send()?
body: <p>I have coded a program in C using MPI wherein the struct variable is to be sent in a ring fashion to the processes and, based on the value received from that variable, the work for that particular process is assigned.</p>
  
  <p>The problem is I need to know how to to send a struct variable in the <code>MPI_Send()</code> function as it is giving INVALID DATATYPE at the runtime , Consider the following example</p>
  
  <pre><code>struct info{
    int ne, n, u, v, process, min, strip, mincost, b;
  } stat;
  
  MPI_Send(&amp;stat,sizeof(stat),sizeof(struct info),1,2,MPI_COMM_WORLD);
  </code></pre>