Mathematica 9 is now available
Previous section-----Next section

Housekeeping

The list of available remote kernels is given in $Slaves. This is a read-only variable that contains the active kernel objects you have previously opened with LaunchSlaves, LaunchSlave, or ConnectSlave.
Length[$Slaves] gives you the number of currently connected remote machines or the degree of parallelism.

The Remote Kernel Object

The properties of the remote kernel objects can be obtained with these functions.
ProcessorID[kernel]a unique integer assigned to each kernel
ProcessorName[kernel]the name of the machine on which the kernel is running
ProcessorSpeed[kernel]an estimate of the relative of the remote processor
LinkObject[kernel]the raw MathLink LinkObject that connects to the remote kernel

Host description entries.

To get a nicely formatted listing of properties of the remote kernel connections, use this command. The command is followed by output from a sample session.

Remote Properties

The variable $ProcessorID is set on each remote kernel to its own processor ID.
To get a nicely formatted listing of this and other standard properties of the remote kernels, use this command. The command is followed by output from a sample session.

Troubleshooting

If you get an error message and the result $Failed when using LaunchSlave, the connection could not be established. There are a number of reasons this can happen:
  • The remote computer cannot be reached over the network, or you do not have sufficient privileges to execute remote commands on the computer.
  • The remote computer does not run an ssh or rsh daemon. Such daemons are standard under Unix and Mac OS X and available as third-party products under Windows.
  • Mathematica may not be installed correctly on the remote computer, the math command may not be on your search path, or you do not have a sufficient number of Mathematica licenses.
  • Your remote execution command on Windows has exceeded the low, arbitrary limit on command length that Microsoft imposes on command execution. Please refer to the section Remote Execution under Windows for more details. In most cases, Parallel Computing Toolkit will tell you that running the command has failed with exit code -1.
You can still continue to use any remote kernels that you could launch correctly; failed connections will never be used by the Toolkit.
The variable $Slaves gives the current list of remote connections that started up normally. If there is at least one, you can continue to work with this package. Evaluating the expression $Slaves will return the value of this variable.
To diagnose network problems, you can use the netstat operating system command in a Unix shell or MS-DOS window. You should try command-line arguments to find which will work on your operating system; most likely it will be one of the following.
The output of netstat will list existing TCP connections to remote computers. Each remote kernel will occupy one or two such TCP connections.

Tracing MathLink Commands

With debugging and tracing enabled, LinkLaunch[] will show you which MathLink commands it runs to establish a connection with a remote kernel. To use these features, you have to load the debugging package before loading the toolkit itself.
In[1]:=
In[2]:=
Now you can enable MathLink tracing.
In[3]:=
Out[3]=

Sample trace of a callback connection

This sample output shows how a default connection to a remote host is established. The output shown is
  • the LinkCreate[] command used to establish a listening link on the local machine.
  • the resulting link created
  • the command run to start the remote kernel with all placeholders filled in
  • the exit code of this command (should be 0)
  • the remote kernel object of the new kernel
In[4]:=
Out[4]=

Sample trace of a LinkLaunch connection

This sample output shows how a default connection to the local host is established. The output shown is
  • the LinkLaunch[] command used to start the kernel, containing the operating system command to start the kernel itself and the LinkLaunch[] options used
  • the resulting link created
  • the remote kernel object of the new kernel
In[5]:=
Out[5]=
To turn off tracing when you are done, use
In[6]:=
Out[6]=


Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.