bd-j / forcepho

Generative modeling galaxy photometry for JWST
https://forcepho.readthedocs.io
19 stars 4 forks source link

MPI patch server #30

Closed lgarrison closed 4 years ago

lgarrison commented 5 years ago

We have many patches that we wish to process in parallel. To do so, we will run many independent compute processes via MPI. We thus need a way to tell the compute processes (clients) which patch they are supposed to process. We probably want an MPI server to dynamically dispatch this work to allow for load balancing or updating of fixed galaxies based on results from nearby patches. mpi4py should let us do this dispatch pretty easily.

We'll may also want some pre-processor pipeline that breaks up the data and scene into patches and mini-scenes on disk (Sandro's code already does most of this, I think). That way, a compute node only needs to touch the data on disk it actually needs.

bd-j commented 4 years ago

In #41 I have added a dispatcher module with a very simple MPIQueue using mpi4py. Jobs can be submitted to the queue if there are any idle ranks; the queue can be polled for finished jobs, returning results and marking the rank idle.

bd-j commented 4 years ago

I have a short test script that I should add to the module as a usage demonstration.

bd-j commented 4 years ago

Ok, I added a demo to dispatcher.py. This could probably be cleaned up quite a bit, but basic functionality is there. Closing this (for now)