This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4.1] fix more scheduling inconsistencies and add verification routines
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 9 Oct 2015 18:47:16 +0200
- Subject: Re: [gomp4.1] fix more scheduling inconsistencies and add verification routines
- Authentication-results: sourceware.org; auth=none
- References: <56116160 dot 70307 at redhat dot com> <5617ED90 dot 9050808 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Oct 09, 2015 at 09:38:40AM -0700, Aldy Hernandez wrote:
> As per our IRC discussion.
>
> I am conditionally compiling the verification code because you mentioned
> that the GPGPUs may not having a working printf.
Both that and code size being important there.
> Also, I removed the code caching the workgroup since it may contain the
> incorrect workgroup as I had suggested. Now instead we look in
> child_task->taskgroup which will have the correct workgroup always.
>
> Tested on x86-64 Linux with make check-target-libgomp for a variety of
> different OMP_NUM_THREADS and with _ENABLE_LIBGOMP_CHECKING_ set to 1.
>
> OK for branch?
Yes, with a small change (just compile test with
-D_ENABLE_LIBGOMP_CHECKING_=1, no need to retest otherwise):
> p.s. As a thought, maybe we can set _ENABLE_LIBGOMP_CHECKING_ to 1 until
> release?
I'd prefer not to, it will affect the timing and slow down already slow
testing of libgomp for everybody.
> --- a/libgomp/task.c
> +++ b/libgomp/task.c
> @@ -27,6 +27,7 @@
> creation and termination. */
>
> #include "libgomp.h"
> +#include <stdio.h>
Please nuke the above.
> + if (task->parent != parent)
> + {
> + fprintf (stderr, "verify_children_queue: incompatible parents\n");
> + abort ();
> + }
and just use
if (task->parent != parent)
gomp_fatal ("verify_children_queue: incompatible parents");
instead. Note no \n at the end.
Ditto for all other fprintf + abort pairs.
gomp_fatal accepts printf style formatting string, so you can even
handle it in:
> + fprintf (stderr, "verify_taskgroup_queue: incompatible taskgroups\n");
> + fprintf (stderr, "%p %p\n", task->taskgroup, taskgroup);
> + abort ();
this case, just use a single fmt string, and just use space instead of \n in
the middle.
Jakub