I am trying to see how fast I can invert a large matrix through numpy and am facing a rather weird conundrum. The test code is very simple:
file invert.pyfrom numpy.linalg import inv
import time
def invert():
a=np.random.rand(10000,10000)
s = time.time()
b=inv(a)
print time.time()-s
I am using a Windows machine so that I can run this test either through the Windows command prompt or through something like cygwin. The commands I use are exactly the same in either case:
python
import invert
invert.invert()
However when I issue the command from the win command prompt I get an elapsed time of ~30 seconds. When I do it through cygwin I get an elapsed time of ~1700 seconds! I am also trying to run the same test on a cluster node (linux) and get very slow results (~1600 seconds). I am quite baffled with this. Issuing the same python commands from the command prompt appears to be working massively faster than issuing them through cygwin. This makes no sense to me. Can someone shed some light on why this may be happening?
Thanks,
Thanks for the answers. Although I haven't completely figured out why this is happening Craig's answer has been helpful. When I give the numpy.show_config() command from win cmd I get info about the blas and lapack libraries. However when I give the same command from cygwin I don't get that info. I can only assume that running python through cygwin is somehow not aware of where the libraries are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With