Skip to content

Solutions for Two Parallelization Issues in Montepython #412

@hudiao1

Description

@hudiao1

Issue 1: MPI Initialization Error

When starting Montepython with MPI multiprocessing, the following error occurs:
Configuration Error:
/|\ The initialisation was not successful, resulting in a potentially half
/o\ created log.param. Please see the above error message. If you run the
exact same command, it will not work. You should solve the problem, and
try again.
This is an initialization problem caused by race conditions during MPI multiprocessing setup.

Solution: First run the chain in single-core mode to generate the necessary output files, then restart the run using multiple cores. This avoids the file contention during initialization.

Issue 2: MultiNest Resume File Error

Even after a single-core initialization, when running MultiNest in parallel, the following Fortran runtime error appears:
At line 296 of file \UV_LF_MCMC/MultiNest/src/nested.F90 (unit = 61, file = 'UVLF_PBH_ns/NS/UVLF_PBH_ns-resume.dat')
Fortran runtime error: End of file
yhrun: error: cn80983: task 3: Exited with exit code 2
This is another race condition related to concurrent access to the resume file.

Solution: In the Montepython source file multinest.py, after line 146, add:
data.NS_arguments['resume'] = False
This disables MultiNest’s resume function, which is not exposed as a user parameter in the Montepython input settings. After making this change, the parallel MultiNest runs proceed without the file-reading conflict.

System context: Montepython with MPI and MultiNest, running on a cluster.

I hope this note helps others who encounter similar parallelization issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions