brinckmann / montepython_public

Public repository for the Monte Python Code
MIT License
92 stars 78 forks source link

How to apply other parameter file? #358

Open dlalstjq opened 5 months ago

dlalstjq commented 5 months ago

Hello! I'm a student studying cosmology I installed montepython following README file and it worked when input file is input/example.param. But I get error like under when input is another parameter file. I don't know how to solve this problem, How can I solve this error?

(base) minsub@Lee:/home/minsub/data/montepython_public-3.6$ python montepython/MontePython.py run -p input/base2015TTTEEE.param -o chains/base2015TTTEEE -N 100000 /!\ PyMultiNest detected but MultiNest likely not installed correctly. You can safely ignore this if not running with option -m NS /!\ Appending to an existing folder: using the log.param instead of input/base2015TTTEEE.param Running Monte Python v3.6.0

Traceback (most recent call last): File "/home/minsub/data/montepython_public-3.6/montepython/run.py", line 191, in safe_initialisation cosmo, data, command_line, success = initialise(custom_command) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/minsub/data/montepython_public-3.6/montepython/initialise.py", line 67, in initialise data = Data(command_line, path) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/minsub/data/montepython_public-3.6/montepython/data.py", line 214, in init self.fill_mcmc_parameters() File "/home/minsub/data/montepython_public-3.6/montepython/data.py", line 401, in fill_mcmc_parameters self.read_file(self.param, 'data') File "/home/minsub/data/montepython_public-3.6/montepython/data.py", line 581, in read_file exec(statement.rstrip()) File "", line 1, in KeyError: 'cosmo'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/minsub/data/montepython_public-3.6/montepython/MontePython.py", line 40, in sys.exit(run()) ^^^^^ File "/home/minsub/data/montepython_public-3.6/montepython/run.py", line 31, in run cosmo, data, command_line, success = safe_initialisation( ^^^^^^^^^^^^^^^^^^^^ File "/home/minsub/data/montepython_public-3.6/montepython/run.py", line 206, in safe_initialisation raise io_mp.ConfigurationError( io_mp.ConfigurationError:

Configuration Error: /|\ You are running in a folder that was created following a non-successful /o\ initialisation (wrong parameter name, wrong likelihood, etc...). If you have solved the issue, you should remove completely the output folder, and try again. Alternatively, there could be a problem with 'cosmo'

double free or corruption (!prev) Aborted (core dumped)

Thanks to advice

dlalstjq

brinckmann commented 5 months ago

Hi,

For each new run (e.g. with a new parameter file) you need to create a new chains directory, you cannot run in an existing one.

This is all explained in the MontePython guides on the course page of Julien Lesgourgues and a recorded lecture from the CosmoTools18 school . You might also find useful information in the official MontePython paper . I hope this helps.

Best, Thejs

dlalstjq commented 5 months ago

Thanks to advice.

I run the code with new directory, and I find the reason of error. I think something wrong in install planck likelihood part.

so I reset my computer and reinstall montepython, planck likelihood, but I faced new problems.

(base) [minsub@HEPG01 plc-3.01]$ ./waf configure --lapack_mkl=${MKLROOT} --install_all_deps Setting top to : /home/minsub/planck/code/plc_3.0/plc-3.01 Setting out to : /home/minsub/planck/code/plc_3.0/plc-3.01/build Checking for program 'gcc, cc' : /home/minsub/anaconda3/bin/gcc Checking for program 'ar' : /usr/bin/ar Check gcc version : 13.2.0 Compile a test code with gcc : yes Setting architecture flag to : ['-m64'] Checking for program 'ifort' : not found ifort not found, defaulting to gfortran (cause: 'Could not find the program ['ifort'] (complete log in /home/minsub/planck/code/plc_3.0/plc-3.01/build/config.log)') Checking for program 'gfortran, g77' : /usr/bin/gfortran Checking for program 'ar' : /usr/bin/ar Check gfortran version : not found, let's hope for the best... Compile a test code with gfortran : yes retrieve gfortran link line : ok fortran link line : -L/home/minsub/planck/code/plc_3.0/plc-3.01 -lgfortran -lgomp Setting install root to : /home/minsub/planck/code/plc_3.0/plc-3.01 Setting install bin directory to : /home/minsub/planck/code/plc_3.0/plc-3.01/bin Setting install lib directory to : /home/minsub/planck/code/plc_3.0/plc-3.01/lib Setting install include directory to : /home/minsub/planck/code/plc_3.0/plc-3.01/include Checking for program 'python' : /home/minsub/anaconda3/bin/python Checking for python version : 3.11.5 python-config : /home/minsub/anaconda3/bin/python3.11-config Asking python-config for pyembed '--cflags --libs --ldflags --embed' flags : yes Testing pyembed configuration : Could not build a python embedded interpreter No suitable python distribution found Cause : 'The configuration failed (complete log in /home/minsub/planck/code/plc_3.0/plc-3.01/build/config.log)' Compilation will continue without it (but I strongly advise that you install it) Checking for library dl : yes checking for RTLD_DEFAULT in dl : no compile with debug option : OFF Checking for program 'pmc-config' : not found Checking for library pmc : not found Check mkl version : 10.3 create specific mkl lib : /home/minsub/planck/code/plc_3.0/plc-3.01/lib/libclik_mkl.so Checking for library ['clik_mkl', 'iomp5', 'pthread', 'm'] : not found lapack not found check that lapack_prefix or lapack_lib and lapack_include command line options point toward your lapack install or check that lapack is compiled in 64 bit or install automatically using cmdline option --lapack_install The configuration failed (complete log in /home/minsub/planck/code/plc_3.0/plc-3.01/build/config.log)

when I run before reset, "Testing pyembed configuration" returned yes. how do I solved this problem?

Thanks to answer. dlalstjq.

brinckmann commented 5 months ago

Hi,

It looks like it's having problems with your Python installation. This can be tricky, you'll want to make sure it knows about the relevant python directories, that they're specified in the relevant system paths, and is trying to run the right python installation, although sometimes I've been able to install Planck with the python wrapper even when it throws some Python errors, it can be a bit finnicky. Also, you see it has a problem with your lapack installation and gives you a suggestion for what to do.

Since this is not a MontePython issue our help will be limited. Here are ways to get further information on installing Planck:

Best, Thejs