User`s guide

6 Programming Overview
6-42
Profiling Parallel Code
In this section...
“Introduction” on page 6-42
“Collecting Parallel Profile Data” on page 6-42
“Viewing Parallel Profile Data” on page 6-43
Introduction
The parallel profiler provides an extension of the profile command and the profile
viewer specifically for communicating jobs, to enable you to see how much time each
worker spends evaluating each function and how much time communicating or waiting
for communications with the other workers. Before using the parallel profiler, familiarize
yourself with the standard profiler and its views, as described in “Profiling for Improving
Performance”.
Note The parallel profiler works on communicating jobs, including inside pmode. It does
not work on parfor-loops.
Collecting Parallel Profile Data
For parallel profiling, you use the mpiprofile command within your communicating job
(often within pmode) in a similar way to how you use profile.
To turn on the parallel profiler to start collecting data, enter the following line in your
communicating job task code file, or type at the pmode prompt in the Parallel Command
Window:
mpiprofile on
Now the profiler is collecting information about the execution of code on each worker and
the communications between the workers. Such information includes:
Execution time of each function on each worker
Execution time of each line of code in each function