MathGroup Archive 2006

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

Search the Archive

Re: mathlink error when restarting remote kernel

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68244] Re: [mg68141] mathlink error when restarting remote kernel
  • From: Steve Wilson <stevew at wolfram.com>
  • Date: Sun, 30 Jul 2006 04:48:36 -0400 (EDT)
  • References: <200607250801.EAA28751@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Ryan,

Thanks for bringing this problem to our attention.  I have  
investigated the problem and found that it is an actual bug.  I have  
fixed the bug and the fix should be available in a future version of  
Mathematica.

For now, the error message occurs because at least one of the sockets  
in the connection matrix is staying in the TIME_WAIT (TCP socket  
shutdown state) and eventually will become available again (as you  
have already observed).  In the case where you need to restart the  
Kernel immediately you should evaluate 'Quit' from the Front End as  
you have described.

I apologize for any inconvenience caused by this problem.

Sincerely,

Steve Wilson
Senior Network/System Protocol Engineer
Wolfram Research, Inc.


On Jul 25, 2006, at 2:01 AM, Ryan Olf wrote:

> I use my Mac OS X Mathematica 5.2 (for students) frontend to connect
> to a remote kernel (version 5.2 for Linux) over SSH.  The commands I
> use, and work pretty well, are:
>
> Arguments to MLOpen:
> -LinkMode Listen -LinkProtocol TCPIP -LinkName
> 31416 at 127.0.0.1,31417 at 127.0.0.1 -LinkOptions MLDontInteract
>
> Launch Command:
> ssh -R 31416:127.0.0.1:31416 -R 31417:127.0.0.1:31417 remotehost "/
> usr/local/bin/math -mathlink -LinkMode Connect -LinkProtocol TCPIP -
> LinkName 31416 at 127.0.0.1,31417 at 127.0.0.1 -LinkHost 127.0.0.1"
>
> The remote machine is behind a firewall, so the mathlink connection
> is tunneled through SSH.  With these commands I can start the remote
> kernel, execute commands through the front end, everything is fine
> and dandy.  Until I try to quit the kernel.  If I quit the kernel by
> executing the "Quit" command, the kernel exits cleanly, and I can
> start it back up again instantly.  Excellent.  If, however, I quit
> the kernel via the frontend menus Kernel->Quit Kernel->remote kernel,
> the kernel exits cleanly, but when I try to restart the kernel, I get
> an error message:
>
> Mathematica could not establish a connection to the kernel.
> Kernel: remote kernel.
> Low-level MathLink error: The linkname is already in use.
>
> Checking on the remote computer, there is no kernel running, as
> expected.  It does seem to be shut down properly.  If I wait a few
> minutes after quitting the kernel using the menus, I do not get the
> error message, and I'm on my merry way.
>
> I think the issue has to do with MLOpen (whatever that is).  For some
> reason, when I quit the kernel using the Quit command, MLOpen stops
> listening to the linkname and a link can be set up again
> immediately.  When I quit using the menus, MLOpen takes a few minutes
> to stop listening to the linkname.
>
> My question for the experts out there is: how do I fix this issue?
> Is this a bug that Wolfram should know about and needs to fix?  Or is
> there a problem in my configuration?
>
> Admittedly, this is not a critical issue, since everything is fine
> when I type "Quit" instead of using the menus, but nonetheless, I
> don't think the program should behave in this manner.  Thank you in
> advance,
>
> Ryan


  • Prev by Date: Re: Re: Wolfram Workbench
  • Next by Date: Re: Re: word
  • Previous by thread: mathlink error when restarting remote kernel
  • Next by thread: Re: Quaternion problem--> Gell-Man version as dual quaternion