Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have Mathematica 9 installed on two Windows Server 2008 R2 machines. Now i want to try using one of them as a frontend with local kernels and the other one for remote kernels.

OpenSSH 6.5 for Windows is installed on both machines and key authentication is configured without a passphrase. SSH connection works normally.

Here is the frontend configuration. In Preferences -> Parallel -> Remote Kernels i Add Host and use the custom launch command:

ssh -l username `1` "c:/progra~1/wolfra~1/mathematica/9.0/mathkernel.exe -mathlink -linkmode Connect `4` -linkname '`2`' -subkernel -noinit >& /dev/null &

For test purposes i set 2 remote and 2 local kernels in settings. After that in the notebook i try to call

Parallel`Settings`$MathLinkTimeout = 40
LaunchKernels[]

and launch Task Manager on both machines. At first two cmd windows appear and instantly close. Then i can see that two MathKernel.exe processes start on BOTH machines, but after nearly 20 seconds kernels shut down on remote machine. Local kernels stay running. After timeout i see an error output.

SubKernels`Protected`kernelFlush::time: Operation LinkWrite timed out after 40 seconds.
KernelObject::rdead: Subkernel connected through remote[1.1.1.1] appears dead. >>
SubKernels`Protected`kernelFlush::time: Operation LinkWrite timed out after 40 seconds.
KernelObject::rdead: Subkernel connected through remote[1.1.1.1] appears dead. >>
Out[9]= {KernelObject[7,local],KernelObject[8,local],$Failed,$Failed}

What am i missing? A solution would be greatly appreciated.

Update: According to Szabolcs's comments i tried some other things.

  1. My ssh command really had an open quote - removed.
  2. Changed /dev/null redirections to ssh -f and -n keys.
  3. Changed mathkernel.exe to math.exe in the path
  4. Tried this solution. It works, so it's not a problem of connection or firewall.

So now my ssh command looks like:

ssh -f -n user@remote_ip c:/progra~1/wolfra~1/mathematica/9.0/math -mathlink -linkmode Connect -linkprotocol TCPIP -linkname 'some_port@local_ip,some_port2@local_ip' -subkernel -noinit

And it doesn't work with the same behavior. When i try to run this command in the command line, math.exe starts on remote machine and then closes itself. After that on the local machine in the command line i see this message:

LinkConnect::linkc:
-- Message text not found -- (
LinkObject[some_port@local_ip,some_port2@local_ip, 3, 1])
share|improve this question
    
Have you tried disabling the firewalls? Are you sure the quoting in the launch command, in particular the -linkname part, is correct and necessary for Windows? The >& /dev/null & part doesn't sound like it would work on Windows as this is Unix-specific. The " quote is not closed. I hope some of these comments will help you debug the issue. Generally, I find debugging remote kernel issues very frustrating, especially on Windows. –  Szabolcs Feb 18 at 17:43
    
Here's an idea for making sure that the network connection is working correctly between the two computers (and firewalls aren't blocking anything): try starting Mathematica on both machines, and use LinkCreate to create a LinkProtocol -> "TCPIP" link one one, then use LinkConnect to connect to that link from the other computer. Study the examples on the doc pages of the various Link* functions to figure out the correct syntax (unfortunately I don't know it by heart and would need to do the same). –  Szabolcs Feb 18 at 17:46
    
If it seems you managed to connect this way, see this tutorial on how you can test the connection: reference.wolfram.com/mathematica/tutorial/… –  Szabolcs Feb 18 at 17:47
    
Finally, if you or your institution has 'Premiere Service' then I think you should have access to the Wolfram Lightweight Grid which will significantly simplify using remote subkernels. –  Szabolcs Feb 18 at 17:49
    
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.