Prism's MPI performance analysis involves several steps. The tnfcollection and tnfview commands shorten the sequence of steps by taking several automatic default values. If you chose not to accept the default behavior of the tnfcollection and tnfview commands, you can override the default behavior by issuing the individual performance analysis commands with values of your own choice. For a complete list of the performance analysis commands, see Table 6-1.
Issue the tnfcollection on command, or select Collection from the Performance menu:
Adds /opt/SUNWhpc/lib/tnf to your LD_LIBRARY_PATH.
Establishes a default file name for the TNF data.
Sets the minimum size for data collection buffers (128 Kbytes).
Enables all probes.
Turns on TNF data collection.
If you prefer to control the naming of TNF data files, you can define your own TNF data file name with the tnffile command before issuing the Prism run command. Using tnffile, you can specify the name of the final trace data file and the size of the trace data collection buffers. The file name substitutes for the automatically generated file name created by the tnfcollection on command. The size argument allows you to specify the size of the data collection buffers used by each process of your program. However, if you specify a file name that already exists, Prism issues an error message "file already exists" and ignores the tnffile command.
Issue Prism's run command
Prism automatically creates the file name for the TNF trace data. Prism creates the file, then displays the file name in a message in the Prism command window. For example:
TNF data will be saved in file /home/mycomm/tests/prism0308.0.tnf
At the conclusion of the run, Prism collects the information from each process and merges the data in the named TNF data file.
Issue the tnfview command after the program completes to display the current TNF data file
You can also launch the TNF viewer by selecting Display TNF Data from the Prism Performance menu.
You can repeat steps two and three as often as you wish. Each time that you run your program, Prism creates another TNF data file.
If you use the filename argument of the tnffile command to specify the name of the TNF data file, such as myfile.tnf. Prism will remember that file name. If you then issue the tnfview command without specifying a file name argument, Prism will supply the file named in the prior use of the tnffile command during the same session.
The second argument to the tnffile command, the size argument, allows you to control how large the trace data collection buffers will be for each process in your Sun MPI program. The default size is 128 Kbytes. For further information about the size of trace data files, see "Controlling Buffer Size".
During program execution, only the enabled TNF probes contribute trace data to the performance analysis process. By default, programs start with TNF probes disabled. Once enabled (by issuing the tnfenable command, for example), probes remain enabled until you explicitly turn them off, exit the loaded program, or exit Prism.
For example, to enable all probes in the TNF-instrumented Sun MPI library:
(prism all) tnfenable mpi_api
You could also enable all of the same probes with:
(prism all) tnfenable *
You can use the tnfcollection command as an event action specifier, focusing the effect of TNF data collection on the places in your program that matter most. For example, set breakpoints before and after an interesting part of your program:
(prism all) tnfenable mpi_api (prism all) stop at foo {tnfcollection on} (prism all) stop at bar {tnfcollection off}
Prism collects TNF trace data only where you tell it to. For more information about event action specifiers, see " Actions in Events".
If you use a specific directory to run TNF performance analysis, you can set up a .prisminit file in that directory containing a typical set of TNF-related startup commands. For example, you could create a .prisminit file containing these lines:
tnfcollection on run wait tnfview
For further information about .prisminit files, see " Initializing Prism".