CAMB execution bug, floating-point related

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Dragan Huterer
Posts: 26
Joined: July 18 2005
Affiliation: University of Michigan
Contact:

CAMB execution bug, floating-point related

Post by Dragan Huterer » May 05 2016

I compiled CAMB on my new desktop that runs OS X 10.11.4. The gfortran and gcc version is 5.3.0 (each). CAMB compiles fine. But on execution I get the following error

Code: Select all

kingjames:CL_THEORY huterer$ ~/numeric/CAMB/camb my_params.ini 
at z =  0.000 sigma8 (all matter) =  0.7930
at z =  0.000 sigma8^2_vd/sigma8  =  0.4066
Note: The following floating-point exceptions are signalling: IEEE_UNDERFLOW_FLAG
Googling this message, I see hints to add to compilation flags some or all of the following
-fbacktrace -ffpe-trap=invalid,overflow,underflow,zero
(and a couple of others that don't make a difference). Once I do that + recompile, I get a slightly different error message:

Code: Select all

kingjames:CL_THEORY huterer$ ~/numeric/CAMB/camb my_params.ini 

Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

Backtrace for this error:
#0  0x10eafc8c6
#1  0x10eafc08c
#2  0x7fff93f65529
Floating point exception: 8
Any ideas?

Antony Lewis
Posts: 1659
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: CAMB execution bug, floating-point related

Post by Antony Lewis » May 05 2016

As far as I know the underflow message is harmless. (you could compile with debug flags and -fbacktrace to get meaningful stack trace in your second case)

Dragan Huterer
Posts: 26
Joined: July 18 2005
Affiliation: University of Michigan
Contact:

CAMB execution bug, floating-point related

Post by Dragan Huterer » May 06 2016

You were right - the underflow message (in the first example I gave) was indeed harmless, and CAMB completed the execution just fine.

The reason for the bug in my larger code that uses CAMB was nevertheless interesting, though. New-ish CAMB (January 2016, from the comments on the website) adds more columns to the output transfer file, and both it and matterpower.dat also have a line of variable descriptions while they didn't before. This confused my code that read these files.

Post Reply