programs that contain more than one MPI_Barrier. This should fix the problem
for most systems, though maybe this function should do something like SMPI_DO_ONCE and
maintain a separate counter for each invocation...
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5097
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
{
SIMIX_mutex_lock(comm->barrier_mutex);
- if (++comm->barrier_count >= comm->size) {
+ ++comm->barrier_count;
+ if (comm->barrier_count > comm->size) { // only happens on second barrier...
+ comm->barrier_count = 0;
+ } else if (comm->barrier_count == comm->size) {
SIMIX_cond_broadcast(comm->barrier_cond);
}
while (comm->barrier_count < comm->size) {