PolyChord / PolyChordLite

Public version of PolyChord: See polychord.co.uk for PolyChordPro
https://polychord.io/
Other
83 stars 26 forks source link

MPI causes kernel to crash #61

Closed denijane closed 3 years ago

denijane commented 3 years ago

When I try to run two samplings in a row (for example with different priors), I get a kernel crash and I see in the console the following error:

Thee MPI_Comm_dup() function was called after MPI_FINALIZE was invoked.
*** This is disallowed by the MPI standard.
*** Your MPI job will now abort.

I'm using Python 3.6 on Sabayon Linux. Another thing that's not working is >output which doesn't print out in the notebook. But it's visible in konsole and in the text files, so that doesn't bother me that much. But the kernel crash is a problem because it's preventing me from combining two plots.

If anyone could advise me about how to read from the saved files and produces the corner plots, that's a workaround. I can run 1 sampling, restart the kernel and run the next one. This is what i've done so far anyway. I saw that pymc can load the saved data and work with it, but I couldn't find this in polychord documentation.

P.S. I'm a newbie with polychord so I applogise if there is anything stupid. But the MPI problem is real.

williamjameshandley commented 3 years ago

Hi there @denijane,

Does including the line

from mpi4py import MPI

at the start of the script fix the problem?

williamjameshandley commented 3 years ago

Another thing that's not working is >output which doesn't print out in the notebook. But it's visible in konsole and in the text files, so that doesn't bother me that much. But the kernel crash is a problem because it's preventing me from combining two plots.

The output is legacy code. I would recommend looking into anesthetic for post-processing nested sampling tools

denijane commented 3 years ago

Hi there @denijane,

Does including the line

from mpi4py import MPI

at the start of the script fix the problem?

Hi William, thank you for the advise. It solved my problem. Now everything is working.

I also figured how to plot from chains and to save my posteriors and plot from them too, so everything is working fine.

jeremysanders commented 3 years ago

This is just to note that I needed to modify the example run_pypolychord.py to have the import at the top (and I needed to install the mpi4py module).