[SciPy-user] scipy and MPI: how I solved "import scipy" hanging

Giovanni Samaey giovanni.samaey at cs.kuleuven.ac.be
Mon Nov 7 13:23:38 EST 2005


Hi all,

I have been struggling to get newscipy working on a cluster, in which 
each node is trying to import scipy.
The problem was that the import is hanging, on a weird place, namely 
when in the file machar.py from
scipy.base, an object of the class MachAr(object) is being created.
The snippet of source code that is hanging is displayed below (with line 
numbers)

    246         import math
    247         self.precision = int(-math.log10(float_to_float(self.eps)))
    248         ten = two + two + two + two + two
    249         resolution = ten ** (-self.precision)
    250         self.resolution = float_to_float(resolution)
    251         self._str_resolution = float_to_str(resolution)
 
Now here comes the funny thing: line 249 hangs when executed using pyMPI 
(from the pyMPI project) and
also using mpipython (from ScientificPython).
Apparently, "ten" is equal to [10.] here (I presume this is a list).  
When changing the line to
249         resolution = ten[0] ** (-self.precision)
I get past this.

I don't understand why, and I would be glad to find out why, but the 
message here is simply for sharing this with other people who might find 
the same things...

Best,

Giovanni

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm




More information about the SciPy-User mailing list