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 spend almost two week to figure out how mma could use a remote kernel. The following is my results:

  1. The basic environment is: mma9.0.1 on win8 as my host (local machine); mma9.0.1 on Deiban 7 as a remote one (d1), its host name is assumed to be aaa.bbb.com.
  2. It seems all the methods provided on the net are not working for me.
  3. I can connect to the remote one from another debian system, assume it's name d2:
    • First, I generate a ssh-key on d2: ssh-keygen -t rsa -b 2048 and press Enter for default location.
    • Second, I copy the key to d1 : ssh-copy-id username@aaa.bbb.com, where username is the username of d1. It asks me to input my password for my account on d1.
    • Now I can login d1 from d1 with: ssh username@aaa.bbb.com without password
    • It should be noted that, all the above steps can be skipped, in which case I am required to input my password for username on d1 every time.
    • Now I am ready to launch mma on d1: ssh username@aaa.bbb.com math, which will feedback a Mathematica shell as In[1]:=, and run a test: 1 + 1 and Enter. I see Out[1]= 2, so it is clear that the connection from d2 to d1 works. (I can quit Mathematica from d1 by Quit or Exit)
  4. Then the problem is that I want to connect d1 from my win8. As I mentioned all the solutions seem not to work, such as:

    • Official doc, after I input the right password, it alerts me with something like the remote machine refused, error code 113
    • Official debug doc, all the steps seems right, but the results can be return back, It still runing after ten min.
    • How do you use ssh-keys instead of a password to run a remote-kernel over ssh?, it seems that I need to install putty in order to use ssh instead of java. The problem seems that the shell command is not correct, since it is even can't connect to d1. I try to find mathssh.jar in win8, it seems it is not exists?
    • Use putty's plink I successfully install putty, and try the link's suggestion:

      plink -ssh -batch -l `username` `1` "math -mathlink -linkmode Connect `4` -linkname '`2`' -subkernel -noinit  >& /dev/null &"

      to lauch a parallel kernel, the results says that:

      SubKernels Protected kernelFlush::time: Operation LinkWrite timed out after 15. seconds. KernelObject::rdead: Subkernel connected through remote[aaa.bbb.com] appears dead.

  5. I try to fix the missing mathssh problem by How to configure parallel remote kernels in Mathematica?, it works 100%.

  6. Finally, my problem is to find out how to use the remote kernel as default, rather than as the Local kernel. Any ideas?

share|improve this question
    
Does this work for you? I've been using this method for a while and have no problems. I think you can change the default kernel in the menu Evaluation >> Default Kernel . –  xslittlegrass Apr 13 at 22:03

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.