Parallel Mathematica Debugging

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


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


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.


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


Setting a Breakpoint

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


Exporting Definitions

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


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.


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


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