Rework run_with_mpi_ranks