Skip to content

Instantly share code, notes, and snippets.

@brenhinkeller
Created July 12, 2023 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brenhinkeller/e8dc7695444ccc39e9e7dcc24788d473 to your computer and use it in GitHub Desktop.
Save brenhinkeller/e8dc7695444ccc39e9e7dcc24788d473 to your computer and use it in GitHub Desktop.
# run with e.g. mpiexec -np 8 julia ./mpihello.jl
using MPI
MPI.Init()
comm = MPI.COMM_WORLD
size = MPI.Comm_size(comm)
rank = MPI.Comm_rank(comm)
print("Hello from $rank of $size processors!\n")
MPI.Finalize()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment