Cosmo MC help: What to learn first?

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Birses Debir

Cosmo MC help: What to learn first?

Post by Birses Debir » February 22 2014

I know nearly nothing about programming. My goal is to be able to use Cosmo MC by june but I don't know where to start. Please guide me: What are the things that I should learn to use Cosmo MC? Is june a reasonable target for someone at my level?
I am looking forward to your response.
Regards,
Birses
Last edited by Birses Debir on November 27 2019, edited 1 time in total.

Mohammad Ahsan
Posts: 1
Joined: February 23 2014
Affiliation: Canterbury University

Cosmo MC help: What to learn first?

Post by Mohammad Ahsan » February 23 2014

Hi
Find someone at your own institution to guide you. Learning on ones own takes a lot longer. You can start by learning to code in Fortran. Google will list a lot of tutorials any one of which you can go through. You can go through the book "Fortran 90/95 for Scientists and Engineers". Sitting in a programming course at your own University is not a bad idea. Learn to use python so that you can make the pretty contour and all those other plots. Get a free operating system like this one http://www.ubuntu.com/ Familiarize yourself with how you would install cosmomc/camb/class or Healpix. Understand how make files work.
good luck
Ahsan

Jason Dossett
Posts: 97
Joined: March 19 2010
Affiliation: The University of Texas at Dallas
Contact:

Cosmo MC help: What to learn first?

Post by Jason Dossett » February 23 2014

I agree with everything Mohammad said. It will be very helpful if you can find someone who can give you some tips on things. Jumping into programming without much experience on ones own can be quite a challenge. Depending on whether you want a more windows like interface, I would personally recommend Linux Mint http://www.linuxmint.com as an easy to pick up Linux OS. It is a fork of ubuntu so still has all the infrastructure but is running on a much more intuitive interface.

Next, I would reccommend going to http://software.intel.com/en-us/intel-e ... -offerings and purchasing some intel compilers. They are quick and, as of right now, needed for installing and running CosmoMC.

Sheng Li
Posts: 57
Joined: May 26 2009
Affiliation: University of Sussex
Contact:

Re: Cosmo MC help: What to learn first?

Post by Sheng Li » February 25 2014

Birses Debir wrote:I know nearly nothing about programming. My goal is to be able to use Cosmo MC by june but I don't know where to start. Please guide me: What are the things that I should learn to use Cosmo MC? Is june a reasonable target for someone at my level?
I am looking forward to your response.
Regards,
Birses
First, it is ComsoMC not "Cosmo MC".

Second, with regard to your question:
Fortran is the easiest understandable programming language amongst all comp-lang, as far as I can tell [the other less easy one is lisp].

So, do learn sth in fortran per day, but with practical tasks such as doing some basic mathematics in Fortran90/95. Then maybe 2 wks later, you can further to learn the latest features in Fortran03 [then practice for 1-2wks, now totally the first stage will take you 1mth. hence for example you are close to the end of March if you start this task today].

If you know or prefer object oriented programming (oop), you should do so with oop style in Fortran03. Supposing 3 wks later from the day you are familiar with oop in fortran03 (but subject to what you learn and practice every day, little by little and be patient.), you can go to read(*) camb codes in the end of April this year.

(*) "read" does not mean to read all source files in camb folder from the beginning to the end, but to know the structure of camb source. Because you will have already known what is fortran code and how to code in fortran due to the past 2mths experience, you just read, i think, which file(s) will be the key file(s) for making change in interest of your project. The description for these file(s) can be found in *readme* from cosmomc webpage.

It may take you about 1mth, or more, to understand the structure and function of camb code, I think. Even a bit longer if you want to draw the flow chart for camb. However, if you just modify an existing code which is very close to your project, you will save much time in managing modification for your purpose.

And regarding the source files under source folder, you can follow the (*) and repeat the steps above, then, hopefully you are in the right way by this June knowing how to add parameters or modify parameters under source folder, in order to use MCMC exploration.

It is not guaranteed that you will definitely use CosmoMC by June (or in only three months), but remember you are a beginner of programming, and there would be sth unexpected in your learning.

Let me go back to my points.
1: It is easy to learn Fortran (even within 2 wks), but not easy to get used to and modify CosmoMC (maybe not in 3 mths because you may have to learn a bit about MPI because CosmoMC is MPI-adicted), if you will have to develop your own functions and algorithms and making them work with CosmoMC. All these difficulties and hardships do not include any time consumption in debugging your code which generically happened and you will inevitably suffer.

2: It will be easier in only changing parameter's value, or say key-value pair, and having it a test run.

So, finding one experienced person by hand, and doing work in collaboration will make life easier. If you prefer or are strong in physics, then tell your collaborator clearly so as to realise your attempts. Otherwise, you may have to do every thing from the scratch. That is a job of time consumption, but also worthy of doing it.

BTW, some preliminary skills and environments are also required:
Unix shell scripting, or at least the basic skills in listing files, searching and matching patterns in a file, extracting information from a target file, do all these with bash/csh shell in terminal;

Fortran environment;
MPI environment --- for this aspect, it is really good to have a super computing environment, but then you should know how to SSH, how to load computing modules, etc;

other libraries for CosmoMC;
other configurations and installations for CosmoMC; -- both can be advised from readme from CosmoMC page.

knowing structure and how to write a Makefile;
If I may, then one suggestion is for you:
be insanity and patient digging a hole
in order to find a way out.
Little by little,
it will get a lot.

Post Reply