12.07.2015 Views

PGI User's Guide

PGI User's Guide

PGI User's Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3. Optimizing & ParallelizingSource code that is readable, maintainable, and produces correct results is not always organized for efficientexecution. Normally, the first step in the program development process involves producing code that executesand produces the correct results. This first step usually involves compiling without much worry aboutoptimization. After code is compiled and debugged, code optimization and parallelization become an issue.Invoking one of the <strong>PGI</strong> compiler commands with certain options instructs the compiler to generate optimizedcode. Optimization is not always performed since it increases compilation time and may make debuggingdifficult. However, optimization produces more efficient code that usually runs significantly faster than codethat is not optimized.Note<strong>PGI</strong> provides a profiler, PGPROF, that provides a way to visualize the performance of the componentsof your program. Using tables and graphs, PGPROF associates execution time and resource utilizationdata with the source code and instructions of your program, allowing you to see where execution timeis spent. Through resource utilization data and compiler analysis information, PGPROF helps you tounderstand why certain parts of your program have high execution times.The compilers optimize code according to the specified optimization level. You can use a number of optionsto specify the optimization levels, including –O, –Mvect, –Mipa, and –Mconcur. In addition, you can useseveral of the –M switches to control specific types of optimization and parallelization.This chapter describes the optimization options displayed in the following list.–fast –Minline –Mpfi –Mvect–Mconcur –Mipa=fast –Mpfo –O–Minfo –Mneginfo –Munroll –MsafeptrThis chapter also describes how to choose optimization options to use with the <strong>PGI</strong> compilers. This overviewwill help if you are just getting started with one of the <strong>PGI</strong> compilers, or wish to experiment with individualoptimizations. Complete specifications of each of these options is available in the “Command-Line OptionsReference” chapter of the <strong>PGI</strong> Compiler Reference Manual.23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!