Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Parallel Programming Guide for HP-UX Systems: K-Class and V-Class Servers > Chapter 9 Parallel programming techniques

Setting thread default stack size

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

Thread 0's stack can grow to the size specified in the maxssiz configurable kernel parameter. Refer to the Managing Systems and Workgroups manual for more information on configurable kernel parameters.

Any threads your program spawns (as the result of loop_parallel or tasking directives or pragmas) receive a default stack size of 80 Mbytes. This means that if the following conditions exist, then you must modify the stack size of the spawned threads using the CPS_STACK_SIZE environment variable:

  • A parallel construct declares more than 80 Mbytes of loop_private, task_private, or parallel_private data, or

  • A subprogram with more than 80 Mbytes of local data is called in parallel, or

  • The cumulative size of all local variables in a chain of subprograms called in parallel exceeds 80 Mbytes,

Modifying thread stack size

Under csh, you can modify the stack size of the spawned threads using the CPS_STACK_SIZE environment variable.

The form of the CPS_STACK_SIZE environment variable is shown in Table 9-12 “Forms of CPS_STACK_SIZE environment variable”.

Table 9-12 Forms of CPS_STACK_SIZE environment variable

LanguageForm
Fortran, Csetenv CPS_STACK_SIZE size_in_kbytes

 

where

size_in_kbytes

is the desired stack size in kbytes. This value is read at program start-up, and it cannot be changed during execution.

For example, the following command sets the thread stack size to 100 Mbytes:

setenv CPS_STACK_SIZE 102400

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.