The difference between profiling serial and parallel applications with the AIX profilers is that serial applications can be run to generate a single profile data file, while a parallel application can be run to produce many.
You request parallel profiling by setting the compile flag to -p or -pg as you would with serial compilation. The parallel profiling capability of PE creates a monitor output file for each task. The files are created in the current directory, and are identified by the name mon.out.taskid or gmon.out.taskid, where taskid is a number between 0 and one less than the number of tasks.
Following the traditional method of profiling using the AIX operating
system, you compile a serial application and run it to produce a single
profile data file that you can then process using either the prof
or gprof commands. With a parallel application, you compile
and run it to produce a profile data file for each parallel task. You
can then process one, some, or all the data files produced using either the
prof or gprof commands. The following table
describes how to profile parallel programs. For comparison, the steps
involved in profiling a serial program are shown
in the left-hand column of the table.
The parallel utility, mp_profile( ), may also be used to selectively profile portions of a program. To start profiling, call mp_profile(1). To suspend profiling, call mp_profile(0). The final profile data set will contain counts and CPU times for the program lines that are delimited by the start and stop calls. In C, the calls are mpc_profile(1), and mpc_profile(0). By default, profiling is active at the start of the user's executable.
Note: | Like the sequential version of prof/gprof, if more than one profile file is specified, the parallel version of the prof/gprof command output shows the sum of the profile information in the given profile files. There is no statistical analysis contacted across the multiple profile files. |