MPICH 里面发送自定义结构

 headerTable 是一个自定义的结构,发送和接受的时候用MPI_BYTE,并且在发送的时候讲变量转换成(void*)指针就可以用MPI函数发送自定义结构。


MPI_Send ( (void*)lht, sizeof ( headerTable ) * lhtCount, MPI_BYTE, j, 99, MPI_COMM_WORLD);

MPI_Recv ( tHT, sizeof ( headerTable ) * pNodeHT, MPI_BYTE, 0, 99, MPI_COMM_WORLD, &status );

posted @ 2010-03-30 14:27  头发抽筋  阅读(435)  评论(0)    收藏  举报