Page 1 of 1

enable_optim selections not applied to fallbacks

Posted: Wed Oct 10, 2012 3:08 pm
by Alain_Jacques
Dear all, ... hi Yann,

It appears to me that user's choices for enable_optim are not properly echoed to fallbacks configurations.
For example, with an enable_optim="aggressive" and enable_debug="no" configuration file, the first compilation call in netCDF shows

Code: Select all

/opt/mpich2-1.3.2p1_ifc-11.1_m64/bin/mpif90        -I../libsrc -I.  -free -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST -DNDEBUG -DpgiFortran -g -O2 -I/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build2/fallbacks/exports/include -c -o typeSizes.o  typeSizes.f90

i.e. the intended optimization flags -O3 -xHOST precede the default -g -O2 and therefore are ignored.
Similarly in libxc

Code: Select all

/bin/bash ../libtool --tag=CC   --mode=compile /opt/mpich2-1.3.2p1_ifc-11.1_m64/bin/mpicc -DHAVE_CONFIG_H -I. -I..   -I/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build2/fallbacks/exports/include  -g -O2 -MT special_functions.lo -MD -MP -MF .deps/special_functions.Tpo -c -o special_functions.lo special_functions.c

i.e. optimization flags are ignored
And in bigDFT, the configure final step reports

Code: Select all

Fortran90 flags: -free -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST -g -O2 -I/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build2/fallbacks/exports/include -assume noold_unit_star

i.e. again the -O3 is superseded by -O2

Would it be possible the check the consistency of the optimization options all the way through the build?

Kind regards,

Alain

Re: enable_optim selections not applied to fallbacks

Posted: Thu Oct 11, 2012 7:07 pm
by pouillon
This is very likely coming from discrepancies between the respective build systems of Abinit, NetCDF, LibXC, and BigDFT, as they all independently set optimisations flags. If the build systems of the fallbacks append their flags to those of Abinit, there's not much I can do. Moreover, applying the same optimisations to Abinit and the fallbacks does not always make sense, as they might have different requirement.

Please note that the Abinit fallbacks are just a prototype for a more sophisticated project that will replace them in the future.

Could you have a look at @abinit_builddir@/fallbacks/config.mk and tell me whether the same wrong flags appear there?

Re: enable_optim selections not applied to fallbacks

Posted: Sun Oct 14, 2012 9:42 pm
by Alain_Jacques
Hi Yann,

I agree for the "make sense" - I wouldn't fight to have libxc or atompaw fallbacks compiled with O3. For bigDFT ... it's a bit a pity but the performance difference is probably not so large.

I had a look on @abinit_builddir@/fallbacks/config.mk ... it's clean, the expected "aggressive" flags are there. I assume you're interested by the last few lines:

Code: Select all

# Fortran flags
FCFLAGS_ATOMPAW_EXT   =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST
FCFLAGS_BIGDFT_EXT    =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST
FCFLAGS_ETSF_IO_EXT   =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST
FCFLAGS_FOX_EXT       =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST
FCFLAGS_LIBXC_EXT     =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST
FCFLAGS_LINALG_EXT    =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST
FCFLAGS_NETCDF_EXT    =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST
FCFLAGS_WANNIER90_EXT =   -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST


If I look on the headlines of bigDFT config.log:

Code: Select all

./configure --prefix=/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build3-perfgforker/fallbacks/exports --bindir=/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build3-perfgforker/fallbacks/exports/bin --libdir=/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build3-perfgforker/fallbacks/exports/lib --program-suffix=-abinit --disable-binaries --disable-bindings --enable-libbigdft --without-libxc --without-archives --without-yaml --with-moduledir=/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build3-perfgforker/fallbacks/exports/include
the config.mk fortran flags are not pushed there but down the same config.log file, I see

Code: Select all

FCFLAGS='-free -extend-source -vec-report0 -noaltparam -nofpscomp   -O3 -xHOST -g -O2 -I/home/myself/Devel/abinit/bzr/jacques/7.0.2-private/tmp-build3-perfgforker/fallbacks/exports/include -assume noold_unit_star'
so I'm a bit puzzled over how these FCFLAGS were assembled i.e. where the -g -O2 comes from?
But please don't loose your time on it especially if it is intended to completely change in the future

Kind regards,

Alain

Re: enable_optim selections not applied to fallbacks  [SOLVED]

Posted: Mon Oct 29, 2012 12:46 pm
by pouillon
The persistent "-g -O2" very likely from the fallbacks' build systems, which are adding it regardless of the value of *FLAGS. The best is probably to notify the developers of the corresponding fallbacks about this faulty behaviour.