像這樣的程式:
$ 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。
Navigate
- Previous: vserver 幫助我 @2005/10/09
- Next: 在家目錄裡安裝 TeX 字型 @2005/10/13
Add a trackback
Please send trackback to: http://blog.seety.org/everydaywork/2005/10/11/419/trackback/.
Comments
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
I installed mpi4python and this executable is not there.
Regards,
Guy