default compiler optimisation: 6.0.4 hangs, 5.8.4 doesn't

option, parallelism,...

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.
Locked
spamrefuse
Posts: 35
Joined: Wed Jan 20, 2010 3:08 am

default compiler optimisation: 6.0.4 hangs, 5.8.4 doesn't

Post by spamrefuse » Fri May 21, 2010 5:04 pm

Hi,

When I compile abinit 6.0.4, it hangs (calculation never ends!) under certain
circumstances; for example, tutorial example 3.1 never ends.....

If use same configure/compile conditions with 5.8.4p, this "hang" does not occur!

If I switch off the optimisations with configure option --enable-optim="no", then
the 6.0.4 executable does not hang anymore.....
(Does this mean, it is a GCC compiler bug?!? I have Fedora Linux 12, with the
GCC compiler suite version 4.4.3 )

I investigated further by running the 6.0.4 "hanging" executable with the gdb
debugger, to hopefully find where it hangs. This is the result:

$ gdb /opt/abinit/6.0/bin/abinit
GNU gdb (GDB) Fedora (7.0.1-45.fc12)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /opt/abinit/6.0/bin/abinit...done.
(gdb) run
Starting program: /opt/abinit/6.0/bin/abinit
ABINIT

Give name for formatted input file:
t31.in
t31.in
Give name for formatted output file:
t3x.out
t3x.out
Give root name for generic input files:
t3xi
t3xi
Give root name for generic output files:
t3xo
t3xo
Give root name for generic temporary files:
t3x
t3x

.Version 6.0.4 of ABINIT
.(sequential version, prepared for a i686_linux_gnu4.4 computer)

<...snip...>

=== Build Information ===
Version : 6.0.4
Build target : i686_linux_gnu4.4
Build date : 20100521

=== Compiler Suite ===
C compiler : gnu4.4
CFLAGS : -ggdb
C++ compiler : gnu4.4
CXXFLAGS : -ggdb
Fortran compiler : gnu4.4
FCFLAGS : -g -ffree-line-length-none
FC_LDFLAGS :

=== Optimizations ===
Debug level : yes
Optimization level : standard
Architecture : unknown_unknown

=== MPI ===
Parallel build : no
Parallel I/O : no

=== Linear algebra ===
Library type : abinit
Use ScaLAPACK : no

=== Plug-ins ===
BigDFT : no
ETSF I/O : no
LibXC : no
FoX : no
NetCDF : no
Wannier90 : no

=== Experimental features ===
Bindings : no
Error handlers : no
Exports : no
GW double-precision : no
Macroave build : yes

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CPP options activated during the build:

CC_GNU CXX_GNU FC_GNU

HAVE_FC_EXIT HAVE_FC_FLUSH HAVE_FC_GAMMA

HAVE_FC_GET_ENVIRONMEN... HAVE_FC_NULL HAVE_FORTRAN2003

HAVE_NUMPY HAVE_STDIO_H USE_MACROAVE

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

<...snip...>

================================================================================

iter Etot(hartree) deltaE(h) residm vres2 diffor maxfor

getcut: wavevector= 0.0000 0.0000 0.0000 ngfft= 20 20 20
ecut(hartree)= 8.000 => boxcut(ratio)= 2.18216
scfcv : before setvtr, energies%e_hartree= 0.0000000000000000

ewald : nr and ng are 3 and 11
mklocl_recipspace : will add potential with strength vprtrb(:)= 0.0000000000000000 0.0000000000000000
setvtr : istep,n1xccc,moved_rhor= 1 2501 0
scfcv : after setvtr, energies%e_hartree= 0.0000000000000000

ITER STEP NUMBER 1
vtorho : nnsclo_now= 2, note that nnsclo,dbl_nnsclo,istep= 0 0 1

Non-SCF iterations; k pt # 1 k= -0.25000 0.50000 0.00000 band residuals:
res: 2.20E-02 2.77E-02 2.68E-02 4.76E-02 1.55E-02

<...HERE IT IS HANGING...I use CTRL-C to interrupt>

(gdb) where
#0 dlamc3 (a=can't compute CFA for this frame
) at dlamch.f:627
#1 0x0891ce71 in dlamc1 (beta=0, t=0, rnd=.TRUE., ieee1=.FALSE.) at dlamch.f:314
#2 0x0891c68a in dlamc2 (beta=1, t=144955274, rnd=144049282, eps=2.2204460492503131e-16, emin=144956590,
rmin=7.7941770627915757e-255, emax=1, rmax=0) at dlamch.f:439
#3 0x0891d0ae in dlamch (cmach='B', _cmach=1) at dlamch.f:99
#4 0x08961674 in dlartg (f=0.1184800244732927, g=-0.11053278714129217, cs=1, sn=1, r=2.2063636054861382) at dlartg.f:85
#5 0x08949d8e in zsteqr (compz='V', n=5, d=..., e=..., z=..., ldz=5, work=..., info=0, _compz=1) at zsteqr.f:294
#6 0x0893753b in zhpev (jobz='V', uplo='U', n=5, ap=..., w=..., z=..., ldz=5, work=..., rwork=..., info=0, _jobz=1,
_uplo=1) at zhpev.f:179
#7 0x0817f4e9 in subdiago (cg=..., eig_k=..., evec=..., gsc=..., icg=0, igsc=0, istwf_k=1, mcg=2890, mgsc=0,
mpi_enreg=..., nband_k=5, npw_k=283, nspinor=1, paral_kgb=0, subham=..., subovl=..., use_subovl=0, usepaw=0)
at subdiago.F90:351
#8 0x08135c46 in vtowfk (cg=..., cgq=..., cprj=..., cpus=0, dimcprj=..., dimffnl=1, dphase_k=..., dtefield=...,
dtfil=..., dtset=..., eig_k=..., ek_k=..., ek_k_nd=..., enl_k=..., fixed_occ=.TRUE., ffnl=..., grnl_k=...,
gs_hamk=..., ibg=0, icg=0, ikpt=1, iscf=7, isppol=1, kg_k=..., kinpw=..., kpg_k=..., lmnmax=2, matblk=2,
mband_cprj=0, mcg=2890, mcgq=1, mgfft=20, mkgq=1, mpi_enreg=..., mpsang=3, mpssoang=3, mpw=289, natom=2, nband_k=5,
nkpg=0, nkpt=2, nnsclo_now=2, npw_k=283, npwarr=..., nspinor=1, ntypat=1, nvloc=1, n4=21, n5=21, n6=20, occ_k=...,
optforces=1, ph3d=..., prtvol=0, pwind=..., pwind_alloc=1, pwnsfac=..., pwnsfacq=..., resid_k=..., rhoaug=...,
use_dmft=0, usecprj=0, vlocal=..., wtk=0.75, zshift=...) at vtowfk.F90:466
#9 0x0812cc17 in vtorho (afford=1, atindx=..., atindx1=..., cg=..., compch_fft=3.4597648938201542e-255, cpus=0,
dbl_nnsclo=0, dielop=0, dielstrt=0, dphase=..., dtefield=..., dtfil=..., dtset=..., eigen=...,
electronpositron=0x0, energies=..., etotal=0, gbound_diel=..., gmet=..., gprimd=..., grnl=...,
gsqcut=1.6211389382774044, hdr=..., indsym=..., irrzon=..., irrzondiel=..., istep=1, istep_mix=1, kg=...,
kg_diel=..., kxc=..., lmax_diel=0, mgfftdiel=1, mpi_enreg=..., mpsang=3, natom=2, nattyp=..., nfftf=8000,
nfftdiel=1, ngfftdiel=..., nhat=..., nkxc=0, npwarr=..., npwdiel=1, nres2=0, nspinor=1, ntypat=1, nvresid=...,
occ=..., optforces=1, optres=0, paw_dmft=..., paw_ij=..., pawang=..., pawfgr=..., pawfgrtab=..., pawrhoij=...,
pawtab=..., phnons=..., phnonsdiel=..., ph1d=..., ph1ddiel=..., psps=..., pwind=..., pwind_alloc=1, pwnsfac=...,
resid=..., residm=3.4597648938201542e-255, rhog=..., rhor=..., rmet=..., rprimd=..., susmat=..., symrec=...,
taug=..., taur=..., ucvol=263.74445799999995, wffnew=..., wffnow=..., vtrial=..., wvl=..., xred=..., ylm=...,
ylmdiel=...) at vtorho.F90:982
#10 0x080f8f07 in scfcv (atindx=..., atindx1=..., cg=..., cpus=0, dtefield=..., dtfil=..., dtpawuj=..., dtset=...,
ecore=22.941917142441731, eigen=..., electronpositron=0x0, fatvshift=1, hdr=..., iapp=0, indsym=..., initialized=0,
irrzon=..., kg=..., mpi_enreg=..., nattyp=..., ndtpawuj=0, nfftf=8000, npwarr=..., occ=..., paw_dmft=...,
pawang=..., pawfgr=..., pawrad=..., pawrhoij=..., pawtab=..., phnons=..., psps=..., pwind=..., pwind_alloc=1,
pwnsfac=..., rec_set=..., resid=..., results_gs=..., rhog=..., rhor=..., rprimd=..., scf_history=..., symrec=...,
taug=..., taur=..., wffnew=..., wffnow=..., wvl=..., xred=..., xred_old=..., ylm=..., ylmgr=...) at scfcv.F90:1187
#11 0x080afca6 in gstate (acell=..., codvsn='6.0.4 ', cpui=995514.12699999998, dtfil=..., dtset=..., iexit=0,
mpi_enreg=..., npwtot=..., nspinor=1, occ=..., pawang=..., pawrad=..., pawtab=..., psps=..., results_gs=...,
rprim=..., vel=..., xred=..., _codvsn=6) at gstate.F90:1018
#12 0x0805dd46 in gstateimg (acell_img=..., codvsn='6.0.4 ', cpui=995514.12699999998, dtfil=..., dtset=...,
etotal_img=..., fcart_img=..., fred_img=..., iexit=0, mpi_enreg=..., npwtot=..., nspinor=1, occ_img=...,
pawang=..., pawrad=..., pawtab=..., psps=..., rprim_img=..., strten_img=..., vel_img=..., xred_img=..., _codvsn=6)
at gstateimg.F90:338
#13 0x080536b9 in driver (codvsn='6.0.4 ', cpui=995514.12699999998, dtsets=..., filnam=...,
filstat='t3x_STATUS', ' ' <repeats 254 times>, mpi_enreg=..., ndtset=0, ndtset_alloc=1, npsp=1, pspheads=...,
results_out=..., _codvsn=6, _filnam=264, _filstat=264) at driver.F90:623
#14 0x0804bbde in abinit () at abinit.F90:437
#15 0x089a66cc in main ()
#16 0x00930bb6 in __libc_start_main () from /lib/libc.so.6
#17 0x08049c61 in _start ()

Does this give any clue?

Rob.

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: default compiler optimisation: 6.0.4 hangs, 5.8.4 doesn'

Post by gmatteo » Fri May 21, 2010 6:25 pm

I had a similar problem on my laptop using the same version of gcc:
dlamch enters an infinite loop and doesn't return.

I solved it by linking an external blas & lapack library.
Hope it helps
Matteo

spamrefuse
Posts: 35
Joined: Wed Jan 20, 2010 3:08 am

Re: default compiler optimisation: 6.0.4 hangs, 5.8.4 doesn'

Post by spamrefuse » Sat May 22, 2010 8:50 am

It's awkward though that this does not happen with abinit version 5.8.4p
(same compiler options and same GCC version).

It's apparently a rather inconvenient interplay between the abinit version and
the GCC version.....

Rob.

Locked