Created
December 23, 2015 06:33
-
-
Save leelasd/e055f570611449bc579c to your computer and use it in GitHub Desktop.
Running MPI4PY programme in GRACE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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