Roland Mainz wrote:
> Darryl Gove wrote:
>
>> Roland Mainz wrote:
>>
>>> The cc(1) manual page says this about the "STACKSIZE" environment
>>> variable:
>>> -- snip --
>>> STACKSIZE
>>> The executing program maintains a main memory
>>> stack for the master thread and distinct stacks
>>> for each slave thread. Stacks are temporary memory
>>> address spaces used to hold arguments and
>>> automatic variables over subprogram invocations.
>>> The default size of the main stack is about eight
>>> megabytes. Use the limit(1) command to display the
>>> current main stack size as well as set it.
>>>
>>> Each slave thread of a multithreaded program has
>>> its own thread stack. This stack mimics the main
>>> stack of the master thread but is unique to the
>>> thread. The thread's private arrays and variables
>>> (local to the thread) are allocated on the thread
>>> stack.
>>>
>>> All slave threads have the same stack size, which
>>> is four megabytes for 32-bit applications and
>>> eight megabytes for 64-bit applications by
>>> default. The size is set with the STACKSIZE
>>> environment variable.
>>>
>>> Setting the thread stack size to a value larger
>>> than the default may be necessary for some paral-
>>> lelized code.
>>>
>>> The syntax of the STACKSIZE environment variable
>>> accepts a keyword for denoting the slave thread
>>> stacksize: B for Bytes, K for Kilobytes, M for
>>> Megabytes, G for Gigabytes.
>>>
>>> For example, setenv STACKSIZE 8192 sets the slave
>>> thread stack size to 8 MB. 1235B sets the slave
>>> thread stack size for 1235 Bytes. 1235G sets it
>>> for 1235 Gigabytes. The default for an integer
>>> value without a suffix letter is still Kilobytes.
>>> -- snip --
>>>
>>> Who or what uses "STACKSIZE" and sets it ? A quick look into the libc
>>> sources shows that it isn't used there... and somehow I start to suspect
>>> that this variable is only used for threads managed by OMP + -xparallel
>>> but not for the main thread or for threads created "manually" via
>>> |pthread_create()|, right ?
>>>
>> Yup, OpenMP/autopar use this.
>>
>
> Where is the code (e.g. which *.a or *.o) which uses this variable ?
>
> BTW: IMO it would be nice to have less generic names for such variables,
> e.g. "OMP_STACKSIZE" and "AUTOPAR_STACKSIZE" (which override STACKSIZE).
>
>
There is now OMP_STACKSIZE as defined by the OpenMP standard, I guess
its time to deprecate STACKSIZE.