I want to use MPI (MPICH2) on windows. I write this command:
MPI_Barrier(MPI_COMM_WORLD);
And I expect it blocks all Processors until all group members have called it. But it is not happen. I add a schematic of my code:
int a;
if(myrank == RootProc)
a = 4;
MPI_Barrier(MPI_COMM_WORLD);
cout << "My Rank = " << myrank << " a = " << a << endl;
(With 2 processor:) Root processor (0
) acts correctly, but processor with rank 1 doesn t know the a
variable, so it display -858993460
instead of 4
.
Can any one help me?
Regards