This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gfortran47, pgf90 work - ifort segfaults


Hello Anton,

2012/2/10 Anton Shterenlikht <mexas@bristol.ac.uk>:

> Tobias, thanks, you are right:
>
> % ifort z.f90
> % limit stack
> stacksize ? ?10240 kbytes
> % ./a.out
> Segmentation fault
> % limit stack 100000
> % ./a.out
> %
>
> How is stack space related to the available RAM?
> I naively assumed that if I have e.g. 8GB RAM in a node,
> I can operate with, say, 7GB RAM arrays, and leave
> the remaining 1GB ?for the OS needs. I guess this
> is far too simple a view?
>
> Maybe you can point me to a good resource to
> read more on this. I don't want to take too much
> of your time.
>

I know of no such a resource, but the stack space allowed to a program
is something that the OS is responsible for, not the hardware.
You found the way to increase the available stack space on Linux.
On Windows you have to do it by telling the linker to make the
stack larger (so you get a different executable).

The only robust way out is to use the heap instead (via explicit allocation).
Then you can use all the space you want and is available (on 32-bits it
is limited to 2 GB per process, IIRC, and on 64-bits it is limited to a very
much larger amount - whatever fits into 8-byte integers).

Regards,

Arjen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]