MPI_Comm_Create hangs unanswered

I want a multi-user group of no more than 4 machines, MPI_bcast still saves a lot of time on several uni-casts (bearing in mind that the size of my group is small)?

I wrote the following function to create a new communicator taking into account the number of machines and the ranks of these 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 on MPI_Comm_create

Any ideas on what might be wrong or how can I debug the problem? Please note that I have dynamically allocated ngbrs_ranks the size of num_ngbrs.

+4
source share

Source: https://habr.com/ru/post/1530737/


All Articles