[SciPy-dev] random module not working on opteron

Robert Kern rkern at ucsd.edu
Sun Oct 23 06:32:49 CDT 2005


Arnd Baecker wrote:
> Hi,
> 
> I recently reported that
>   from scipy.basic.random import normal
>   a = normal(0.,1.,(3,3))
> leads to a hang on the opteron.
> 
> It turns out that the whole random module does not
> work as it should:
> 
> In [2]: import scipy.basic.random
> In [3]: scipy.basic.random.uniform()
> Out[3]: 3804495653.9744735
> In [4]: scipy.basic.random.uniform()
> Out[4]: 2804588197.3068576
> In [5]: scipy.basic.random.uniform()
> Out[5]: 998177869.76781905
> # this one also hangs
> In [6]: scipy.basic.random.randn(5)
> 
> I have no idea what is causing this,
> in particular because there are no warnings during the compile
> of mtrand.c.
> 
> Can anyone with a 64 Bit machine confirm this behaviour?
> What could one do to hunt this one down?

I would first check if the RandomKit functions work correctly from C.
See the files randomkit.[ch] ; the functions should be self-explanatory.
It's entirely possible that they're not 64-bit safe; I never had the
opportunity to check.

> (For the hangs one could add print statements to the
> .pyx source. Unfortunately I don't have the right pyxrc
> as I get a different output than the one from svn.).

We're using David Cooke's patched version of Pyrex; his patches were
posted to the Pyrex list. The changes are solely to make the generated
code compile without warnings. Don't worry about them. The mtrand
compiled from the unpatched Pyrex generated source should behave
identically. And if they don't on 64-bit platforms, then that's
something we need to know.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the Scipy-dev mailing list