8
$\begingroup$

Context

I find the front end on macos way more convenient and I would like to keep my notebooks on my macbook. On the other hand, I have access faster multi-core linux machines behind a LAN.

Hence I would like to be able to use machines with multiple cores which are within a private LAN as remote kernels for a Mathematica front end running on a mac laptop.

The setting is the following:

Mathematica graphics

Attempts

  • I know how to set up the (mac) front end on the laptop to run MathKernels on the front-end. (dark green MathLink connection)
  • I know how to set up the the (linux) front end to run MathKernels on the compute nodes. (light green MathLink connection)
  • If I put my laptop within the private LAN I can run MathKernels on the compute nodes

Question

How do I simply setup the extra options in this dialog box Mathematica graphics

so as to tunnel through to,say compute 2 from my mac laptop?

Update

@Szabolcs suggests this set of updated scripts

$\endgroup$
4
  • 1
    $\begingroup$ Might be useful: library.wolfram.com/infocenter/Conferences/7250 $\endgroup$ Commented Dec 10, 2014 at 21:06
  • $\begingroup$ @Szabolcs Thanks. I did find this but it seems to involve mma 6 and looks a bit complicated. $\endgroup$ Commented Dec 10, 2014 at 21:08
  • 1
    $\begingroup$ Finally found it: stackoverflow.com/q/6226196/695132 Take a look at the comments for a newer version of the same (by 'sakra'). I don't use this myself anymore so can't give much advice ... the reason is that I found remote connections to be extremely unreliable when I was using Windows XP (freezing front end), so I gave up. I remember others told me they couldn't reproduce the problems I saw on more modern systems, so you shouldn't give up on OS X because of this. $\endgroup$ Commented Dec 10, 2014 at 21:16
  • $\begingroup$ Thanks again. I ll try tomorrow at work! $\endgroup$ Commented Dec 10, 2014 at 21:18

1 Answer 1

5
$\begingroup$

Having convinced our SysAdmin to grant me access to one compute node by VPN,

I managed to connect to one compute node (b1) using the following parameters in the KernelConfiguration submenu in the Evaluation menu.

Mathematica graphics

Note that I added both to MLOpen and to Launch command the extra parameter

 -Linkhost xxx.xxx.xxx.xxx 

where xxx.xxx.xxx.xxx is the IP address of the front-end through the VPN. (which you can access via ifconfig on the frontend host), e.g.

 utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500 inet 10.8.0.18 

in my case

Then, having launched this tunnel1 Kernel, I am able to drive another sets of three compute nodes via the following command (each of them 40 cores):

Needs["SubKernels`RemoteKernels`"]; (LaunchKernels[ RemoteMachine[#, "ssh -x -f -l `3` `1` math -mathlink -linkmode Connect `4` \ -linkname '`2`' -subkernel -noinit", 40]] // Length) & /@ {"b2","b3","b4"} $KernelCount 

(* 160 *)

I am now in a position to use 160 kernels instead of 4, which is pretty cool ;-)

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.