public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "walter.zimmer at dlr dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgomp/63700] New: Is is impossible to set the OpenMP stack size from inside a program
Date: Fri, 31 Oct 2014 15:17:00 -0000	[thread overview]
Message-ID: <bug-63700-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63700

            Bug ID: 63700
           Summary: Is is impossible to set the OpenMP stack size from
                    inside a program
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: walter.zimmer at dlr dot de
                CC: jakub at gcc dot gnu.org

We have a binary which uses a lot of stack due to external libray we have no
control over. Single threaded, this is no problem, setrlimit() works fine. But
for OpenMP, setting OMP_STACKSIZE seems to be the only option so set the stack
size for OpenMP threads.

Unfortunately, it can't be set from within the program, as the libgomp code is
always executed before the main program code. We also tried __attribute__
((constructor)) and section(".init"), but for shared links, the libgomp code is
always called before we can set rlimit or OMP_STACKSIZE (nice to see with
OMP_DISPLAY_ENV).

We really want to avoid having external dependencies, so we try to avoid having
to set external environment variables.

Having a small routine which sets the OpenMP internal stack size before the
first threads are created would solve this problem. Such a routine is not
specified in the standard, but it might be implemented as a gomp routine to
account for that.

Or did I miss something? Is this behaviour maybe intentional? What would be the
best solution to set the OpenMP stack size inside a program?


             reply	other threads:[~2014-10-31 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 15:17 walter.zimmer at dlr dot de [this message]
2014-10-31 15:34 ` [Bug libgomp/63700] It " Joost.VandeVondele at mat dot ethz.ch
2024-06-04 11:22 ` walter.zimmer at dlr dot de

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=bug-63700-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).