Saturday, April 27, 2013

Remote kernel for Mathematica via home router

Let's say you are sitting at home, surfing internet via your wireless router, and suddenly feel the unexplained urge to run some Mathematica computations. You can not do that using your laptop: the urge is too powerful, it requires 16 parallel kernels. But you can do that using your workstation which is sitting at your office 10 miles away (it's raining outside).  “Remote kernel is a solutions”, you think.


So you open “Kernel Configuration Options” in your local copy of Mathematica and add a remote kernel with just basic options:

Machine Name: my.office.work.edu
Remote Login: killbull
Kernel Program: math

You type “2+2” in the Front End, enter ssh password and get, instead of “4”, the frustrating error message: 

The kernel New Kernel failed to connect to the front end. (Error = MLECONNECT). You should try running the kernel connection outside the front end.

Being a smart person you immediately realize the following:
  1. Remote kernel can’t talk to your local Front End since you have firewall running. You add exception for the remote workstation’s IP address right away.
  2. Since you use the router your IP is 192.168.1.10 and is not visible from the ourside world. You have to make a VPN connection to your office network to allow the remote kernel to talk to your local Front End. It’s done in no time.  
In order to figure out the host name assigned to your laptop you run in terminal:


$ math -mathlink -linkcreate -linkprotocol TCPIP
Link created on: 33234@129-3-222-111.vpn.uh.edu,23253@129-3-222-111.vpn.work.edu

So remote Mathematica’s kernel will happily communicate with 129-3-222-111.vpn.work.edu. Obviously, you can google "what is my IP" and it instead.

Now you return to Mathematica’s “Kernel Configuration Options” and edit your remote kernel's properties. You click  “Advanced Options” and instead of Mathematica’s default

`java` -jar `mathssh` killbull@my.office.work.edu math -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName "`linkname`" -LinkHost `ipaddress`

you enter

ssh  killbull@my.office.work.edu /home/killbull/install/bin/MathKernel -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName "`linkname`" -LinkHost `129-3-222-111.vpn.work.edu`

Here

- “ssh” is instead of “`java` -jar `mathssh`“ so that Mathematica will use regular OpenSSH to communicate. This will allow you to make use of your huge .ssh/config file.
- “/home/killbull/install/bin/MathKernel” instead of just “math” since your Mathematica binaries on the remove machine are not in the PATH.
- “129-3-222-111.vpn.work.edu” instead of “ipaddress” so that remote Kernel will know where to find you local Front End.

Now everything work’s, and you can start to satisfy your urge immediately.

Monday, October 24, 2011

Wiener on scientific cooperation

“[Cybernetics is a] boundary regions of science which offer the richest opportunities to the qualified investigator. They are at the same time the most refractory to the accepted techniques of mass attack and the division of labor [...] a proper exploration of these blank spaces on the map of science could only be made by a team of scientists, each a specialist in his own field but each possessing a thoroughly sound and trained acquaintance with the fields of his neighbors; all in the habit of working together, of knowing one another’s intellectual customs, and of recognizing the significance of a colleague’s new suggestion before it has taken on a full formal expression. The mathematician need not have the skill to conduct a physiological experiment, but he must have the skill to understand one, to criticize one, and to suggest one. The physiologist need not be able to prove a certain mathematical theorem, but he must be able to grasp its physiological significance and to tell the mathematician for what he should look.”

Norbert Wiener. Cybernetics: or Control and Communication in the Animal and the Machine. The Massachusetts Institute of Technology, second edition, 1948. p.2

Cited from arXiv:1107.2984v1 

Thursday, July 21, 2011

On the link between epistemology and tolerance

“It was this doctrine of an essential human fallibility which Nicolas of Cusa and Erasmus of Rotterdam (who refers to Socrates) revived; and it was the ‘humanist’ doctrine (in contradistinction to the optimistic doctrine of which Milton relied, the doctrine that truth will prevail) which Nicolas and Erasmus, Montaigne and Locke and Voltaire, followed by John Stuart Mill and Bertrand Russell, made the basis of the doctrine of tolerance. ‘What is tolerance?’ asks Voltaire in his Philosophical Dictionary; and he answers: ‘It is a necessary consequence of our humanity. We are all fallible, and prone to error; let us then pardon each other's follies. This is the first principle of natural right.’”

Quoted from: K. Popper, Conjectures and Refutations, Routledge (2008) p. 22

Friday, July 15, 2011

K. Popper on theories that are not (yet?) scientific

“I thus felt that if a theory is found to be non-scientific, or ‘metaphysical’ (as we might say), it is not thereby found to be unimportant, or insignificant, or ‘meaningless’, or ‘nonsensical’. But it cannot claim to be backed by empirical evidence in the scientific sense—although it may easily be, in some genetic sense, ‘the result of observation’.”

Quoted from: K. Popper, Conjectures and Refutations, Routledge (2008) p.50-51