[Biodevelopers] Blastall core dump on Alpha running Redhat 7.2
cdwan
cdwan at mail.ahc.umn.edu
Mon May 17 18:01:40 EDT 2004
The bug I reported before turns out to have a pretty simple resolution:
gcc needs the "-mieee" flag on this platform to correctly perform this
bit of math on my particular platform. I added the flag to
"platform/linux.ncbi.mk" and have created a set of binaries which can
successfully align my sequences.
Here's the rest of the story, for the interested: I took Joe and
Iddo's advice, and made a little test program with my lethal values,
which generate the underflow.
[cdwan at alpha alpha]$ more test.c
#include <math.h>
#include <stdio.h>
int main () {
double Lambda, searchsp, score, logK;
Lambda = 1.374063;
score = 518;
searchsp = 351649;
logK = -0.341642;
printf ("Hello world\n");
printf ("(-Lambda * score): %e\n", -Lambda * score);
printf ("(-Lambda * score) + logK: %e\n", (-Lambda * score) + logK);
printf ("exp(that): %e\n", exp((-Lambda * score) +
logK));
printf ("searchsp * exp(that): %e\n", searchsp * exp((-Lambda *
score) + logK
));
printf("Goodbye world\n");
}
Then I built it in a very minimal way:
[cdwan at alpha alpha]$ /usr/local/bin/gcc -o test test.c -lm
[cdwan at alpha alpha]$ ./test
Hello world
(-Lambda * score): -7.117646e+02
(-Lambda * score) + logK: -7.121063e+02
exp(that): 5.447206e-310
Floating exception (core dumped)
It's interesting to me that the underflow happens on a multiplication
step which should make the number in question *larger*. My guess is
that somewhere in the guts of the multiplication routine for floating
point numbers, they do something clever and fast which can result in a
smaller number as an intermediate value.
I'll skip all the incorrect compiler flags I tried, and go right to
this:
[cdwan at alpha alpha]$ /usr/local/bin/gcc -o test test.c -mieee -lm
[cdwan at alpha alpha]$ ./test
Hello world
(-Lambda * score): -7.117646e+02
(-Lambda * score) + logK: -7.121063e+02
exp(that): 5.447206e-310
searchsp * exp(that): 1.915505e-304
Goodbye world
I suggest that NCBI add the "-mieee" flag to their DEC makefiles.
I also suggest that (as usual), everybody should check all their
results, look for core files, and never ever trust a computer.
Sometimes, "no hits" doesn't really mean "no hits."
-Chris Dwan
More information about the Biodevelopers
mailing list