public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/63700] New: Is is impossible to set the OpenMP stack size from inside a program
@ 2014-10-31 15:17 walter.zimmer at dlr dot de
  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
  0 siblings, 2 replies; 3+ messages in thread
From: walter.zimmer at dlr dot de @ 2014-10-31 15:17 UTC (permalink / raw)
  To: gcc-bugs

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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgomp/63700] It is impossible to set the OpenMP stack size from inside a program
  2014-10-31 15:17 [Bug libgomp/63700] New: Is is impossible to set the OpenMP stack size from inside a program walter.zimmer at dlr dot de
@ 2014-10-31 15:34 ` Joost.VandeVondele at mat dot ethz.ch
  2024-06-04 11:22 ` walter.zimmer at dlr dot de
  1 sibling, 0 replies; 3+ messages in thread
From: Joost.VandeVondele at mat dot ethz.ch @ 2014-10-31 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Joost.VandeVondele at mat dot ethz
                   |                            |.ch

--- Comment #1 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
This would indeed be useful, or as an alternative, something that sets the
default stacksize of threads at compile time.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgomp/63700] It is impossible to set the OpenMP stack size from inside a program
  2014-10-31 15:17 [Bug libgomp/63700] New: Is is impossible to set the OpenMP stack size from inside a program walter.zimmer at dlr dot de
  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
  1 sibling, 0 replies; 3+ messages in thread
From: walter.zimmer at dlr dot de @ 2024-06-04 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Walter Zimmer <walter.zimmer at dlr dot de> ---
Still, we're looking for a way to accomplish this. Any news? I didn't see
anything concerning stack size in the current OpenMP docs.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-04 11:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31 15:17 [Bug libgomp/63700] New: Is is impossible to set the OpenMP stack size from inside a program walter.zimmer at dlr dot de
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

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).