So the story goes: I need a MPI wrapper for Python.
I know there's mpi4py. For the current work I (mostly) use Python and Windows, I'd like to use the Microsoft HPC Cluster Pack, having access to a few pretty "strong" machines running Win 2008 Server. Just to mention, besides Win-experience, I do have a bit of *nix experience with MPI and stuff, but that's pretty moot point for this problem.
My interest in mpi4py was renewed when I ran into Python Tools for Visual Studio. That's some seriously great stuff. Anyone that's a fan of Visual Studio and Python should try it. Good work, and a great debugger.
The doc pages of PTVS state the installation of mpi4py is easy... and for ActiveState Python it seems to be true. However, if you don't use ActiveState's Python and instead use the "normal" Python distribution from python.org, you seem to be a bit out of luck.
My development machine is a laptop w/ Win7 64bit and Python 2.6, both in 64-bit and 32-bit flavors. I have installed the MS HPC Pack 2008 R2 MS MPI and SDK. I have Visual Studio 2008 and 2010, everything dutifully patched.
There's no binary installer and knowing how Unix MPIs can be exceedingly picky wrt to the MPI version they're linked with, I wanted to build my own mpi4py. mpi4py basically relies on having a MPI .dll (.pyd actually) that binds the python calls to MPI libs.
easy_installing of mpi4py and building of that library has failed - not being able to point to the MPI libs. OK, no problem, I downloaded the mpi4py tarball, extracted it and altered the mpi.cfg file so that it points to the correct folders:
# Microsoft MPI example
# ---------------------
[msmpi]
define_macros = MS_MPI=1
mpi_dir = $CCP_HOME
include_dirs = %(mpi_dir)s\Inc
libraries = msmpi
library_dirs = %(mpi_dir)s\lib\i386
The MS MPI installer registers an environment variable CCP_HOME pointing to the exact install location of the Pack. The name "CCP" must be leftover from the days it was called Microsoft Compute Cluster Pack). Got to pass this to the original mpi4py developer.
After this, the compilation passes fine, but I can't link - there are three unresolved externals:
MPI.obj : error LNK2019: unresolved external symbol _MPI_Type_create_f90_integer@8 referenced in ...
MPI.obj : error LNK2019: unresolved external symbol _MPI_Type_create_f90_real@12 ...
MPI.obj : error LNK2019: unresolved external symbol _MPI_Type_create_f90_complex@12 ...
Seems that the MS MPI msmpi.lib from HPC 2008 R2 does not implement these, so I can't build the MPI.pyd.
I could try to comment out these in the mpi4py C source file, but I don't think this is the right path.
Thanks in advance!