This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgomp/58691] OpenMP 4: Surprising results with OMP_PLACES=


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58691

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #2)
> (Note that that will turn an explicit OMP_PROC_BIND=false into true, which
> looks odd - even if I regard it as unlikely that someone wants to have no
> proc-binding while setting OMP_PLACES or GOMP_CPU_AFFINITY:
> 
> OMP_PLACES='FALSE' OMP_PLACES='{0:4}' OMP_DISPLAY_ENV=verbose ./a.out 2>&1
> |grep -E 'OMP_PLACES|OMP_PROC_'
>   OMP_PROC_BIND = 'TRUE'
>   OMP_PLACES = '{0:4}'

That command line doesn't set explicit OMP_PROC_BIND=false, it sets OMP_PLACES
twice, first time to invalid value, but the latter wins.
If you try
OMP_PROC_BIND='FALSE' OMP_PLACES='{0,4}' OMP_DISPLAY_ENV=verbose ./a.out 2>&1
|grep -E 'OMP_PLACES|OMP_PROC_'
you'll see it will print
  OMP_PROC_BIND = 'FALSE'
  OMP_PLACES = ''

I'll go ahead and commit the patch.

> In addition, some patch like the following could be used. Side remark:
> OMP_PLACES= is not yet documented in libgomp.texi.
> 
> --- a/libgomp/libgomp.texi
> +++ b/libgomp/libgomp.texi
> @@ -1272,3 +1272,4 @@ Specifies whether threads may be moved between
> processors. If set to
>  @code{TRUE}, OpenMP theads should not be moved, if set to @code{FALSE}
> -they may be moved. If undefined, threads may move between processors.
> +they may be moved. If undefined, threads may move between processors,
> +unless @code{OMP_PLACES} or @code{GOMP_CPU_AFFINITY} is set.

libgomp.texi needs much more updates for OpenMP 4.0, didn't have time for that
yet (if you have spare cycles, any help with that would be appreciated).
Just saying this when not even mentioning the SPREAD, CLOSE, MASTER (and that
in that case it can be a comma separated list) does not move us much further
though.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]