Skip to content

Mosaicking

Samuel Khuvis edited this page Apr 27, 2023 · 2 revisions

Mosaicking Code

The code in the branches mpi and mpi_pysubtiles contain code to generate mosaicks based on the Matlab implementation in this repo.

Overview of Branches

mpi

This branch has a working mosaicking code, but uses subtiles generated by Matlab.

mpi_pysubtiles

This code is branched off of the mpi branch and generates its own subtiles, rather than requiring subtiles generated by Matlab. Multiprocessing is used to build multiple subtiles in parallel.

Running

Begin by looking at the sample submission script run_mosaicking.slurm and the python script mosaicking.py to see how to run this code.

The repository also contains the submission script run_parallel.slurm that will execute the code in parallel using MPI with Python's mpi4py package. Currently, there are some issues with the parallel implementation so it is recommended to first run in serial.

To-Dos

  1. Currently, the Python implementation runs slower than the original Matlab implementation. Performance analysis and optimization will be required to reduce the runtime required to generate a mosaick. Initial analysis shows that time spent in the sparse solver is significantly longer with this implementation compared to Python. The relevant function is the call to scipy.sparse.linalg's spsolve function in inpaint_nans.py.
  2. In both branches, there is a preliminary parallelization of the main mosaicking loop. However, there is some non-determinism in the results related to the blending step that needs to be resolved. In order to help with load balancing, the parallelization uses MPI's one-sided communcication to process subtiles from a queue.
  3. There are still some code paths that were not implemented since they were not exercised in runs with available test data. These code paths typically contain the line raise Exception('Not implemented').
Clone this wiki locally