# L-13 MCS 507 Wed 20 Sep 2023 : mpi4py_hello_world.py

"""
This is a parallel hello world with mpi4py.
At the command prompt, type
mpiexec -n 3 python3 mpi4py_hello_world.py
where '3' is the number of processes.
Every process runs the script below:
"""

from mpi4py import MPI

SIZE = MPI.COMM_WORLD.Get_size()
RANK = MPI.COMM_WORLD.Get_rank()
NAME = MPI.Get_processor_name()

MESSAGE = "Hello from %d of %d on %s." \
  % (RANK, SIZE, NAME)
print(MESSAGE)
