increasing stack size

Hello

I am using the PGI C/C++/Fortran workstation on Windows. In the PGI cygwin env., I get the following output for “ulimit -a”:


PGI$ ulimit -a
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
open files (-n) 256
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 2034
cpu time (seconds, -t) unlimited
max user processes (-u) 63
virtual memory (kbytes, -v) 2097152

I want to increase the stack size to unlimited but I see this message:


PGI$ ulimit -s unlimited
bash: ulimit: stack size: cannot modify limit: Invalid argument


How do I increase the stack size to be unlimited ?

Thanks & Regards,
Kunal

Hi Kunal,

On Windows the stack size is set at link time via the “-stack” flag.

PGI$ pgf90 -help -stack
Reading rcfile c:\PROGRA~1\PGI\win64\10.8\bin\pgf90_rc
-stack=[no]check||
Set stack reserve and commit sizes at link time
[no]check Disable run-time stack check

The “reserve” is the amount of stack space in bytes the OS should set aside for your program. The actual amount used will grow as your program executes.

The “commit” is how much of the reserve memory to commit at load time.

By default, during the execution of your program, the run time checks to see if more reserve space needs to be committed. This allows you to has a very large reserve but not actually use the system’s memory until it’s needed.

The “nocheck” option tells the runtime to not perform this check. Using “nocheck” can help your runtime performance at the cost of committing more memory.

Hope this helps,
Mat