Skip to content

Instantly share code, notes, and snippets.

@opotowsky
Created April 28, 2023 15:31
Show Gist options
  • Save opotowsky/9706af8daed2571b4313d9af2f2581fc to your computer and use it in GitHub Desktop.
Save opotowsky/9706af8daed2571b4313d9af2f2581fc to your computer and use it in GitHub Desktop.
mpi4py helloworld
"""
mpi4py Hello World
"""
from mpi4py import MPI
import sys
MPI_COMM = MPI.COMM_WORLD
size = MPI_COMM.Get_size()
rank = MPI_COMM.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