[Openmp-dev] Default value for OpenMP thread stacksize

Cownie, James H via Openmp-dev openmp-dev at lists.llvm.org
Mon Oct 8 08:05:10 PDT 2018

I do not know what the default OpenMP stack size is on PPC, but the rest of your logic seems sound, and setting OMP_STACKSIZE seems entirely reasonable.
The standard says that the default stack size is "implementation defined", so it is entirely reasonable that different implementations have different default values.

-- Jim

Jim Cownie <james.h.cownie at intel.com>
CVCG/DPD/TCAR (Technical Computing, Analyzers, and Runtimes)
Tel: +44 117 9071438

From: Openmp-dev [mailto:openmp-dev-bounces at lists.llvm.org] On Behalf Of Simone Atzeni via Openmp-dev
Sent: Monday, October 8, 2018 3:58 PM
To: openmp-dev at lists.llvm.org
Subject: [Openmp-dev] Default value for OpenMP thread stacksize

HI all,

What's the default size for the stack of the OpenMP threads in x86 and and ppc64 in the OpenMP runtime?

I have a Fortran program which allocates more than a 1MB on the stack for each thread. On x86 runs correctly, but on ppc64 it seg faults.
I am seeing that each thread in x86 has a stacksize of 4096kb while on ppc64 is 1024kb.
If I increase the stacksize with OMP_STACKSIZE the program runs correctly also on Power, but it fails if I only set "ulimit -s unlimited", which make sense since ulimit should only change the stacksize for the main thread but not for the other threads.

Is this the expected behavior and the correct solution is to set OMP_STACKSIZE?

This email message is for the sole use of the intended recipient(s) and may contain confidential information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20181008/fd92eed0/attachment.html>

More information about the Openmp-dev mailing list