Skip to content

Commit

Permalink
Add hello
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecThomson committed Jul 31, 2024
1 parent 0f53d57 commit d7d0ad8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/hellompi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python
"""
Parallel Hello World
from: https://github.com/erdc/mpi4py/blob/master/demo/helloworld.py
"""

import sys

from mpi4py import MPI

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))

0 comments on commit d7d0ad8

Please sign in to comment.