CAMB: large l segmentation fault

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
A Stewart
Posts: 5
Joined: September 27 2007
Affiliation: McGill University

CAMB: large l segmentation fault

Post by A Stewart » January 09 2008

Hi all. I am trying to run CAMB with the values l_max_scalar = l_max_tensor = 22000, but when I do I get the following output:

Age of universe/GYr = 13.823
Om_b h^2 = 0.02186
Om_c h^2 = 0.11050
Om_nu h^2 = 0.00000
Om_Lambda = 0.73294
Om_K = 0.00000
Segmentation fault (core dumped)

I have run with l_max_scalar = l_max_tensor = 11600 before with no problems so I assume this is occuring simply because of the large l value. Also, I have looked around the forum and it appears as though others have successfully run at even higher l-values so I assume it is a problem with my particular setup. Can anyone help me out with this?

I am running under Linux on a P4 2.8GHz with 1GB or RAM and I compliled CAMB using:

F90C = gfortran
FFLAGS = -O2 -I$(INCDIR) -DGFORTRAN -fno-second-underscore

Anze Slosar
Posts: 183
Joined: September 24 2004
Affiliation: Brookhaven National Laboratory
Contact:

CAMB: large l segmentation fault

Post by Anze Slosar » January 10 2008

I tried running with lmax of 22000 for both scalar and tensor and k_eta twice that out of pure curiosity and had no problems - pretty sure it is gfortran. I suggest you try intel fortran...

Savvas Nesseris
Posts: 70
Joined: April 05 2005
Affiliation: UAM/IFT
Contact:

CAMB: large l segmentation fault

Post by Savvas Nesseris » January 11 2008

Hi,
I also tried that with gfortran (lmax_scalar = lmax_tensor = 22000) and I had no problems. I have gfortran for cygwin, based on gcc version 4.1.0 20051115.

You can see the version by typing gfortran -v. Try updating (since a couple of versions had some bugs) but before that try a fresh, "out of the box" version of CAMB (just in case)...

Cheers

P.S. The -fno-second-underscore is not actually needed in the FFLAGS, why did you add it?

A Stewart
Posts: 5
Joined: September 27 2007
Affiliation: McGill University

Re: CAMB: large l segmentation fault

Post by A Stewart » January 11 2008

Savas Nesseris wrote:Hi,
I also tried that with gfortran (lmax_scalar = lmax_tensor = 22000) and I had no problems. I have gfortran for cygwin, based on gcc version 4.1.0 20051115.

You can see the version by typing gfortran -v. Try updating (since a couple of versions had some bugs) but before that try a fresh, "out of the box" version of CAMB (just in case)...

Cheers

P.S. The -fno-second-underscore is not actually needed in the FFLAGS, why did you add it?
Since an entry for gfortran isn't in the Makefile by default I wasn't sure which flags to use. I took a look at the Makefile for Healpix and they use that flag so I thought I would include it just in case. You are right though it compiles just fine without it. Also, my gfortan is based on gcc 4.2.1.

In any case I think I have tracked down the problem. After installing ifort 10.1.008 and recompiling a fresh copy of CAMB my run crashed again but this time with more information:

Age of universe/GYr = 13.635
Om_b h^2 = 0.02270
Om_c h^2 = 0.11200
Om_nu h^2 = 0.00000
Om_Lambda = 0.73871
Om_K = 0.00000
Reion redshift = 11.634
tau_recomb/Mpc = 284.58 tau_now/Mpc = 14309.2
Reion redshift = 11.634
tau_recomb/Mpc = 284.58 tau_now/Mpc = 14309.2
forrtl: severe (41): insufficient virtual memory
Image PC Routine Line Source
camb 080E51FB Unknown Unknown Unknown
camb 080E481B Unknown Unknown Unknown
camb 080A6FFE Unknown Unknown Unknown
camb 08080AE2 Unknown Unknown Unknown
camb 08094D92 Unknown Unknown Unknown
camb 0807334C Unknown Unknown Unknown
camb 0807A1D0 Unknown Unknown Unknown

So it appears as though it was just a memory problem. In my params.ini file I set accuracy_boost = l_accuracy_boost= l_sample_boost = 1 (I originally had them all = 2) and my run goes through fine now regardless of whether I compile with ifort or gfortran.

Thanks for the help Anze and Savas!

Savvas Nesseris
Posts: 70
Joined: April 05 2005
Affiliation: UAM/IFT
Contact:

CAMB: large l segmentation fault

Post by Savvas Nesseris » January 11 2008

Since an entry for gfortran isn't in the Makefile by default I wasn't sure which flags to use. I took a look at the Makefile for Healpix and they use that flag so I thought I would include it just in case. You are right though it compiles just fine without it
The reason they do it is because they have to mix C with Fortran and the flag -fno-second-underscore solves the difference in naming between the languages. When in doubt use the nm program and check the .o files created by both the C and F90 compilers.

Regarding the fact that an entry for gfortran isn't in the Makefile this was answered in a thread some time ago:
http://cosmocoffee.info/viewtopic.php?t=829

checking older threads can save you from wasting time!

Cheers

A Stewart
Posts: 5
Joined: September 27 2007
Affiliation: McGill University

Re: CAMB: large l segmentation fault

Post by A Stewart » January 14 2008

Savas Nesseris wrote:Regarding the fact that an entry for gfortran isn't in the Makefile this was answered in a thread some time ago:
http://cosmocoffee.info/viewtopic.php?t=829

checking older threads can save you from wasting time!

Cheers
Actually I was aware of that thread. In fact I used the ! trick to compile using gfortran (thanks for that one too btw). However, nothing there was helping me with my segmentation fault problem so I left my flags the way they were.

On another note, I was able to run with accuracy_boost = l_accuracy_boost = 2 on a machine with 2GB RAM and 1GB Swap. More evidence that it really was low memory all along.

Post Reply