[Pw_forum] Stack size error on CVS version

Axel Kohlmeyer akohlmey at cmm.chem.upenn.edu
Wed Sep 5 17:21:06 CEST 2007

On Wed, 5 Sep 2007, Paolo Giannozzi wrote:

PG> Should the code require more stack, you are left with the following  
PG> options:
PG> - cursing Intel because their compiler eats up so much stack (useless)

true. it is annoying, but using the stack for temporary variables 
has a few advantages: speed, simplicity, and no memory leaks (you 
don't have to free(3) memory that you allocate with alloca(3) instead
of malloc(3)). for as long as you pass large arrays as arguments
or keep them in common blocks (as in old style fortran programs)
you'll get very good performance with that.

PG> - cursing Apple because Mac OS-X does not allow users to remove the
PG> stack size limit (also useless)
PG> - modifying the clib/stack.c routine so that it determines the maximum
PG> limit and sets the stack size accordingly (65536kb seems to be the
PG> maximum for users on Mac OS-X, so it might be useless as well)
PG> - running with root privilege (dangerous)

there is one more option:
- if you have an intel compiler version 10.0 or above, you can use the
  flag -heap-arrays which will put temporary arrays (the major reason
  for excessive stack growth) on the heap instead of the stack.


PG> See also here:
PG>     http://www.democritos.it:8888/O-sesame/chngview?cn=4710
PG> Paolo
PG> ---
PG> Paolo Giannozzi, Democritos and University of Udine, Italy
PG> _______________________________________________
PG> Pw_forum mailing list
PG> Pw_forum at pwscf.org
PG> http://www.democritos.it/mailman/listinfo/pw_forum

Axel Kohlmeyer   akohlmey at cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.

More information about the users mailing list