Bug 226839 - Barrier synchronization incorrectly indicates error
Summary: Barrier synchronization incorrectly indicates error
Status: CLOSED WONTFIX
Alias: None
Product: PTP
Classification: Tools
Component: PLDT (show other bugs)
Version: 2.0   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Beth Tibbitts CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-04-13 12:00 EDT by Greg Watson CLA
Modified: 2016-06-02 09:46 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Greg Watson CLA 2008-04-13 12:00:24 EDT
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);
Comment 1 Greg Watson CLA 2014-05-29 16:45:09 EDT
This is a very old bug. Are there any plans to fix this? If not, then it should be closed.