像這樣的程式:

$ cat test/helloworld.py
from mpi4py import MPI

message = "Hello, World!! I am process %d of %d on %s."

print  message % (MPI.rank,
                  MPI.size,
                  MPI.Get_processor_name())

會得到這樣的結果:

$ mpirun -np 2 ~/opt/python-2.4-parallel/bin/bwpython \
 test/helloworld.py
Hello, World!! I am process 0 of 2 on apr.chen.local.
Hello, World!! I am process 1 of 2 on apr.chen.local.

是阿根廷 CIMEC 的研究人員所貢獻的成果。mpi4py 採用了 OOMPI 裡部分的類別結構,相容於 MPI 規格,可以和 LAMMPI 與 MPICH 配合使用。比起 Scientific Python,mpi4py 功能完整得多,更適合為運算程式進行 scripting。

Posted by yungyuc at 22:18, 2 comments, 0 trackback.
Navigate
Add a trackback
Comments
Re: 來自南美的 Python MPI
I would appreciate helping me understand from where to obtain bwpython.
I installed mpi4python and this executable is not there.

Regards,

Guy
Guy Tel-Zur at 2007-12-30 04:38.
Re: 來自南美的 Python MPI
As of 0.5 mpi4py has a built in parallelized interpreter called "mpi4py". Build it with "python setup.py build_exe" and install with "python setup.py install_exe".
Andrew at 2008-05-29 14:43.
Add a comment

Your name. (required)

Your personal website. (optional)

Your email address. Will not show in page. (suggested, but optional)

Text format is "Plain Text".

Enter "gtkwa"
© hover year to navigate month: powered by django