Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when computing sigma_8 #204

Open
anicola opened this issue Mar 25, 2018 · 5 comments · May be fixed by #309
Open

Error when computing sigma_8 #204

anicola opened this issue Mar 25, 2018 · 5 comments · May be fixed by #309

Comments

@anicola
Copy link

anicola commented Mar 25, 2018

Hi,

We are experiencing a problem with the computation of sigma_8 in class. For some parameter values we get the error:

Error in Class: spectra_init(L:1268) :error in spectra_pk(pba,ppt,ppm,pnl,psp);
=>spectra_pk(L:2673) :error in spectra_sigma(pba,ppm,psp,8./pba->h,0.,&(psp->sigma8));
=>spectra_sigma(L:2764) :error in spectra_pk_at_k_and_z(pba,ppm,psp,k,z,&pk,pk_ic);
=>spectra_pk_at_k_and_z(L:683) :error in spectra_pk_at_z(pba, psp, logarithmic, z, spectrum_at_z, spectrum_at_z_ic);
=>spectra_pk_at_z(L:413) :error in array_interpolate_spline(psp->ln_tau, psp->ln_tau_size, psp->ln_pk, psp->ddln_pk, psp->ln_k_size, ln_tau, &last_index, output_tot, psp->ln_k_size, psp->error_message);
=>array_interpolate_spline(L:1778) : x=9.592536e+00 > x_max=9.592536e+00

The error occurs only on certain systems. One of our computers is a Mac and it does not seem to give this error while the Linux machine runs into this problem rather often. We therefore suspect that it is a rounding error and we would like to ask you if you know what could be causing it and how to fix it?

Thank you very much!
All the best,
Johannes and Andrina

classy input parameters:

params = {
'output': 'tCl lCl mPk',
'100*theta_s': 1.0421829514674998,
'omega_cdm': 0.10492879400756622,
'omega_b': 0.021001963919232779,
'm_ncdm': 0.06,
'T_ncdm': 0.71611,
'k_pivot': 0.05,
'A_s': 2.19799824287449e-09,
'P_k_max_h/Mpc': 250.0,
'n_s': 1.0219347689978246,
'N_ur': 2.0328,
'k_min_tau0': 0.005,
'N_ncdm': 1,
'tau_reio': 0.073094629044902298,
'z_pk': 0.067
}

@emiliobellini
Copy link

Hi,
I am experiencing the same problem both on my laptop and desktop (Linux both).
Also to me it seems a rounding problem. The strange thing is that I tried the parameters that Johannes and Andrina were suggesting and it works for me.. I have this problem with other quite standard parameters.
I tried to change the version of gcc. With 5.5, 6.4, and 7.3 it doesn't work, with 8.0.1 it works..

Any idea?

Best,
Emilio

@ThomasTram
Copy link
Collaborator

Hi

This issue surfaced before (#109) but I could not reproduce it back then. That issue offers a temporary fix which may work. On my machine I am not getting an error, but as Emilio says, it is probably compiler-specific. What compiler are you using?

Cheers,
Thomas

@fkoehlin
Copy link

fkoehlin commented May 8, 2018

Hi all,

I can confirm this issue for CLASS 2.6.3 on Ubuntu 16.04.9 with gcc 5.4.0 (20160609). Switching to gcc 4.8 (i.e. install that version in parallel from the Ubuntu repositories via sudo apt-get install gcc-4.8 and modify the 'gcc' entry in CLASS' Makefile to 'gcc-4.8') seems to solve the issue for me, so it's indeed 'just' some compiler hiccup.
It's quite a tedious hiccup though especially in combination with the 'missing symbol' error-message (e.g. just found again with gcc 7.3.1 (20180303) on Red Hat 7.3.1-5 but for CLASS 2.5.0; maybe that is fixed since 2.6.X?) I also ran into several times depending on which gcc version was used...

Cheers,
Fabian

@noller
Copy link

noller commented May 15, 2018

Hi all,

the issue Andrina and I had was for almost the exact same setup as for Fabian -- also with gcc 5.4.0 (20160609) and on Mint 18.1 (which is based on Ubuntu 16.04). We'll try with 4.8 and 8.0.1, given that those worked for Emilio and Fabian.

Many thanks for your help guys!

rainwoodman added a commit to rainwoodman/class_public that referenced this issue Feb 12, 2020
This presumably fixes lesgourg#204.

Would some test this? If it indeed fixes the issue, then we
can add it too all variants.
@rainwoodman rainwoodman linked a pull request Feb 12, 2020 that will close this issue
@henriquerubira
Copy link

my suggestion to bypass this issue is: in the function array_interpolate_spline (in tools/arrays.c) you change the boarder errors. I simply changed if (x > x_array[sup]) to if (x-1e-9 > x_array[sup])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants