Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct point_struct { int x, y; }point;
- int num_item =2;
- int blocklengths[2] = {1,1};
- MPI_Datatype types[2] = {MPI_INT, MPI_INT};
- MPI_Datatype mpi_point_type;
- MPI_Aint offsets[2];
- offsets[0] = offsetof(point, x);
- offsets[1] = offsetof(point, y);
- MPI_Type_create_struct(num_item, blocklengths, offsets, types, &mpi_point_type );
- MPI_Type_commit(&mpi_point_type);
- point p_x[n];
- point *p_x = (struct point_struct*)malloc(n*sizeof(struct point_struct));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement