MPI_Comm_Create hanging without response

ぐ巨炮叔叔 提交于 2019-12-10 13:59:44

问题


I wish to multi-cast to a group of no more than 4 machines, does MPI_bcast still save a lot of time over multiple uni-casts (bearing in mind that my group size is small)?

I have written the following function to create a new communicator given the number of machines and ranks of those machines.

void createCommunicator(MPI_Comm *NGBRS_WORLD, int num_ngbrs, int *ngbrs_ranks)
{
        MPI_Group NGBRS_GROUP, MPI_COMM_GROUP;

        int ret = MPI_Comm_group(MPI_COMM_WORLD, &MPI_COMM_GROUP);
        printf("RETURNED %d\n", ret);

        ret = MPI_Group_incl(MPI_COMM_GROUP, num_ngbrs, ngbrs_ranks, &NGBRS_GROUP);
        printf("RETURNED %d\n", ret);

        ret = MPI_Comm_create(MPI_COMM_WORLD, NGBRS_GROUP, NGBRS_WORLD);
        printf("RETURNED : %d\n", ret);
}

When I call this function, the output is:

RETURNED 0
RETURNED 0

and the program just hangs at MPI_Comm_create

Any ideas for what might be wrong or how I might debug the problem? Note that I have dynamically allocated ngbrs_ranks to be of size num_ngbrs.

来源:https://stackoverflow.com/questions/22269077/mpi-comm-create-hanging-without-response

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