Debugging, Profiling and Optimization
For debugging scientific applications on the Peregrine systems, there are both standard, simple, open-source tools as such as GDB (see cs.cmu.edu for tutorials) as well as Totalview, a commercial dynamic debugger that is designed for debugging highly scalable applications. In addition, the Intel compiler software environment also includes the idb debugger and the PGI compiler environment includes both command-level and graphical versions of the PGDBG debugger.
For instructions about using GDB on Peregrine go to the GDB page
The easiest approach to enhance the performance of applications is to use appropriate compiler options, use libraries optimized for high performance for common mathematical and scientific methods (such as Intel's MKL) and finally to tune the code to take advantage of the architecture. The Intel Xeon SandyBridge processors in Peregrine have new vector instructions (AVX) which enabled vector code to run substantially faster than on previous generation Intel Xeon chips.
Compiler options and optimized libraries can provide a large performance benefit with minimal work. Review source code for "hand coded" math algorithms that may be replaced by optimized library routines.
For additional performance optimization, profile the application to see where it is spending most of its time which ensures that optimization efforts are focused on areas with the greatest potential for improvement. "Hot spots" and performance bottlenecks can be discovered with profiling tools such as those described below. These tools also allow the user to identify what changes may be needed to improve performance.
Profiling and Tracing
Peregrine has simple profiling tools like gprof (see www.cs.utah.edu and byu.edu for turorials) as well as more sophisticated application profiling and tracing tools such as Intel VTune Amplifier, Intel Trace Analyzer and Collector, PGPROF, TAU, HPCToolkit and PapiEx. These tools may be used to profile scientific applications for better understanding of where time is being spent and how efficiently the application is using the system.
Please go to the Debugging and Performance Analysis Tools page for more information about these tools.