Created
April 28, 2023 15:31
-
-
Save opotowsky/9706af8daed2571b4313d9af2f2581fc to your computer and use it in GitHub Desktop.
mpi4py helloworld
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
""" | |
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