MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Why does the Front End freeze when using a TCPIP-mode connection with the kernel?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124006] Re: Why does the Front End freeze when using a TCPIP-mode connection with the kernel?
  • From: Szabolcs HorvÃt <szhorvat at gmail.com>
  • Date: Thu, 5 Jan 2012 05:56:47 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Thank you for your reply!

I corrected this, but unfortunately it doesn't solve the problem.  The
front end still freezes.

I used the following in the front end setup ("arguments to MLOpen"):

-LinkName "8000,8001" -LinkMode Listen -LinkProtocol TCPIP -LinkHost
"MY-IP-HERE" -LinkOptions MLDontInteract

I did this from the command line kernel:

link=LinkConnect["8000,8001", LinkProtocol -> "TCPIP"]
$ParentLink = link;

Again, everything appears to work for a while, but Manipulate[n,
{n,0,1}] will freeze the kernel if I play for long enough with it.
(Not immediately, but usually it'll freeze in less than 10 seconds if
I keep dragging the slider up and down without letting it go.)

Based on your comment I tested whether aborting computations works
correctly, and it does.

I tried other variations too such as including the IP in the link name
("8000@MY-IP,8001@MY-IP"), or using -LinkMode Connect in the front end
configuration after doing LinkCreate["8000,8001", LinkProtocol ->
"TCPIP"] in the kernel. The result is the same every time.  Everything
appears to work correctly for a while, but Dynamic cells will surely
freeze up the front end sooner or later.

This talk <http://library.wolfram.com/infocenter/Conferences/7250/>
mentions that actually not one, but three links are used for
communication between the front end and the kernel.  Is it possible
that something is going wrong with the other two links?  Is there a
way I could see if they are created and work correctly?  (I am only
creating a single link manually, and it's not clear to me how the
other two are made.)  Evaluating Links[] does indeed show three TCPIP
links (as well as some others), but this is kernel-side only.  Can I
verify that everything is fine on the front end side as well?

Szabolcs

On 4 January 2012 20:52, John Fultz <jfultz at wolfram.com> wrote:
> I don't know if this is the cause of the problem or not, but that's the wrong
> linkname syntax for the TCPIP protocol. =C2 TCPIP uses *two* ports,
> comma-delimited. =C2 One is the regular data channel, and the other is for urgent
> "messages", which includes things like interrupt, abort, and terminate.
>
> Try doing...
>
> LinkCreate[LinkProtocol -> "TCPIP"]
>
> to see an example of a proper linkname.
>
> Sincerely,
>
> John Fultz
> jfultz at wolfram.com
> User Interface Group
> Wolfram Research, Inc.
>
> On Wed, 4 Jan 2012 05:01:45 -0500 (EST), Szabolcs Horv=C3=A1t wrote:
>>
>> Note: I already asked this question here, but I'm hoping to reach a
>> larger audience:
>>
>> http://stackoverflow.com/questions/8717211/understanding-kernel-frontend-
>> communication-why-does-my-front-end-freeze
>>
>>
>> The question:
>>
>> When I try to connect to a remote kernel, the front end always freezes
>> sooner or later. =C2 I managed to reproduce the problem on the *local*
>> machine. =C2 Can you please take a look at what I am doing wrong, and how I
>> can prevent the problem?
>>
>> Here's how to reproduce the problem on a single machine (no remote
>> connection needed):
>>
>> 1. Create a new kernel configuration (Evaluation menu -> Kernel
>> Configuration Options...)
>>
>> Select Advanced Options.
>>
>> Arguments to MLOpen:
>>
>> -LinkName "8000@YOUR-IP-HERE" -LinkMode Listen
>> -LinkProtocol TCPIP -LinkHost "YOUR-IP-HERE"
>> -LinkOptions MLDontInteract
>>
>> (Replace YOUR-IP-HERE with your computers IP address. On Windows
>> you can get this by typing ipconfig in a command window.)
>>
>> Shell command to launch kernel: leave empty (we will do it manually)
>>
>> 2. Open a new notebook, set the notebook's kernel to the one you
>> just set up, and evaluate something (1+1).
>>
>> 3. Now we need to launch the kernel manually, before the connection
>> times out (do it quickly). So start a new kernel (math) in command line
>> mode, and evaluate the following:
>>
>> link==LinkConnect["8000",LinkProtocol->"TCPIP"] (* connect to front
>> end link *)
>>
>> $ParentLink == link (* set the front end link as parent link *)
>>
>> Now the connection is established, and everything appears to work
>> correctly (save for the one message in the front end's pink message
>> window)
>>
>> 4. Evaluate Manipulate[n, {n, 0, 100, 1}]. This appears to work too.
>> Now play with the slider. Sooner or later the front end will freeze and
>> needs to be killed. For me, dragging the slider up and down for ~10
>> seconds without releasing it always suffices.
>>
>> Why does the Front End freeze? How can I create a TCPIP-mode connection
>> between the front end and the kernel in a way that everything will be
>> working correctly?
>>
>> Note: I am on Windows XP. =C2 I should also link to this presentation and
>> package here: http://library.wolfram.com/infocenter/Conferences/7250/
>> When I use this package, I get the same freeze.
>>
>>
>> --
>> Szabolcs Horv==E1t
>> Mma QA site proposal: http://area51.stackexchange.com/proposals/37304
>
>



  • Prev by Date: Re: Why does the Front End freeze when using a TCPIP-mode connection with the kernel?
  • Next by Date: Re: How to plot divergence of gradient as contour plot
  • Previous by thread: Re: Why does the Front End freeze when using a TCPIP-mode connection with the kernel?
  • Next by thread: Re: Fast vs. Slow NonlinearModelFit models