Monte Carlo test hangs

263 views
Skip to first unread message

Alexander Eberspächer

unread,
Jun 26, 2013, 4:00:35 AM6/26/13
to qu...@googlegroups.com, Thomas Lettau
Dear list,

while trying to install QuTiP locally on our computing cluster (using a very hackish local installation of just about everything except for the standard library), I get the following test hanging:

Monte-carlo: Constant H with constant collapse ...

The test doesn't fail, it's just the test suite hanging. The tests are run in both a non-pylab IPython and a plain Python shell.

Any ideas what this might be related to?

Could this in any way be related to matplotlib? The MPL installation on the cluster is broken. Inspecting __init__.py, I see that MPL is imported - but is it relevant to the hanging test?

Thanks for your help!

Regards

Alex

jrjoh...@gmail.com

unread,
Jul 1, 2013, 2:09:33 AM7/1/13
to qutip group
Hi Alex. 

I'm quite sure that the problem with hanging unit tests is not due to anything MPL related. It is most likely some problem with multiprocessing and how mcsolve use the multiprocessing. Unfortunately we currently do not have a good way of propagating errors from child processes that is spawned using the multiprocessing in mcsolve, so if there is an exception or other error in these child processes the controlling main process will not notice this and will hang forever (we obviously want to improve this..). To see what is going on, try to directly run a mcsolve example or test (not using the test suite to launch it). It might be enough to run the test_mcsolve.py directly using the python interpreter, like

python qutip/tests/test_mcsolve.py

or try one of the mcsolve examples in the qutip/examples directory.

Then you might see some exception printout in the console that might give some more hints about what's wrong. 

Hope this helps!

Rob

shuangshuang fu

unread,
Aug 11, 2013, 7:55:23 PM8/11/13
to qu...@googlegroups.com
Dear Rob,

I experienced the same situation, besides, I tried the demos, and I failed to run the squeezed states, ground state, bell state, 3-qubit GHZ. For example, for the squeezed states, the printout is as follows:

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    demos()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/qutip/demos.py", line 79, in demos
    eval(example_code)
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/qutip/examples/ex_12.py", line 27, in run
    ax = Axes3D(fig, azim=-62, elev=25)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 91, in __init__
    *args, **kwargs)
  File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/axes/_base.py", line 430, in __init__
    self.cla()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 1045, in cla
    Axes.cla(self)
  File "/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg/matplotlib/axes/_base.py", line 893, in cla
    self.grid(self._gridOn)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 1256, in grid
    self._draw_grid = maxes._string_to_bool(b)
AttributeError: 'module' object has no attribute '_string_to_bool'

I have installed all the dependencies, I have no idea what is wrong. Could you please help me with this?

Thanks

Shuang

shuangshuang fu

unread,
Aug 11, 2013, 7:55:43 PM8/11/13
to qu...@googlegroups.com

jrjoh...@gmail.com

unread,
Aug 11, 2013, 8:51:19 PM8/11/13
to qutip group

Hi Shuang

It looks like an issue with matplotlib. What version of matplotlib do you have? Did you install it through macports?

It seems like you might have one version of matplotlib in /opt/local/Library (macports) and another (1.4.X development version) installed in /Library (probably installed using the python shipped with the OS by Apple).

Rob

--
You received this message because you are subscribed to the Google Groups "qutip" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

shuangshuang fu

unread,
Aug 11, 2013, 8:59:57 PM8/11/13
to qu...@googlegroups.com
Dear Rob,

The version info about QuTiP shows that the Matplotlib Version is 1.4.x. And I installed the modules through macports. There may have some problems with it since the first time I did not succeed in installing it. So what should I do now? Thanks.

Shuangs




You received this message because you are subscribed to a topic in the Google Groups "qutip" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/WrpuIpSFcOI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.

shuangshuang fu

unread,
Aug 11, 2013, 9:28:58 PM8/11/13
to qu...@googlegroups.com
Dear Rob,

Besides the problem I mentioned above, I failed every time I tried to use the Monte-Carlo methods. Is there any correlation between these?

Thanks.

Shuang


On 12/08/2013, at 10:51 AM, "jrjoh...@gmail.com" <jrjoh...@gmail.com> wrote:

