Community
Participate
Working Groups
Running the barrier synchronization on the following code shows no errors: #include <mpi.h> void test() { int i; int rank, size; int a = 0, b = 0; MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); for (i = 0; i < size; ++i) { if (i == rank) { if (a > 0 || b > 0) { printf("hi\n"); } } MPI_Barrier(MPI_COMM_WORLD); } } However, running the barrier synchronization on the same code with the MPI_Comm_size and MPI_Comm_rank statements swapped results in an incorrect error indication "Loop (dynamic number of barriers)" at the for loop. i.e. MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size);
This is a very old bug. Are there any plans to fix this? If not, then it should be closed.