wbalmer / backtracks

Python package to fit relative astrometry with background star motion tracks.
https://backtracks.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Support for multiprocessing with MPI pool #11

Closed tomasstolker closed 1 year ago

tomasstolker commented 1 year ago

Hi @wbalmer,

Hereby the PR that adds support for multiprocessing with MPI by using an MPIPool instead of the regular pool from dynasty. In this way, it can run on a cluster with multiple nodes. I added the mpi_pool, n_live, and resume parameters to fit.

I noticed that querying the Gaia catalog did not work in combination with MPI (or perhaps some other issue related to the cluster I was using), so I added the possibility to read this from a FITS file, which is created when running backtrack. To get this to work, I had to restructure some of the code a bit such that the class attributes are correctly set.

Let me know if you have any questions and/or feedback!

wbalmer commented 1 year ago

Thanks so much Tomas! This is very excellent. I am going to create a version (0.1) for the tool as it stands right now, then pull and create the next version (0.2) with your changes.