cmbant / cosmomc Goto Github PK
View Code? Open in Web Editor NEWMCMC parameter sampling code
Home Page: https://cosmologist.info/cosmomc/
MCMC parameter sampling code
Home Page: https://cosmologist.info/cosmomc/
I have trouble with installing the latest CosmoMC, it is different between CosmoMC-Nov16 with CosmoMC-Oct19, I do not know how to install CosmoMC. Could you give me some advice?
I am using ifort version 18
and I am still getting this menage;
ObjectLists.f90:501:17:
allocate(this%Items, source = TmpItems)
1
Error: Array specification required in ALLOCATE statement at (1)
ObjectLists.f90:328:21:
allocate(Pt%P, source= P)
1
Error: Array specification required in ALLOCATE statement at (1)
Hi there,
tested under gfortran-10.3.0, this "Info" pointer is leaking at each Cls evaluation.
From Calculator_CAMB.f90
:
``
subroutine CAMBCalc_GetNewTransferData(this, CMB,Info,Theory,error)
...
class(TTheoryIntermediateCache), pointer :: Info
...
allocate(Info, source=this%DefaultInstance)
``
A possible fix is to keep the same all along the runs with:
if (.not.associated(Info)) allocate(Info, source=this%DefaultInstance)
or, maybe, writing an explicit deallocation in the Clear procedure, which is currently empty?
In GeneralType.f90
``
subroutine TTheoryIntermediateCache_Clear(Info)
class(TTheoryIntermediateCache) Info
end subroutine TTheoryIntermediateCache_Clear
``
Dunno what is best!
I have successfully compiled the CosmoMC on cori@nersc. However, while running "mpirun -np 1 ./cosmomc test_planck.ini", it crashes with following output:
The modules loaded in the environment are :
kumasura@cori09:~/CosmoMC-Nov2016> module list
Currently Loaded Modulefiles:
I am using the latest version of CosmoMC and CAMB. Both CosmoMC and CAMB are not modified. When I try to run a chain with varying nnu and meffsterile, the program stops with the error "CAMB error HMCode INTEGRATE, Integration timed out". The input parameter file is taken from the Planck chain base_nnu_meffsterile_plikHM_TT_lowl_lowE.
hi,
trying to compile CosmoMC
at d2c16d6 on an Archlinux 64b with gfortran-5.3.0, I get:
$ gfortran --version
GNU Fortran (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
$ git clone https://github.com/cmbant/CosmoMC cosmomc
$ cd cosmomc
$ make BUILD=gfortran
[...]
gfortran -cpp -O3 -ffast-math -ffree-line-length-none -fopenmp -fmax-errors=4 -march=native -I../camb/Release -JRelease -IRelease/ -c ObjectLists.f90 -o Release/ObjectLists.o
ObjectLists.f90:499:17:
allocate(this%Items, source = TmpItems)
1
Error: Array specification required in ALLOCATE statement at (1)
ObjectLists.f90:326:21:
allocate(Pt%P, source= P)
1
Error: Array specification required in ALLOCATE statement at (1)
Makefile:272: recipe for target 'Release/ObjectLists.o' failed
make[1]: *** [Release/ObjectLists.o] Error 1
on a ubuntu-14.04, with gfortran-4.8.2, I get:
$ gfortran --version
GNU Fortran (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
$ make BUILD=gfortran
[...]
gfortran -cpp -O3 -ffast-math -ffree-line-length-none -fopenmp -fmax-errors=4 -march=native -I../camb/Release -JRelease -IRelease/ -c FileUtils.f90 -o Release/FileUtils.o
FileUtils.f90:15.45:
character(LEN=:), allocatable :: mode
1
Error: Deferred-length character component 'mode' at (1) is not yet supported
FileUtils.f90:12.23:
Type :: TFileStream
1
Error: Finalization at (1) is not yet implemented
FileUtils.f90:15.45:
character(LEN=:), allocatable :: mode
1
Error: Deferred-length character component 'mode' at (1) is not yet supported
FileUtils.f90:15.45:
character(LEN=:), allocatable :: mode
1
Error: Deferred-length character component 'mode' at (1) is not yet supported
Fatal Error: Error count reached limit of 4.
could this be fixed (short of installing ifort
, of course...)
-s
Hi,
I am having issues installing CosmoMC. I am attempting to install on a fresh CentOS 8 with built-from-source gcc/gfortran 8.3.1. When running 'make,' it fails with this output about -c not being a valid option for cpp (but it definitely is a valid option).
CosmoMC]$ make
cd ./source && make cosmomc BUILD=MPI
which: no ifort in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/dell/srvadmin/bin:/home/wonyongc/bin)
make[1]: Entering directory /home/wonyongc/CosmoMC/source' mkdir -p ReleaseMPI cd ../camb/fortran && \ make --file=Makefile_main libcamb OUTPUT_DIR=ReleaseMPI \ FORUTILSPATH=/home/wonyongc/CosmoMC/source/../camb/forutils make[2]: Entering directory
/home/wonyongc/CosmoMC/camb/fortran'
make -C ReleaseMPI --no-print-directory -f../Makefile FORUTILS_SRC_DIR=.. libforutils.a
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o MiscUtils.o -c ../MiscUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [MiscUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o MpiUtils.o -c ../MpiUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [MpiUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o StringUtils.o -c ../StringUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [StringUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o ArrayUtils.o -c ../ArrayUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [ArrayUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o FileUtils.o -c ../FileUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [FileUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o IniObjects.o -c ../IniObjects.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [IniObjects.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o RandUtils.o -c ../RandUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [RandUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o ObjectLists.o -c ../ObjectLists.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [ObjectLists.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o MatrixUtils.o -c ../MatrixUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [MatrixUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o RangeUtils.o -c ../RangeUtils.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [RangeUtils.o] Error 1 (ignored)
cpp -ffree-line-length-none -fmax-errors=4 -MMD -fopenmp -fPIC -O3 -ffast-math -DMPI -o Interpolation.o -c ../Interpolation.f90
cpp: fatal error: ‘-c’ is not a valid option to the preprocessor
compilation terminated.
make[5]: [Interpolation.o] Error 1 (ignored)
ar -r libforutils.a MiscUtils.o MpiUtils.o StringUtils.o ArrayUtils.o FileUtils.o IniObjects.o RandUtils.o ObjectLists.o MatrixUtils.o RangeUtils.o Interpolation.o
ar: creating libforutils.a
ar: MiscUtils.o: No such file or directory
make[5]: *** [libforutils.a] Error 1
make[4]: *** [directories] Error 2
make[3]: *** [ReleaseMPI] Error 2
make[2]: *** [libforutils] Error 2
make[2]: Leaving directory /home/wonyongc/CosmoMC/camb/fortran' make[1]: *** [camb] Error 2 make[1]: Leaving directory
/home/wonyongc/CosmoMC/source'
make: *** [cosmomc] Error 2
Have you seen this issue before? Could you please advise?
Thank you.
I have opened this issue with Pantheon:
More details:
https://arxiv.org/abs/1905.00221v1
To me at least, these seem shocking. A lot of people include Pantheon in their cosmological fits/scans, without taking any close look at the data, primarily only because it's available through cosmoMC as a black box. I think this is dangerous.
I just found some unidentified problem in the DR12 CMASS likelihood code.
With a clean installation, compiled with Intel Fortran, if you add DEFAULT(batch3/BAO.ini)
to the test.ini
file and you run cosmomc, you get
Test likelihoods done, parameter point rejected (logZero or outside prior)
.
This doesn't happen if you remove the CMASS data with bao_dataset[DR12CMASS] =
.
Does it happen only to me? Is it a known problem?
I'll try to study the details of the code next week.
Dear all,
I am using cosmomc as generic sampler. I tested it for action=4 mode and it works well.
However, the chains always run for a long time but will meet a strange error and then will never continue...
It looks like:
Chain 10 MPI communicating
TRealArrayList: object of wrong type
mpirun has exited due to process rank 9 with PID 35466 on....
Is there any suggestions on this error? What is TRealArrayList warning?
Thank you very much!
bnu
Hi. I'm trying to install CosmoMC with Planck2015 data. And I have the following error:
cliklike.f90(2): error #7013: This module file was not generated by any release of this compiler. [CLIK]
use clik
--------^
cliklike.f90(13): error #6457: This derived type name has not been declared. [TCMBLIKELIHOOD] type, extends(TCMBLikelihood) :: ClikLikelihood
I was wonder if you can help me.
Uncertain if this is an issue with the code or with my system, but I'm trying to compile the code with gfortran 6.0.0 (20151213) on my Mac (10.9.4) and am getting the following compilation error:
gfortran -cpp -O3 -ffast-math -ffree-line-length-none -fopenmp -fmax-errors=4 -JRelease -IRelease/ -c utils.F90 -o Release/utils.o
/var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:11890:suffix or operands invalid formovq' /var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:11900:suffix or operands invalid for
movq'
/var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:11905:suffix or operands invalid formovq' /var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:12032:suffix or operands invalid for
movq'
/var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:12294:suffix or operands invalid formovq' /var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:12590:suffix or operands invalid for
movq'
/var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:12606:suffix or operands invalid formovq' /var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:12613:suffix or operands invalid for
movq'
/var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:12748:suffix or operands invalid formovq' /var/folders/x9/0wlz8wlx0fs3s2xh1lbt9z4r0000gn/T//cczbEKUL.s:13083:suffix or operands invalid for
movq'
make[2]: *** [Release/utils.o] Error 1
make[1]: *** [camb] Error 2
make: *** [cosmomc] Error 2'
I'm getting a segfault on the master branch when compiled on my local machine (but not on HPC). I'm using gfortran compilers (8.2.1), and when I compile and run ./cosmomc_debug test.ini
, it terminates during the BK15 call with the rather unilluminating gfortran compiler message:
Fortran runtime error: Index '2' of dimension 1 of array 'cls' outside of expected range (4589580917435080532:600)
Putting in some print statements tells me that at this point,
this%nmaps = this%nmaps_required = 12
i=3
j=1
lbound(Cls(i,j)%CL) = 1
ubound(Cls(i,j)%CL) = 0
this%pcl_lmin = 2
this%pcl_lmax = 600
which appears to be causing the issue when it tries to slice this array Cls(i,j)%CL(this%pcl_lmin:this%pcl_lmax)
Any ideas what might be going wrong here?
When running the minimizer with action=2 in the CosmoMC May 2020 release (for example, on the Planck 2018 data or BAO compilation), it crashes every time with output similar to:
Caught signal 11 (Segmentation fault: address not mapped to object at address (nil))
The stack looks like:
0 0x0000000000010e90 __funlockfile() ???:0
1 0x00000000007bd4ba __intel_avx_rep_memcpy() ???:0
2 0x00000000006cca34 do_alloc_copy() for_alloc_copy.c:0
3 0x00000000006cceef do_alloc_copy() for_alloc_copy.c:0
4 0x00000000006ce10c for_alloc_assign_v2() ???:0
5 0x00000000005ae7ac results_mp_cambdata_setparams_() ???:0
6 0x00000000004a2ce7 calculator_camb_mp_cambcalc_initcamb_() ???:0
7 0x000000000049f24d calculator_camb_mp_cambcalc_cmbtotheta_() ???:0
8 0x0000000000545928 cosmologyparameterizations_mp_tp_paramarraytotheoryparams_() ???:0
9 0x000000000048d62f calclike_cosmology_mp_tcosmolikecalculator_settheoryparams_() ???:0
10 0x000000000054bb0a calclike_mp_theorylike_getloglikemain_() ???:0
11 0x00000000005499c9 calclike_mp_getloglike_() ???:0
12 0x000000000046fd56 minimize_mp_tpowellminimizer_findbestfit_() ???:0
13 0x0000000000554c22 MAIN__() ???:0
14 0x000000000040f34e main() ???:0
15 0x00000000000202e0 __libc_start_main() ???:0
16 0x000000000040f26a _start() /tmp/nix-build-glibc-2.24.drv-0/glibc-2.24/csu/../sysdeps/x86_64/start.S:120
I've seen this issue appear in CosmoCoffee (https://cosmocoffee.info/viewtopic.php?t=3207); however, the fix to camb/fortran/
mentioned near the end seems to already be implemented, yet it still results in the above error.
Any help would be appreciated. Thanks!
The Pantheon SN1e compilation as included with CosmoMC has wrong peculiar velocity corrections carried over in it.
More details have been reported here :
More specific to CosmoMC, the data at https://github.com/cmbant/CosmoMC/blob/master/data/Pantheon/lcparam_full_long.txt have exactly the same values for zcmb and zhel, indicating that only the 'corrected' redshifts are being used in the cosmological parameter estimation. I urge caution.
Hi, I added a new parameter in camb, which I want to vary using MH. First I put this parameter as fixed to some value, to obtain Cl's from camb, but I obtain the following error:
forrtl: severe (174): SIGSEGV, segmentation fault occurred
I'm using equations_ppf.f90.
Hi,
I think the prior on the scatter parameter sigmaM, in line:
Line 2014 in d34a8d3
should be
(cosmopar%sigmaM-0.173)**2./(2.*0.023**2.)
rather than
(cosmopar%sigmaM-0.075)**2./(2.*0.01**2.)
because I think that the routine uses the parameter sigmaM defined in natural log, as described in the 2015 Planck SZ cluster paper (table 1 of https://arxiv.org/pdf/1502.01597.pdf and footnote c of the table), as can be seen here:
Line 1282 in d34a8d3
(Or maybe I am missing a conversion from natural log to base 10 log...?)
If this needs to be corrected, then these lines:
CosmoMC/batch2/SZ_plus_CMB.ini
Line 14 in d34a8d3
CosmoMC/batch2/SZ_plus_priors.ini
Line 15 in d34a8d3
in the input files should also be updated to be with respect to the natural log value of 0.173\pm0.023.
Dear CosmoMC team,
I run the sampling with action=0 and set estimate_propose_matrix=T, but the codes stop with finding out the best-fit point without going on for the MCMC sampling.
This is quite different with the Readme's information.
Could you help me with that?
Thank you very much.
Shuo
In subroutine BK_ParamArrayToTheoryParams of source/CosmologyParametrization.f90 are these correct initialization
CMB%h=CMB%H0/100
h2 = CMB%h**2
CMB%Yhe=0.24
CMB%omnu = CMB%omnuh2/h2
CMB%omb= omegam - CMB%omnu
CMB%ombh2 = CMB%ombh2
CMB%omc=0
CMB%omch2 = CMB%omch2
CMB%zre=0
CMB%tau=0
CMB%omdmh2 = CMB%omch2+ CMB%omnuh2
CMB%omdm = CMB%omdmh2/h2
CMB%omv = 1- CMB%omk - CMB%omb - CMB%omdm
CMB%nufrac=CMB%omnuh2/CMB%omdmh2
CMB%reserved=0
CMB%fdm=0
CMB%iso_cdm_correlated=0
CMB%Alens=1
Please let me know.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.