User`s guide
Programming Tips
6-35
clears all Parallel Computing Toolbox objects from the current MATLAB session. They
still remain in the MJS. For information on recreating these objects in the client session,
see “Recover Objects” on page 7-14.
Running Tasks That Call Simulink Software
The first task that runs on a worker session that uses Simulink software can take a long
time to run, as Simulink is not automatically started at the beginning of the worker
session. Instead, Simulink starts up when first called. Subsequent tasks on that worker
session will run faster, unless the worker is restarted between tasks.
Using the pause Function
On worker sessions running on Macintosh or UNIX operating systems, pause(Inf)
returns immediately, rather than pausing. This is to prevent a worker session from
hanging when an interrupt is not possible.
Transmitting Large Amounts of Data
Operations that involve transmitting many objects or large amounts of data over the
network can take a long time. For example, getting a job's Tasks property or the results
from all of a job's tasks can take a long time if the job contains many tasks. See also
“Object Data Size Limitations” on page 6-52.
Interrupting a Job
Because jobs and tasks are run outside the client session, you cannot use Ctrl+C (^C)
in the client session to interrupt them. To control or interrupt the execution of jobs and
tasks, use such functions as cancel, delete, demote, promote, pause, and resume.
Speeding Up a Job
You might find that your code runs slower on multiple workers than it does on one
desktop computer. This can occur when task startup and stop time is significant relative
to the task run time. The most common mistake in this regard is to make the tasks too
small, i.e., too fine-grained. Another common mistake is to send large amounts of input or
output data with each task. In both of these cases, the time it takes to transfer data and