MathGroup Archive 2011

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

Search the Archive

Re: How to kill slave kernel securely?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117148] Re: How to kill slave kernel securely?
  • From: Todd Gayley <tgayley at wolfram.com>
  • Date: Thu, 10 Mar 2011 06:14:35 -0500 (EST)

At 06:00 AM 3/9/2011, Alexey wrote:
>Good day,
>
>LinkClose[link] "does not necessarily terminate the program at the
>other end of the connection" as it is said in the Documentation. Is
>there a way to kill the process of the slave kernel securely?


Alexey,

As you note, the kernel doesn't always die immediately when the link 
to it closes. That requires some cooperation from the kernel, and if 
the kernel is deep in some computational library function, it might 
not be in a position to respond. A much stronger step than just 
closing the link is to send the kernel an MLTerminateMessage. From 
top-level code (which is what I know you are using):

   LinkInterrupt[link, 1] (* An undocumented form that lets you pick 
the message type *)

In C:

   MLPutMessage(link, MLTerminateMessage);

In Java using J/Link:

   link.terminateKernel();

In .NET using .NET/Link:

   link.TerminateKernel();


Todd Gayley
Wolfram Research



  • Prev by Date: Re: Mathematica 8.0.1 for Mac $Version string?
  • Next by Date: Re: Gotcha?
  • Previous by thread: Re: How to kill slave kernel securely?
  • Next by thread: Re: How to kill slave kernel securely?