Giter Site home page Giter Site logo

Comments (3)

JesusTorrado avatar JesusTorrado commented on August 30, 2024

Hi Vivian,

As you say, it looks like PolyChord is not talking to Python's MPI properly (even though Python's MPI itself is working). Most likely, the proper MPI libraries were not loaded at the time PolyChord was compiled.

I suggest the following diagnosis and possible fix:

  1. Perform the MPI test at https://cobaya.readthedocs.io/en/latest/installation.html (this is important to check that Python's MPI has been loaded at this moment).
  2. Go to the PolyChord installation folder under [your_modules]/code/PolyChord and re-compile it: make veryclean; make; python setup.py install --user (omit the --user flag if using Anaconda).
  3. Clear the chains folder with rm -rf chains/*, run python run_PyPolyChord.py and check that it does not fail.
  4. Repeat the last step, now with mpirun -n [X>1].

Did it work? If it did, would you try to run your case again? Otherwise, let me know.

from cobaya.

JesusTorrado avatar JesusTorrado commented on August 30, 2024

After a second look, I am more inclined to think that this is a race condition, so if the 1st solution does not work (please, check it out anyway), try the following: substitute the 1st 4 lines of code in the run_polychord function in PolyChord/PyPolychord/__init__.py with

    try:
        from mpi4py import MPI
        comm = MPI.COMM_WORLD
        rank = comm.Get_rank()
    except ImportError:
        rank = 0

    if not os.path.exists(settings.base_dir) and rank == 0:
        os.makedirs(settings.base_dir)

    if not os.path.exists(settings.cluster_dir) and rank == 0:
        os.makedirs(settings.cluster_dir)

I am going to submit an issue to the official PolyChord repo.

from cobaya.

vivianmiranda avatar vivianmiranda commented on August 30, 2024

It is indeed a race condition...your change of code fixed!

from cobaya.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.