User`s guide

6 Programming Overview
6-32
Programming Tips
In this section...
“Program Development Guidelines” on page 6-32
“Current Working Directory of a MATLAB Worker” on page 6-33
“Writing to Files from Workers” on page 6-34
“Saving or Sending Objects” on page 6-34
“Using clear functions” on page 6-34
“Running Tasks That Call Simulink Software” on page 6-35
“Using the pause Function” on page 6-35
“Transmitting Large Amounts of Data” on page 6-35
“Interrupting a Job” on page 6-35
“Speeding Up a Job” on page 6-35
Program Development Guidelines
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
1
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.
2
Decide whether you need an independent or communicating job. If your
application involves large data sets on which you need simultaneous calculations
performed, you might benefit from a communicating job with distributed arrays.
If your application involves looped or repetitive calculations that can be performed
independently of each other, an independent job might be appropriate.