Computing, use an external host for Mathematica
How to use an external host for the evaluation of your Mathematica notebook
When one wants to work with Mathematica on a large scale Unix system, having a Windows PC, there are some possibilities. One can install a xterm-emulation program, or one can install a Unix desktop emulation program, per example HCLExceed. Both given a lot of humbug to get the right environment installed. A very straightforward way to get what you want is just to use the Mathematica kernels from your local Mathematica frontend. Not the first solution I looked for. For anyone working with Mathematica on any platform, here is the easy solution.
- Start Mathematica (a Mathematica frontend)
- Goto the the Evaluation menu
- Choose Kernel Configuration Options
- Choose Add for additional kernel systems in this popup.
- Type Kernel name, Hostaddress of Machine Name and account nam
for Remote Login and press OK.
note: It can be handy to append the kernel name tot the In/Out prompts.
When connecting to the remote host, the password for the remote system will be asked.
- Finally. To use the remote machine kernel go again to the Evaluation menu and choose Default/Notebook kernel to alter the corresponding kernel. Have also a look in the Parallel Configuration item of this Evaluation menu, to use parallel kernels on the remote machine!
How to kill dangling MathKernel processes
Easy starting MathKernel processes from your local Mathematica frontend comes at a price: it takes some extra attention to find and cleanup dangling processes.
If it is not already installed, install PuTTY using the "Windows installer" on the PuTTY Download Page
- Start PuTTY
- In the Host Name field, enter the machine name where the Mathematica kernels are running
- You may get a warning: The server's hostkey is not cached in the registry.
For details, see the Help provided by PuTTY, Index, verifying the host key.
- Follow the login procedure
Now find your MathKernel processes:
ps -u $USER -C MathKernel -o pid,ppid,user,s,lstart,ucmd --sort ppid
This will display your MathKernel processes with the common parent process id (PPID) first:
PID PPID USER S STARTED CMD 14943 14918 unixhelp S Fri Mar 9 13:50:10 2012 MathKernel 15285 14943 unixhelp S Fri Mar 9 13:51:27 2012 MathKernel 15443 14943 unixhelp S Fri Mar 9 13:51:31 2012 MathKernel 15595 14943 unixhelp S Fri Mar 9 13:51:35 2012 MathKernel 15751 14943 unixhelp S Fri Mar 9 13:51:39 2012 MathKernel 15909 14943 unixhelp S Fri Mar 9 13:51:43 2012 MathKernel 16062 14943 unixhelp S Fri Mar 9 13:51:46 2012 MathKernel 16215 14943 unixhelp S Fri Mar 9 13:51:50 2012 MathKernel 16373 14943 unixhelp S Fri Mar 9 13:51:54 2012 MathKernel 16529 14943 unixhelp S Fri Mar 9 13:51:59 2012 MathKernel 16679 14943 unixhelp S Fri Mar 9 13:52:03 2012 MathKernel 16837 14943 unixhelp S Fri Mar 9 13:52:07 2012 MathKernel 16993 14943 unixhelp S Fri Mar 9 13:52:11 2012 MathKernel 17152 14943 unixhelp S Fri Mar 9 13:52:16 2012 MathKernel 17312 14943 unixhelp S Fri Mar 9 13:52:20 2012 MathKernel 17463 14943 unixhelp S Fri Mar 9 13:52:24 2012 MathKernel 17621 14943 unixhelp S Fri Mar 9 13:52:28 2012 MathKernel
To kill dangling processes:
or with more force:
pkill -KILL MathKernel
In the S(tate) column, you may find Z(ombie) processes. These are already terminated but still need to convey information to their parent. If the parent terminates before retrieving that information (through a "wait" call) the zombie processes are adopted by the "init" process and removed automatically.