Hi to all,
I was compiling and running ABINIT with different compiler and on
many platforms and everything worked fine.
Now I tried to compile ABINIT on my laptop with both IFORT AND GFORTRAN but
I found that when I increase the size of the system (in recursion method it corresponds to the size of the ngfft grid)
the IFORT compiled version gives a segmentation fault where GFORTRAN gives the good result
(but GFORTRAN is much more slow: I compiled with the "aggressive" compilation option for which IFORT is very fast).
As it was impossible for me to detect where was the error (gdb, compilation options) so I goggled a little bit
and I found that this error is explained by the behavior of these two compilers with respect to allocating automatic arrays.
IFORT allocates automatic arrays on the stack by default while GFORTRAN allocates them on the heap.
As in my subroutines I have a lots of automatic arrays I tried to increase my stack memory by "ulimit" and I compiled
IFORT with the extra-flags:
FCFLAGS_EXTRA="-heap-arrays 1024"
CFLAGS_EXTRA="-heap-arrays 1024"
Finally the IFORT compiled version works fine.
Now I ask me if I have to replace automatic arrays (more faster) with allocatable array.
Do you have a better idea to resolve this problem?
bye
Marco
ifort stack problem
Moderators: fgoudreault, mcote
Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
ifort stack problem
Marco Mancini
LUTH, Observatoire de Paris
5, place Jules Janssen
92190 MEUDON - FRANCE
LUTH, Observatoire de Paris
5, place Jules Janssen
92190 MEUDON - FRANCE
Re: ifort stack problem
I don't know if there is a better solution. It depends essentially on your priorities (speed, reliability, portability, ...).
Please note that the concepts of heap and stack are architecture-dependent. Some computers may even not have one of the two.
If speed is critical, it is usually better to use the stack. If not, allocatable arrays will likely have a more reliable and portable behavior.
Please note that the concepts of heap and stack are architecture-dependent. Some computers may even not have one of the two.
If speed is critical, it is usually better to use the stack. If not, allocatable arrays will likely have a more reliable and portable behavior.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain
Simune Atomistics
Donostia-San Sebastián, Spain
Re: ifort stack problem
Thanks for you reply Yann,
As recursion is thought to run on big machine or workstation
(where I suppose a bigger stack memory than in my laptop),
as you implicitly suggest, I will not touch my arrays.
thanks a lot
Marco
As recursion is thought to run on big machine or workstation
(where I suppose a bigger stack memory than in my laptop),
as you implicitly suggest, I will not touch my arrays.
thanks a lot
Marco
Marco Mancini
LUTH, Observatoire de Paris
5, place Jules Janssen
92190 MEUDON - FRANCE
LUTH, Observatoire de Paris
5, place Jules Janssen
92190 MEUDON - FRANCE