You received this message because you are subscribed to a topic in the Google Groups "qutip" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/WrpuIpSFcOI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.

jrjoh...@gmail.com

unread,
Aug 11, 2013, 10:41:38 PM8/11/13
to qutip group
Hi

I think you should start with removing matplotlib version 1.4.X from

/Library/Python/2.7/site-packages/matplotlib-1.4.x-py2.7-macosx-10.8-intel.egg

I think this interferes with matplotlib from macports. 

Rob

Paul Nation

unread,
Aug 11, 2013, 11:41:14 PM8/11/13
to qu...@googlegroups.com
Please also type:

which python

in the terminal and give us the output.  This will determine which Python you are actually running (system or macports)

-Paul

---------------------------------------
Paul D. Nation
Assistant Professor
Korea University
Department of Physics
Anam-dong 5, Seongbuk-gu
Seoul 136-713, South Korea
Email: pna...@korea.ac.kr
Phone: +82-02-3290-3092
Web:   nqdl.korea.ac.kr
---------------------------------------

shuangshuang fu

unread,
Aug 11, 2013, 11:56:07 PM8/11/13
to qu...@googlegroups.com
Dear Paul and Rob,

I do have two python. One is installed from macports which I run for QuTiP. The other one is installed in a different directory, which may have been installed by the system itself. I followed Rob's suggestion and  removed matplotlib version 1.4.X from the system python(I did not remove all the python 2.7 folder) and it seems good since I can successfully run some of the demos. But I still have problems running demos about the Monte Carlo Solver in my computer. It seems like that it does not respond at all. So is it also related to the Python versions? Or are there any other possible reasons?

Thanks

Shuangshuang
 
On 12/08/2013, at 1:41 PM, Paul Nation <nonher...@gmail.com> wrote:

Please also type:

which python

in the terminal and give us the output.  This will determine which Python you are actually running (system or macports)

-Paul

---------------------------------------
Paul D. Nation
Assistant Professor
Korea University
Department of Physics
Anam-dong 5, Seongbuk-gu
Seoul 136-713, South Korea
Email: pna...@korea.ac.kr
Phone: +82-02-3290-3092
Web:   nqdl.korea.ac
---------------------------------------

jrjoh...@gmail.com

unread,
Aug 12, 2013, 5:22:10 AM8/12/13
to qutip group

Hi

Can you run one of the mcsolve examples directly with the python interpreter (not using the test suite or the demos window) and show us the errors?

Rob

Paul Nation

unread,
Aug 12, 2013, 5:26:12 AM8/12/13
to qu...@googlegroups.com
Rob,

I do not get any errors.  At least from the first 3 mcsolver examples.

-Paul
--

shuangshuang fu

unread,
Aug 12, 2013, 7:14:22 AM8/12/13
to qu...@googlegroups.com
Dear Paul,

After typing which python in the terminal, it returns that

/opt/local/bin/python

So I am actually running the python installed by macports.

Is there any other reasons that I could not run mcsolve?

Cheers

Shuangshuang

On 12/08/2013, at 1:41 PM, Paul Nation <nonher...@gmail.com> wrote:

shuangshuang fu

unread,
Aug 12, 2013, 7:43:49 AM8/12/13
to qu...@googlegroups.com
Dear Rob,

The situation is that as long as I type sequence like this "data=mcsolve(H,psi0,tlist,[C1,C2],[C1dC1,C2dC2])", there pops a window which says "The program is still running, do you want to kill it?" When I choose not, the program stops responding. There is no other errors shown in the window. 

Thanks for your time.

Shuangshuang



shuangshuang fu

unread,
Aug 12, 2013, 8:59:44 AM8/12/13
to qu...@googlegroups.com
Dear Rob and Paul,

Thanks very much for your help. I just ran the demos in the terminal, it all works perfectly. It is just that I failed to run the mcsolve demos in IDLE(I used it all these days). It maybe due to the path or something else which I need to figure out.  Thanks for your time, I am a beginner in both programming and QuTiP, I am gonna work hard on it.
It is really very useful.

Cheers

SS
Reply all
Reply to author
Forward
0 new messages