On 14/07/15 09:19, Jakub Jelinek wrote:
On Tue, Jul 14, 2015 at 09:09:01AM +0200, Sebastian Huber wrote:
I pasted the wrong version, since I wanted to check that I get a failure in
case generation % BAR_INCR != 0.
There is also config/posix/bar* implementation, which would need to be
checked too.  I'd suggest first committing a patch with both sem and mutex
being destroyed (note, config/posix/bar* has two semaphores in it), and
perhaps if you feel strongly about it an incremental patch to avoid the
destroying/initialization of the barrier if it works even with
config/posix/bar*.

        Jakub

If I destroy the barrier of the last team, and then initialize it later in gomp_new_team()

+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;
+             gomp_barrier_destroy (&last_team->barrier);
+             return last_team;
+           }
+       }
+    }
+  return NULL;
+}

then I get test suite failures. Is it safe to destroy the team barrier here or do we circumvent the last team mechanism which is supposed to delay the destruction?

Example failure:

WARNING: program timed out.
FAIL: libgomp.c/appendix-a/a.15.1.c execution test

--
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