[ale] tech "magic"
Jim Kinney
jim.kinney at gmail.com
Wed May 27 13:00:19 EDT 2009
On Wed, May 27, 2009 at 9:52 AM, Michael H. Warfield <mhw at wittsend.com> wrote:
> Sounds like an optimizer problem. Use to run into those all quite
> often at high optimizer settings. Sometimes entire loops would get
> optimized into non-existence and volatile variables were a laugh,
> especially in system/kernel code. I forget what compiler it was but I
> remember reading the documentation and the optimizer when from 0 (no
> optimization) through several levels that included in-line optimization
> and unrolling loops and speed vs size. The highest level of
> optimization was described in the documentation as "Dearly beloved we
> are gathered here...".
>
1. The code runs faster when it has nothing to do
2. ?
3. Optimized!
Was trying to automate a numerical process for gaussian fitting of
multiple peaks. It is a highly iterative process and took "too long".
Buried in my spaghetti I referenced a fixed parameter that caused the
iterative process to "succeed" after only one loop instead of the
50-200 loops. Since my test data was perfect (it was generated based
on known curve functions combined and then spit out "test data" with
no variance at all) AND, like a bozo I had chosen a triplet of
symmetric functions that were <doh!> evenly spaced, I got excellent
data back out in fast order. Everyone was happy. It looked great.
Then I fed it real data.
It ran great! It got a super fast, clean resultant set. The parameters
returned looked consistent with experiment and prior sample runs.
I totally missed the boat here. I forgot that the test data I
generated from known curve functions was using the theoretical curves
for the now experimental data set I was doing the real world test on.
So the data looked marvelous! It had to. The stupid programmer (me)
punted out the fitting process entirely and was able to generate curve
parameters for a single dataset only.
It was fun when other data was eventually put through this grinder. It
either gave the same results with a slight fuzz factor which slowed
down the single loop or it totally exploded and ate all ram and as
much drive space as it could find and crashed the box.
Fixed parameter name was one character different from correct
parameter name (which was calculated and determined convergence of
fit). m vs n . yeah. at 2 am I can tell the difference.
Bug type: codus erratus typographicus pinheadeous
--
--
James P. Kinney III
Actively in pursuit of Life, Liberty and Happiness
More information about the Ale
mailing list