Program development tools
We highly recommend that you use makefiles and an appropriate
source code control system (like CVS) to save time maintaining
complex programs.
Debugging
When code crashes on BGL, usually it generates core.# (# is process
id) files, which are plain-text stack traces. One can figure out where
code crashed by using:
addr2line -e executable address
Addresses are from the "function call chain:" section at the end of
the core file.
Perl script /contrib/bgl/bin/decode.pl can automatically spit out a
full stack trace for a given binary. Code has to be compiled and
linked with the '-g' flag to get the proper routine names.
Run this perl script as:
/contrib/bgl/bin/decode.pl executbale core.0
gprof
To profile a program with gprof:
- compile program with "-pg" option (or add "-pg" to compile flag).
- run program
When the program finishes, a file "gmon.out.0" will be
generated. If it is an MPI program using n processors, there will be n
gmon.out.# files, where # is from 0 to n-1.
- run "gprof your-executable gmon.out.0" to get the profile.
You will get a report with the following information:
index % time self children called name
Based on this report, you can find out how much time is being used in each function/subroutine.
Xprofiler
Xprofiler is an enhanced version of gprof. When analyzing a
program, it provides a graphical user interface and additional
information such as the time spent in each source line.
Compile and run program as above. Then run:
/contrib/fe_tools/xprofiler/bin/Xprofiler your-executable gmon.out.0
See "/contrib/fe_tools/xprofiler/doc/README" for more information.
HPM
Hardware performance monitor (HPM) provides comprehensive reports of
events that are critical to performance on IBM systems. In addition to
the usual timing information, HPM is able to gather critical hardware
performance metrics, such as the number of misses on all cache levels,
the number of floating point instructions executed, and the number of
instruction loads that cause TLB misses, that help the algorithm
designer or programmer identify and eliminate performance bottlenecks.
See the file "/contrib/bgl/hpm/doc/README" for instructions on how
to use HPM. Examples are located under /contrib/bgl/hpm/example. Directory
test1 has examples for C code and test2 for Fortran code.
mp_profiler
This is an MPI profiler and trace tool, installed in
/contrib/bgl/mp_profiler. Instructions for usage are at
/contrib/bgl/mp_profiler/doc/README. Examples are located under
/contrib/bgl/mp_profiler/example, complete with Makefile.
Compiler-loader options are available for trapping
floating-point exceptions in your code.
Next page |
Table of contents - Frost user
guide
If you have questions about this document, please contact
CISL Customer Support.
You can also reach us by telephone 24 hours a day, seven days a week at
303-497-1278.
Additional contact methods:
consult1@ucar.edu
and during
business hours
in NCAR Mesa Lab Suite 39.
© Copyright 2004-2007. University Corporation for Atmospheric
Research (UCAR). All Rights Reserved.
Address of this page:
http://www.cisl.ucar.edu/docs/frost/tools.jsp
|