Solve a problem – Filter by language, license, keyword, owner, or search text to find code & info fast.
Updated over 8 years ago (20 Mar 2008 at 02:09 AM) recent activity
|In Brief||This is the most basic mpi4py program. When launched each process will obtain it's rank and print out the process pool size and machine name.... more|
3Parallel Hello World !!!
6from mpi4py import MPI
9hwmess = "Hello, World!! I am process %d of %d on %s.\n"
10myrank = MPI.COMM_WORLD.Get_rank()
11nprocs = MPI.COMM_WORLD.Get_size()
12procnm = MPI.Get_processor_name()
13sys.stdout.write(hwmess % (myrank, nprocs, procnm))
This is the most basic mpi4py program. When launched each process will obtain it's rank and print out the process pool size and machine name.
For a more complex and possibly useful example check out the Simple MPI batch system