| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Parallel Computing Toolbox |
| Contents | Index |
| Learn more about Parallel Computing Toolbox |
When writing code for Parallel Computing Toolbox software, you should advance one step at a time in the complexity of your application. Verifying your program at each step prevents your having to debug several potential problems simultaneously. If you run into any problems at any step along the way, back up to the previous step and reverify your code.
The recommended programming practice for distributed or parallel computing applications is
Run code normally on your local machine. First verify all your functions so that as you progress, you are not trying to debug the functions and the distribution at the same time. Run your functions in a single instance of MATLAB software on your local computer. For programming suggestions, see Techniques for Improving Performance in the MATLAB documentation.
Decide whether you need a distributed or parallel job. If your application involves large data sets on which you need simultaneous calculations performed, you might benefit from a parallel job with distributed arrays. If your application involves looped or repetitive calculations that can be performed independently of each other, a distributed job might be appropriate.
Modify your code for division. Decide how you want your code divided. For a distributed job, determine how best to divide it into tasks; for example, each iteration of a for-loop might define one task. For a parallel job, determine how best to take advantage of parallel processing; for example, a large array can be distributed across all your labs.
Use pmode to develop parallel functionality. Use pmode with the local scheduler to develop your functions on several workers (labs) in parallel. As you progress and use pmode on the remote cluster, that might be all you need to complete your work.
Run the distributed or parallel job with a local scheduler. Create a parallel or distributed job, and run the job using the local scheduler with several local workers. This verifies that your code is correctly set up for batch execution, and in the case of a distributed job, that its computations are properly divided into tasks.
Run the distributed job on only one cluster node. Run your distributed job with one task to verify that remote distribution is working between your client and the cluster, and to verify file and path dependencies.
Run the distributed or parallel job on multiple cluster nodes. Scale up your job to include as many tasks as you need for a distributed job, or as many workers (labs) as you need for a parallel job.
Note The client session of MATLAB must be running the Java™ Virtual Machine (JVM™) to use Parallel Computing Toolbox software. Do not start MATLAB with the -nojvm flag. |
![]() | Using Parallel Computing Toolbox Software | Life Cycle of a Job | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |