I have the following structure.
typedef struct
{
int *Ai;
double *Ax;
int nz;
}column;
I want to transfer this structure using MPI
"The wise thing to do is to transform your program to use arrays of structures"
Often that's conceptually also better.
I would like to point out another mechanism: using MPI_Pack and MPI_Unpack. For instance, with the original structure you could pack the first integer, then pack the two arrays. The receiver would unpack the integer and then know how many of the other thingies to unpack.
This is also a good solution if your object is not directly accessible but can only be accessed through an iterator or so.