synchronization problem

Hi all, For the following code I want to stop early completing processes and wait for the others at the point with (world.barrier)(); statement. But the problem is stop- and stop+ do interleave. Am I doing something wrong with the synchronization, or there is something wrong with my code? if (world.rank() == MASTER){ m_mySize = n / world.size() + n % world.size(); w_mySize = n / world.size(); for(int p = 1; p < world.size(); p++){ world.send(p, 1, w_mySize); world.send(p, 2, n); } relMyValues = new possibleClause[w_mySize]; scatter(world, pC, relMyValues, w_mySize, 0); } else{ world.recv(0, 1, w_mySize); relMyValues = new possibleClause[w_mySize]; scatter(world, pC, relMyValues, w_mySize, 0); } for(i = 0; i < w_mySize; i++){ //do something } cout << world.rank() << " stop - " << world.rank() << endl; (world.barrier)(); cout << world.rank() << " stop + " << world.rank() << endl; if (world.rank() == MASTER){ relAllValues = new possibleClause[n - n % world.size()]; gather(world, relMyValues, w_mySize, relAllValues, 0); } else{ world.recv(0, 2, n); gather(world, relMyValues, w_mySize, relAllValues, 0); }

Hi!
On Sun, Mar 28, 2010 at 5:04 PM, alev mutlu
Hi all, For the following code I want to stop early completing processes and wait for the others at the point with (world.barrier)(); statement. But the problem is stop- and stop+ do interleave. Am I doing something wrong with the synchronization, or there is something wrong with my code?
Could you please provide a self-containing example. In the current code snippet is even not obvious which types the variables have. Do you use any boost libraries at all? Is your post boost related? Regards, Ovanes
participants (2)
-
alev mutlu
-
Ovanes Markarian