Using MPI with CAMB

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Dournac Fabien
Posts: 68
Joined: May 18 2019
Affiliation: IRAP

Using MPI with CAMB

Post by Dournac Fabien » May 17 2021


I would like to use MPI for CAMB with intel compiler mpifort since I have to launch the executable "camb" multiple times in a loop.

I saw in the Makefile this part where I modified F90C and FFLAGS (keeping -omp to mention multi-processor) :

Code: Select all

#Digital/Compaq fortran, -omp toggles multi-processor
#F90C    = f90
F90C    = mpifort
#FFLAGS  = -omp -O4 -arch host -math_library fast -tune host -fpe1
FFLAGS  = -omp

Unfortunately, at the execution by doing :

mpirun -np 64 ./camb params.ini

CAMB seems to not be distributed on multi-processors, runtime is even higher than for a classical single processor execution.

Does anyone know how to make it run with MPI ? (especially the different flags to set in Makefile) ?


Antony Lewis
Posts: 1775
Joined: September 23 2004
Affiliation: University of Sussex

Re: Using MPI with CAMB

Post by Antony Lewis » May 17 2021

CAMB uses OpenMP not MPI. If you want to call camb multiple times in parallel, run mpirun on your MIP code that is calling CAMB. parallelizing the loop.

Post Reply