def rank(self): if MPI_INSTALLED: mpi_comm = MPI.COMM_WORLD return mpi_comm.Get_rank() else: return 0