Skip to content

Instantly share code, notes, and snippets.

@leelasd
Created December 23, 2015 06:33
Show Gist options
  • Save leelasd/e055f570611449bc579c to your computer and use it in GitHub Desktop.
Save leelasd/e055f570611449bc579c to your computer and use it in GitHub Desktop.
Running MPI4PY programme in GRACE
## mpirun -np 2 python helloworld.py
"""
Parallel Hello World
"""
from mpi4py import MPI
import sys
size = MPI.COMM_WORLD.Get_size()
rank = MPI.COMM_WORLD.Get_rank()
name = MPI.Get_processor_name()
sys.stdout.write(
"Hello, World! I am process %d of %d on %s.\n"
% (rank, size, name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment