Numpy multiple instances
Hello, I have embedded python/numpy scripts in an application that runs in parallel. But the python code is always invoked on the master node. So it could be assumed that at some point, there could be multiple instances of script being invoked and run. I have commented out import numpy part to see if both get the same sys.path and here are the sys.path:
From C : Replica ID value 0 From Python : The replicaId 0 of 2 simulations running at 0.0 with 27319 atoms ['/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages', 'python_custom']
From C : Replica ID value 1 From Python : The replicaId 1 of 2 simulations running at 0.0 with 27319 atoms ['/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages', 'python_custom']
But once I uncomment, import numpy as np part in the script,
From C : Replica ID value 0 From Python : The replicaId 0 of 2 simulations running at 0.0 with 27319 atoms ['/usr/lib64/python24.zip', '/usr/lib64/python2.4', '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk', '/usr/lib64/python2.4/lib-dynload', '/usr/lib64/python2.4/site-packages', '/usr/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib/python2.4/site-packages', 'python_custom'] From C : Replica ID value 1 Traceback (most recent call last): File "python_custom/customF.py", line 3, in ? import numpy ImportError: No module named numpy
Just giving some more information : When I embedded the python call in C, I had to comment out Py_Finalize() as numpy was throwing an error when trying to finalize. Any ideas/suggestions on whats happening ? Do I need to do something special to have multiple instances of python/numpy in C? Thanks Santhosh
participants (1)
-
santhu kumar