public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Mohamed Atef <mohamedatef1698@gmail.com>
Cc: gcc@gcc.gnu.org, tobias@codesourcery.com
Subject: Re: OMPD: 5.5.8 Display Control Variables
Date: Mon, 23 May 2022 09:49:06 +0200	[thread overview]
Message-ID: <Yos8cjh40Fp8LJvx@tucnak> (raw)
In-Reply-To: <CAPFh8NK8ndVoOyLRPGa_hAQVG88X5T==6AGYprwv=03B9+44Bw@mail.gmail.com>

On Sun, May 22, 2022 at 05:56:46PM +0200, Mohamed Atef wrote:
> To implement this
> <https://www.openmp.org/spec-html/5.1/openmpsu247.html#x312-4810005.5.8>,
> should I add a function in the runtime to dump all the
> environment variables. Or should I use variables from helper functions?
> To make the icv-name=icv-value pair I think it will be too costly
> to use helper functions.

ICVs are of different kinds, some are pre-process, some are per-device, some
are per-thread, some are per-task.  But the function only has an address
space handle, so it can't query e.g. particular thread, task etc. ICVs.

My understanding is that the function should return something close to what
omp_display_env prints, except with different formatting, without _OPENMP =
line, the OPENMP DISPLAY ENVIRONMENT BEGIN/END pairs etc.
So, look at what omp_display_env does, copy the content of gomp_global_icv
and various other global vars from the process and then print it into
strings like omp_display_env prints then.
Note, omp_display_env can print also device sets before the vars (there are
patches floating for that in libgomp but still need work), like
  [device] OMP_NUM_THREADS='2'
  [host,device] OMP_DYNAMIC='TRUE'
  [host] OMP_PLACES='{0:4},{4:4},{8:4},{12:4}'
but probably this function should print host only stuff without such
prefixes (and without the 's) or indentation.

	Jakub


      reply	other threads:[~2022-05-23  7:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 15:56 Mohamed Atef
2022-05-23  7:49 ` Jakub Jelinek [this message]

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=Yos8cjh40Fp8LJvx@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=mohamedatef1698@gmail.com \
    --cc=tobias@codesourcery.com \
    /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).