mpich2 and python

Jörg Frauendiener joerg.frauendiener at mac.com
Sat Jan 8 16:45:12 PST 2011


Thanks for the answers.

>> From http://www.mcs.anl.gov/research/projects/mpich2/documentation/files/mpich2-1.3.1-installguide.pdf
> 
> "
> 5.2.2 System Requirements
> 
> mpd consists of a number of components written in Python. The
> configure script should automatically find a version of python in your
> PATH that has all the features needed to run mpd. If for some reason
> you need to pick a specific version of Python for mpd to use, you can
> do so by adding
> 
> --with-python=<fullpathname of python interpreter>
> "
> 
> Looks like the portfile could be set up to provide python25, python26,
> etc. variants if needed...
> 
> -Eric
> 
> 
> On Sat, Jan 8, 2011 at 1:55 AM, Jason Swails <jason.swails at gmail.com> wrote:
>> Hi Joerg,
>> 
>> MPICH2 uses python fairly extensively (the mpirun and mpiexec executables
>> are actually just python scripts, as are mpd/mpdboot).  Those developers
>> tend to hard-code the python version that they use into their execution
>> since they know that works and will be free of any new bugs that may get
>> introduced by new versions.  That's the same reason a lot of OS vendors
>> strap an old, stripped-out python distribution with their OS: their system
>> python utilities work just fine with that version and they're hesitant to
>> invest the time to ensure upwards compatibility (especially when Python
>> makes a jump like 2.x -> 3.x).  You should not change this to python2.7
>> because mpirun/mpiexec are unlikely to work, since the top line stays as:
>> 
>> #!/usr/bin/env /opt/local/bin/python2.5
>> 
>> (I made the change in the Portfile just to make sure)
>> 
>> MPI *stuff* are among the very few things I prefer to do myself (without
>> MacPorts, although the python's I add mpi4py to are MP versions), since it
>> allows me more flexibility.
>> 
>> You can also install the OpenMPI variant of mpi4py and avoid this issue
>> altogether.  I tend to use OpenMPI for my Macs, anyway (though I like mpich2
>> better for my Linux boxes, for no special reason, I get similar performance
>> out of both).
>> 
>> Happy tidings,
>> Jason
>> 
>> On Sat, Jan 8, 2011 at 1:02 AM, Jörg Frauendiener
>> <joerg.frauendiener at mac.com> wrote:
>>> 
>>> I have recently come across a somewhat surprising issue:
>>> I installed py27-mpi4py which depends on mpich2 and python27. I was
>>> surprised to see that mpich2 itself depends on python25. Can someone explain
>>> to me why that should be the case? The same is true for py26-mpi4py.
>>> I have played around with the Portfile, replacing the references in mpich2
>>> to python25 with python27 and it installs perfectly. I have not done any
>>> other tests, though. So the question is: is this dependency on python25 a
>>> necessity or can it be replaced with python2[67]?

These answers  are definitely useful. So I guess it is not critical that python2.5 is used. In fact, compiling mpich2 with the appropriate --with-python=... switch gives me mpirun/mpiexec which use the requested python and do not complain when run.

But maybe it is safer to take Jason's advice and use openmpi instead...

Cheers, Joerg


--
Jorg Frauendiener         | Tel.: +64-3-479-7770
Mathematics & Statistics  | Fax:  +64-3-479-8427
University of Otago       | joergf at maths.otago.ac.nz
P.O. Box 56               | jorg.frauendiener at otago.ac.nz
Dunedin 9010              | http://www.maths.otago.ac.nz
Skype: frauendiener

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20110109/1df100cd/attachment.html>


More information about the macports-users mailing list