-
The following example generates a gprof-like
list from an experiment. The output is a file named er_print.out which
lists the top 100 functions, followed by caller-callee data, sorted by attributed
user time for each.
er_print -outfile er_print.out -metrics e.%user \
-sort e.user -limit 100 -functions -cmetrics a.user \
-csort a.user -callers-callees test.1.er
|
You can also simplify this example into the following independent commands.
However, keep in mind that each call to er_print in a large
experiment or application can be time intensive:
er_print -metrics e.%user -sort e.user \
-limit 100 -functions test.1.er
|
er_print -cmetrics a.%user -csort a.user \
-callers-callees test.1.er
|
-
This example summarizes how time is spent in functions.
er_print -functions test.*.er
|
-
This example shows the caller-callee relationships.
er_print -callers-callees test.*.er
|
-
This example shows which source lines are hot. Source-line
information assumes the code was compiled and linked with -g.
Append a trailing underscore to the function name for Fortran functions and
routines. The 1 after the function name is used to distinguish
between multiple instances of myfunction.
er_print -source myfunction 1 test.*.er
|
-
This example shows only the compiler commentary. It is not
necessary to run your program in order to use this command.
-
These examples use wall-clock profiling to list functions
and callers-callees.
er_print -metrics ei.%wall -functions test.*.er
|
er_print -cmetrics aei.%wall -callers-callees test.*.er
|
-
This example shows how to run a script containing er_print commands.
er_print -script myscriptfile test.1.er
|
The myscriptfile script contains er_print commands.
A sample of the script file contents follows:
## myscriptfile
## Send script output to standard output
outfile -
## Display descriptive information about the experiments
header
## Write out the sample data for all experiments
overview
## Write out execution statistics, aggregated over
## the current sample set for all experiments
statistics
## List functions
functions
## Display status and names of available load objects
object_list
## Write out annotated disassembly code for systime,
## to file disasm.out
outfile disasm.out
disasm systime
## Write out annotated source code for synprog.c
## to file source.out
outfile source.out
source synprog.c
## Terminate processing of the script
quit
|
-
This example shows high-level MPI functions. MPI has many
internal software layers, but this example shows one way to see just the entry
points. There might be some duplicates of symbols, which you can ignore.
er_print -functions test.*.er | grep PMPI_
|