Parallel Mathematica Debugging


You can do debugging of your parallel Mathematica code with the Wolfram Workbench.

Setup

You need to have Mathematica 7 or higher installed on your system.

Launching

Next you should launch Mathematica in debugging mode. It is important to launch in debug mode before carrying out any parallel work.

Once you have launched Mathematica you may launch subkernels.

gridMathematica

You can see the subkernels that are launched in the Debug view.

gridMathematica

Setting a Breakpoint

Now you can set a breakpoint in the code in your project.

gridMathematica

Exporting Definitions

You need to load the code in the master kernel and export its definitions to the subkernels.

gridMathematica

Hitting a Breakpoint

At this point you can execute a remote command to evaluate the function definition. The following executes the function in both subkernels.

gridMathematica

A breakpoint is hit in both subkernels, and the Debug view shows the stack for both.

gridMathematica

In this way you can find out the state of each subkernel. This could be very useful in improving your parallel application.