from mpi4py import MPI

# Communicator that contains all mpi processes
comm = MPI.COMM_WORLD

rank = comm.Get_rank()
size = comm.Get_size()
name = MPI.Get_processor_name()

print("Rank {0} out of {1} on {2}".format(
      rank, size, name))
