MPI_Allgather and dynamic struct

半世苍凉 提交于 2019-12-23 05:18:28

问题


I want to send a array of structure with the MPI_Allgather() but my structure has a dynamic array:

typedef struct {
    float a;
    int* b;
} structure_t;

My structure is initialised the following way:

 structure_t *resultat = (structure_t*) malloc( sizeof( structure_t ) + n * sizeof( int ) );

But how can I send my structure with MPI_Allgather? How can I create the two (send and receive) arrays?

来源:https://stackoverflow.com/questions/9866096/mpi-allgather-and-dynamic-struct

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!