On Sunday 18 May 2008 02:11:15 Marcus D. Hanwell wrote:
Hi,
Just to let you know that Avogadro 0.8 is branched now. Any fixes for
the 0.8 release should be merged into this branch. As far as I can tell
there are no major issues aside from some funky problems with over
optimisation I think (using -O3 can cause some crashes in the draw tool
here). Personally I don’t think that -O3 is something that should be
used globally as the optimisations are not always safe and that appears
to be the case here. It also often results in larger binaries that don’t
always run faster…
This makes me react, as in Eigen 2, I am relying heavily on O3. Are you sure
that O3 allows itself to do unsafe things? I thought that it only did costly
(in terms of compilation time and compiler memory usage) things, and also, as
you point out, costly in terms of binary size. Because of the increased
binary size, it is true that in some cases the performance can be lower (e.g.
if code gets flushed out of the CPU’s instruction cache). But in any case I
really didn’t think that O3 would do anything unsafe. From GCC’s man page:
-O3 Optimize yet more. -O3 turns on all optimizations specified by -O2
and also turns on the -finline-functions, -funswitch-loops, -fpre‐
dictive-commoning and -fgcse-after-reload options.
I don’t see any of these options being unsafe? But yes, it is true that they
increase binary size. In Eigen 2, the function inlining is very important for
performance, as the code consists mainly of deeply nested, trivial functions.
So, if you get instability with -O3:
- are you sure that it is not because of some other option you enabled?
E.g. -ffast-math is certainly unsafe (breaks IEEE754).
- if you didn’t enable any unsafe optimization, and drawtool crashes
with -O3, either you discovered a bug in GCC, or I am wrong claiming that O3
is safe, or there is a real bug in drawtool. It already happened to me that a
bug only manifested itself with -O3, e.g. certain bad memory accesses. E.g.
imagine a situation where a bad memory access becomes “safe” when the bad
data is deep-copied into a temporary (e.g. as return value of a function) and
when enabling -O3 this bad data is no longer deep-copied (e.g. the function
got inlined) and therefore the bad memory access gets exposed.
Sorry for being such an a** (yeah I’m in North America right now so catching
up with the slang) it doesn’t matter to me whether Avogadro packages are
compiled with O2 or O3, I just wanted to clarify that technical point.
Cheers,
Benoit
Unless I hear about any major issues I intend to tag the 0.8 branch
tomorrow at noon (EST => GMT-5 I think). I think that it would be worth
backporting fixes to this branch as necessary to make 0.8.1, 0.8.2
releases as necessary. This release will also be placed in Kalzium as a
snapshot to be used in KDE 4.1 in a simplified editor.
Thanks,
Marcus
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft® Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avogadro-devel