Special Ways to Run the KernelYour first calculation in a Mathematica session will automatically start a kernel. You can also run the Mathematica kernel directly from a command line or run a Mathematica kernel on a remote machine. To run the kernel from a command line:- Type math at a command line and then press
to start the kernel. All Mathematica input and output will appear in the command-line window.
To launch the kernel on Mac OS X, type the full pathname in a Terminal window. For example, if you installed Mathematica in the Applications folder, type
"/Applications/Mathematica 5.1.app/Contents/MacOS/MathKernel"
To quit Mathematica on any platform, type Exit[]. You will be returned to the command-line prompt. TIP
Windows: You can run the kernel as a stand-alone application by choosing All Programs Mathematica 5.1 Mathematica 5.1 Kernel from the Start menu. Batch filesWhen doing very large calculations, you may find it convenient to run Mathematica in batch mode. You can prepare a file with many lines of Mathematica input, read it into Mathematica, and save the result to another file using the command: math < infile > outfile It is sometimes useful to make the first line in the file AppendTo[$Echo, "stdout"] so that the input lines will also be included in the output file. Running the kernel remotelyThe front end can be connected to a kernel running on a remote machine. When you run a remote kernel, remember that kernel commands involving files act on the remote computer's file system, not the local computer's file system. Mathematica 5 supports kernels from Version 3.0.1 and later. Version 5 normally connects to other kernels using the TCP/IP MathLink device to make kernel connections. Earlier versions of Mathematica do not support TCP/IP connections. For more information, see support.wolfram.com/mathematica/mathlink. Remote kernel connection on a trusted host- Choose Kernel
Kernel Configuration Options. - In the dialog box that appears, click Add.
- Fill out the Kernel Name text field, which will be the name given in the list of available kernels.
- Specify that the kernel is on a remote machine.
- Give the hostname of the remote machine.
- Type your username for the remote machine.
- Click OK to close the Kernel Properties dialog box.
- Click OK to close the first dialog box.
To use the new kernel, go to the Kernel menu and choose the new kernel from either the Start Kernel, Default Kernel, or Notebook's Kernel submenu. Remote kernel setup on a nontrusted hostIf the remote computer does not consider your computer a trusted host, you should change the remote kernel configuration to allow you to enter your password for the remote computer. To modify a remote kernel configuration to request entry of a password:- Set up a remote kernel according to the previous instructions. In the Kernel Properties dialog box, check the box labeled "Request password when connecting".
- Click OK.
To use a remote kernel that requests a password:- Choose the remote kernel from either the Start Kernel, Default Kernel, or Notebook's Kernel submenu.
- If you have selected the remote kernel as the default kernel or as the current notebook's kernel, launch it by entering an expression and pressing
  . As the remote kernel is started up, a Remote Login dialog box will pop up. - Enter your password for the remote machine in the Password field.
- Click Connect. The Remote Login dialog box will disappear.
On some computers, it may take several seconds for the Mathematica kernel to start up and produce output for your first calculation. If a remote kernel connection fails to start up correctly, the Mathematica front end will treat that connection as idle. If you want to try opening the connection again, you should first choose Kernel Quit Kernel and click the name of the idle connection to close it. TIPS
Mac OS X: Application bundles have the extension .app when viewed from the command line.
Command-line options for Unix are listed in Troubleshooting on Unix/Linux. Command-line options for Mac OS X are listed in Troubleshooting on Mac OS X.
|