# Using Mathematica on the Newton cluster

The Newton Program currently has a 24-processor license for gridMathematica version 8. This license was purchased by the Dept. of Physics, Office of Research, and College of Arts and Sciences but is available for limited use to all Newton users.

To use the basic Mathematica product, you will first need to load Mathematica into your environment using Modules. To use the Mathematica GUI, you must also have your desktop and ssh client configured for X11 graphics.

$ qlogin -l threads 8 $ module load mathematica $ mathematica

Here we have requested 8 CPU cores on a compute node and launched Mathematica. At this point, you should see the Mathematica GUI window. You may also use the "math" command to launch the text-only mathematica client. By default, mathematica will not be grid enabled. It will only be able to use the CPUs that are on the machine that you are logged into. The next section will enable you to use the gridMathematica functionality.

## Using gridMathematica

The gridMathematica product allows you to use up to 24 mathKernels (computation threads) from a single Mathematica GUI or command-line instance. These mathKernels can be automatically launched by mathematica on the compute node that you initially run mathematica on. To launch parallel kernels:

- Launch the Mathematica client.
- In the Evaluation menu, choose "Parallel Kernel Configuration"
- Click on the "Local Kernels" tab and enable local kernels.
- Select the "Manual setting" for the number of kernels and set this number to the number of CPU cores (threads) that you initially requested via qlogin.
- You can now click on the button for "Parallel Kernel Status"
- Click on "Launch All" to launch the parallel kernels.

The parallel kernels are launched in the background and waiting for use in parallel computations: