public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: OpenMP 5.1: omp_display_env
Date: Tue, 27 Jul 2021 17:05:03 +0200	[thread overview]
Message-ID: <20210727150503.GK2380545@tucnak> (raw)
In-Reply-To: <CAP3s5k-Ru6a9EHJe-CpK0ZiuZ84fEALn+6rQ8GsU5e_Bez-Vew@mail.gmail.com>

On Tue, Jul 27, 2021 at 04:26:22PM +0200, Ulrich Drepper via Gcc-patches wrote:
> I know OpenMP 5.1 is not really a focus yet but adding this new interface
> should not be problematic.  I stumbled across this part of the spec and the
> functionality is really already mostly there in the form of
> OMP_DISPLAY_ENV=verbose etc.  This is just a function interface to the same
> functionality.
> 
> Aside from the busywork to add a new interface (headers, map file) the only
> real question was how to deal with the two parameters which are passed
> to handle_omp_display_env in the current implementation. The
> omp_display_env interface is supposed to show the information of the
> initial values and therefore I think the right implementation is to store
> the values determined in the constructor in two global, static variables
> and reuse them.
> 
> The rest should be completely boring and therefore not distracting anyone
> from OpenMP 5.0 work.

Thanks.
You'll need to write a ChangeLog entry and put it at the end of the commit
message, otherwise pre-commit hooks will reject the commit.

--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -1210,46 +1213,11 @@ parse_gomp_openacc_dim (void)
     }
 }

-static void
-handle_omp_display_env (unsigned long stacksize, int wait_policy)
+void
+omp_display_env (int verbose)

Please add
ialias (omp_display_env)
right after the function definition, we don't want to introduce new
PLT slots unnecessarily and omp_display_env is an exported function.

> --- a/libgomp/fortran.c
> +++ b/libgomp/fortran.c

And ialias_redirect (omp_display_env) here.

> @@ -736,3 +736,9 @@ omp_get_default_allocator_ ()
>  {
>    return (intptr_t) omp_get_default_allocator ();
>  }
> +
> +void
> +omp_display_env_ (const int32_t *verbose)
> +{
> +  omp_display_env (*verbose);
> +}

For Fortran functions/subroutines that take integer arguments
libgomp typically defines two functions, one with _ suffix
and one with _8_ suffix, the former taking const int32_t *
and the latter const int64_t * and using !! for logicals
and TO_INT macro for integers.
Please grep e.g. for omp_set_dynamic in
fortran.c, libgomp.map and omp_lib.f90.in.
This is needed to make calls to those functions work even with
-fdefault-integer-8

> --- a/libgomp/omp_lib.f90.in
> +++ b/libgomp/omp_lib.f90.in
> @@ -653,6 +653,12 @@
>            end function
>          end interface
> 
> +        interface
> +          subroutine omp_display_env (verbose)
> +            logical,intent(in) :: verbose
> +          end subroutine
> +        end interface

See above.  Plus, please add space between comma and intent(in).

Otherwise LGTM.

	Jakub


  reply	other threads:[~2021-07-27 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 14:26 Ulrich Drepper
2021-07-27 15:05 ` Jakub Jelinek [this message]
2021-07-30  7:49   ` Tobias Burnus
2021-07-30  8:43     ` Ulrich Drepper
2021-07-30  8:50       ` Jakub Jelinek
2021-07-30  9:54         ` Ulrich Drepper
2021-07-30 10:02           ` Jakub Jelinek
2021-07-30 10:05             ` Thomas Schwinge
2021-07-30 12:02               ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210727150503.GK2380545@tucnak \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).