Skip to content

Commit d7d0ad8

Browse files
committed
Add hello
1 parent 0f53d57 commit d7d0ad8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/hellompi.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env python
2+
"""
3+
Parallel Hello World
4+
from: https://github.com/erdc/mpi4py/blob/master/demo/helloworld.py
5+
"""
6+
7+
import sys
8+
9+
from mpi4py import MPI
10+
11+
size = MPI.COMM_WORLD.Get_size()
12+
rank = MPI.COMM_WORLD.Get_rank()
13+
name = MPI.Get_processor_name()
14+
15+
sys.stdout.write("Hello, World! I am process %d of %d on %s.\n" % (rank, size, name))

0 commit comments

Comments
 (0)