[Q-e-developers] Wondering if build-time optimization OK

Chang, Christopher Christopher.Chang at nrel.gov
Thu Jun 30 21:34:28 CEST 2016


Sorry, that last question should read

*             Is it a good idea to turn -O2 off generally for --enable-debug, and -CB off generally for production builds?

--

Hi,

   I was recently building QE 5.4.0. FWIW,

[cchang at n1011 ~]$ uname -a
Linux n1011 2.6.32-504.8.1.el6.x86_64 #1 SMP Wed Jan 28 21:11:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[cchang at n1011 ~]$ cat /etc/redhat-release
CentOS release 6.6 (Final)
[cchang at n1011 ~]$ mpif90 -v
mpif90 for the Intel(R) MPI Library 5.1.3 for Linux*
Copyright(C) 2003-2015, Intel Corporation.  All rights reserved.
ifort version 16.0.2
[cchang at n1011 ~]$ mpif77 -v
mpif77 for the Intel(R) MPI Library 5.1.3 for Linux*
Copyright(C) 2003-2015, Intel Corporation.  All rights reserved.
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/nopt/nrel/apps/gcc/5.2.0/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/nopt/nrel/apps/gcc/5.2.0 --enable-bootstrap --disable-multilib
Thread model: posix
gcc version 5.2.0 (GCC)

Configuration was with

configure --prefix=/scratch/cchang/qespresso --enable-openmp --enable-parallel --enable-debug --enable-signals --with-scalapack=intel LDFLAGS="-mkl"

Anyway, I noticed that the space_group.f90 build step seemed to hang, although CPU usage was pegged at 100%.
   After some diagnostic work, I nailed the long build time down to the array bounds checking. If -CB is left off, the file builds in about 2 minutes. I didn't wait long enough to see how long the standard build would take, but it was more than 11 minutes, possibly much more.
   The reason I write, is that the Intel ifort man page points out that array bounds checking won't work as expected anyway, if optimizations are turned on. Specifically,

"
It  is  recommended  that you do bounds checking on unoptimized code. If you use option check bounds on optimized code, it may produce misleading mes-
              sages because registers (not memory locations) are used for bounds values.
"


*         Is this a reasonable thing to do for this file?

*         Is it a good idea to turn it off generally for --enable-debug?

Thanks for any pointers you can provide,

Chris

--
Christopher H. Chang, Ph.D.
   Computational Chemist | NREL Computational Science Center
   Research Associate | University of Colorado/RASEI
15013 Denver West Parkway, MS ESIF301 | Golden, CO 80401


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/developers/attachments/20160630/4d482d63/attachment.html>


More information about the developers mailing list