On 14/07/15 09:04, Sebastian Huber wrote:
#include <assert.h>

static inline struct gomp_team *
get_last_team (unsigned nthreads)
{
  struct gomp_thread *thr = gomp_thread ();
  if (thr->ts.team == NULL)
    {
      struct gomp_thread_pool *pool = thr->thread_pool;
      if (pool != NULL)
    {
      struct gomp_team *last_team = pool->last_team;
      if (last_team != NULL && last_team->nthreads == nthreads)
        {
          pool->last_team = NULL;
          assert (last_team->barrier.total == nthreads);
          assert (last_team->barrier.awaited == nthreads);
          assert (last_team->barrier.awaited_final == nthreads);
          assert (last_team->barrier.generation % BAR_INCR != 0);

Sorry, this should be:

assert (last_team->barrier.generation % BAR_INCR == 0);

I pasted the wrong version, since I wanted to check that I get a failure in case generation % BAR_INCR != 0.

          return last_team;
        }
    }
    }
  return NULL;
}

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

Reply via email to