Skip to content

Instantly share code, notes, and snippets.

@xkumiyu
Created August 12, 2017 12:45
Show Gist options
  • Save xkumiyu/977d0cd2e1b81e92ffc9eae247a36224 to your computer and use it in GitHub Desktop.
Save xkumiyu/977d0cd2e1b81e92ffc9eae247a36224 to your computer and use it in GitHub Desktop.
import os
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
for i in range(size):
if i == rank:
print("{} {}".format(os.uname()[1], i))
comm.Barrier()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment