Here's how to create and connect to remote Mathematica kernels running on the Victor and Igor machines in the office.
These instructions currently do not describe how to connect through a VPN outside of Oxford.
Skip this step. Windows users must instead enter the questlink@
password for Victor or Igor each time they connect to a remote kernel through Mathematica.
- Ensure your client machine has an RSA key
On Linux/MacOS:
ssh-keygen -t rsa
and enter n (don't overwrite) if it asks about an overwrite, otherwise enter y.
- Add your client key to the
questlink
account on Victor or Igor
cat ~/.ssh/id_rsa.pub | ssh questlink@victorslab.materials.ox.ac.uk 'cat >> .ssh/authorized_keys'
cat ~/.ssh/id_rsa.pub | ssh questlink@igor-gpu.materials.ox.ac.uk 'cat >> .ssh/authorized_keys'
- Update your authentication agent
ssh-add -K ~/.ssh/id_rsa
In a Mathematica notebook, go to Evaluation > Kernel Configuration Options > Add...
-
set Kernel name to
Victor
orIgor
-
tick Basic options
-
set Machine Name
For Victor:
victorslab.materials.ox.ac.uk
For Igor:
igor-gpu.materials.ox.ac.uk
-
set Remote Login to
questlink
-
set Kernel Program
For Victor:
$WOLF_KERNEL_PATH/WolframKernel
For Igor:
/Applications/Mathematica.app/Contents/MacOS/MathKernel`
-
press Ok
In a Mathematica notebook, go to Evaluation > Kernel Configuration Options > Add...
-
set Kernel name to
Victor
orIgor
-
tick Advanced Options
-
set Arguments to MLOpen to
-LinkMode Listen -LinkProtocol TCPIP -LinkOptions MLDontInteract
-
Set Launch command
For Victor:
ssh questlink@victorslab.materials.ox.ac.uk '$WOLF_KERNEL_PATH/WolframKernel -wstp -LinkMode Connect -LinkProtocol TCPIP -LinkName "`linkname`"'
For Igor:
ssh questlink@igor-gpu.materials.ox.ac.uk '/Applications/Mathematica.app/Contents/MacOS/MathKernel -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName "`linkname`" -LinkHost `ipaddress`'
-
press Ok
You can start and connect to kernels on Victor and Igor at any time by, from within a Mathematica notebook, selecting
Evaluation > Notebook's Kernel
. Windows users will additionally need to enter Victor/Igor'squestlink@
password at the first evaluation. Any entered commands will be sent to Victor and Igor, executed there, and the otuput returned. Files will ergo be read and written on Igor and Victor. To run a command on your client kernel (and share the result with Victor and Igor), wrap it in a call toUsingFrontEnd[]
Victor and Igor are set up to run
QuESTlink
using their Quadro P6000 GPUs. While connected to the remote kernel, run in MathematicaImport["https://quest.qtechtheory.org/QuEST.m"] env = CreateLocalQuESTEnv[];
Note Victor is running Ubuntu and Igor is running MacOS. Therefore calling
CreateDownloadedQuESTEnv[]
on Victor will download an incompatible MacOS executable. If this occurs, correct the file via the (undisclosed) admin account.ssh ... sudo /home/questlink/quest_link_backup /home/questlink/quest_link