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 via email to