Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. struct st_Data
  2. {
  3. int nWRank;
  4. int nSRank;
  5. char cName[160];
  6. int nData;
  7. };
  8.  
  9. MPI_Aint offsets[] = {(MPI_Aint)offsetof(struct st_Data, nWRank), (MPI_Aint)offsetof(struct st_Data, nSRank), (MPI_Aint)offsetof(struct st_Data, cName), (MPI_Aint)offsetof(struct st_Data, nData)};
  10. MPI_Datatype types[] = {MPI_INT, MPI_INT, MPI_CHAR, MPI_INT};
  11. int blockcounts[] = {1, 1, 160, 1};
  12. MPI_Datatype myMPI_Data;
  13. MPI_Type_struct(4, blockcounts, offsets, types, &myMPI_Data);
  14. MPI_Type_commit(&myMPI_Data);
  15.  
  16. struct st_Data
  17. {
  18. int nWRank;
  19. int nSRank;
  20. char cName[160];
  21. int *nData;
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement