Updated references to all_ranks to get ranks from comm.