enable_optim selections not applied to fallbacks  [SOLVED]

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
User avatar
Alain_Jacques
Posts: 279
Joined: Sat Aug 15, 2009 9:34 pm
Location: Université catholique de Louvain - Belgium

enable_optim selections not applied to fallbacks

Post by Alain_Jacques » Wed Oct 10, 2012 3:08 pm

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

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: enable_optim selections not applied to fallbacks

Post by pouillon » Thu Oct 11, 2012 7:07 pm

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?
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

User avatar
Alain_Jacques
Posts: 279
Joined: Sat Aug 15, 2009 9:34 pm
Location: Université catholique de Louvain - Belgium

Re: enable_optim selections not applied to fallbacks

Post by Alain_Jacques » Sun Oct 14, 2012 9:42 pm

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

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: enable_optim selections not applied to fallbacks  [SOLVED]

Post by pouillon » Mon Oct 29, 2012 12:46 pm

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.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

Locked