[IPython-user] Dissimilar behaviour: from IPython.kernel import client, inside class and on import.

mark starnes m.starnes05@imperial.ac...
Wed Oct 22 07:59:50 CDT 2008


Sorry, posted to the wrong thread.  Again!  :(

m.

mark starnes wrote:
> Hi everyone,
> 
> I posted about this before, but got pushed into working on something else
> before it could be resolved.  This post is to re-visit.
> 
> Running the script below generates a hang, if the commented lines are
> uncommented.  If left commented, all seems well.  Can anyone explain why?
> 
> In particular, sorry to Brian Granger for not following up on the 9/9/08 post.
> 
> Other IPython parallel processing functionality seems ok.
> 
> Best regards,
> 
> Mark.
> 
> 
> test.py:
> ----------------------------------
> # Case 1.  Outside class.  Uncomment the following three lines.
> # from IPython.kernel import client
> # mec = client.MultiEngineClient()
> # print mec.get_ids()
> 
> # Case 2.  Inside class.
> 
> class Test:
>    def __init__(self):
>       from IPython.kernel import client
>       mec = client.MultiEngineClient()
>       print mec.get_ids()
> --------------------------------------
> 
> 
> Results:
> Case 1:  Hang during the 'mec = ...', line 3
> 
> Case 2:  a=test.Test()
>          [0, 1, 2, 3]
> 
> 
> _______________________________________________
> IPython-user mailing list
> IPython-user@scipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
> 


More information about the IPython-user mailing list