MathGroup Archive 2006

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

Search the Archive

mathlink error when restarting remote kernel

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68141] mathlink error when restarting remote kernel
  • From: Ryan Olf <ryanolf at gmail.com>
  • Date: Tue, 25 Jul 2006 04:01:53 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

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: word
  • Next by Date: (correction) pattern sequences
  • Previous by thread: Re: Using methods from packages
  • Next by thread: Re: mathlink error when restarting remote kernel