CosmoMC is the Cosmological MonteCarlo code. It comes as a Fortran code with various supporting Python packages. The Fortran code is capable of running in parallel, using all cores on the PC, to speed calculations - to do this is needs to be built with MPI capabilities.
To build the Fortran component follow these steps:
module load mpi
cd
git clone https://github.com/cmbant/CosmoMC.git
- which will download a copy of the program source code to a folder called CosmoMCcd CosmoMC
make all
to compile the code. There will be some compiler warnings, but there should not be any fatal errors.cosmomc
and you can run a simple test by typing ./cosmomc test.ini
mpirun ./cosmomc test.ini
To run the Python scripts associated with CosmoMC you will need to install the GetDist module into your Python environment.
PYTHONPATH
in your ~/.bashrc
file. Set either:export PYTHONPATH=$HOME/CosmoMC/python:$PYTHONPATH
if you already define PYTHONPATH
export PYTHONPATH=$HOME/CosmoMC/python
if you don't have any other definitions of PYTHONPATH
PYTHONPATH
)anaconda
moduleCosmoMC/python
directory run python setup.py install
python setup.py test
To run the GetDistGUI.py script you need to install the Python PySide library. You can do this in Anaconda by running conda install PySide
. Then run the GUI by either typing python GetDistGUI.py
or else make the script executable (chmod +x GetDistGUI.py
) and then run ./GetDistGUI.py
.