Cobaya: memory leak on openmpi

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Juan Cruz
Posts: 5
Joined: January 24 2022
Affiliation: University of Southern Denmark - SDU

Cobaya: memory leak on openmpi

Post by Juan Cruz » May 03 2022

Hello,
I am experiencing memory leaks while using Cobaya without even using external likelihoods. I am working in Mac OS Monterrey, have installed gcc and openmpi in their latest versions with brew and am using an Anaconda environment having python 3.8 and the mpi4py package. Running the "leaks" command on top of cobaya-run shows no leaks when run without parallelization. However with mpirun it does leak. I can run within an Anaconda environment using instead mpich and mpi4py with no leaks. Testing with the openmpi supplied by anaconda (and removing brew's) creates leaks again, is this a known issue or is it perhaps just my setup. Could anyone else confirm? I would like to use openmpi instead of mpich because of other software.

Teeraparb Chantavat2
Posts: 12
Joined: May 03 2021
Affiliation: Naresuan University

Re: Cobaya: memory leak on openmpi

Post by Teeraparb Chantavat2 » May 16 2022

This is a pretty common issue with openmp. You may need to check your stack size by running the command in your terminal

Code: Select all

ulimit -s
It will show the stack size in kilobytes. If it is not enough you can increase your stack size by running the command

Code: Select all

ulimit -s <your stack size>
Try to run the program again. Hope it will help

Juan Cruz
Posts: 5
Joined: January 24 2022
Affiliation: University of Southern Denmark - SDU

Re: Cobaya: memory leak on openmpi

Post by Juan Cruz » June 20 2022

Thank you for the answer but it does not seem to be related to the stack. I have managed to check that it only happens when using any likelihood that uses

Code: Select all

clik
such as Planck, so I am still puzzled. The origin of the leak does not seem to be cobaya anyhow.

Post Reply