Optimizing HPC Applications with Intel® Cluster Tools

Alexander Supalov, Andrey Semin, Michael Klemm et al. · Apress eBooks · 2014

The Top-down Optimization MethodOf course, the optimization process we mention is of the most common type-namely, performance optimization.We will be dealing with this kind of optimization almost exclusively in this book.There are other optimization targets, going beyond performance and sometimes hurting it a lot, like code size, data size, and energy. xxiv ■ INTRODUCTIONThe good news are, once you know what you want to achieve, the methodology is roughly the same.We will look into those details in Chapter 3. Briefly, you proceed in the top-down fashion from the higher levels of the problem under analysis (platform, distributed memory, shared memory, microarchitecture), iterate in a closed-loop manner until you exhaust optimization opportunities at each of these levels.Keep in mind that a problem fixed at one level may expose a problem somewhere else, so you may need to revisit those higher levels once more.This approach crystallized quite a while ago.Its previous reincarnation was formulated by Intel application engineers working in Intel's application solution centers in the 1990's.6 Our book builds on that solid foundation, certainly taking some things a tad further to account for the time passed.Now, what happens when top-down optimization meets the closed-loop approach?Well, this is a happy marriage.Every single level of the top-down method can be handled by the closed-loop approach.Moreover, the top-down method itself can be enclosed in another, bigger closed loop where every iteration addresses the biggest remaining problem at any level where it has been detected.This way, you keep your priorities straight and helps you stay focused. Use Interprocedural OptimizationAdd the compiler flag -ipo to switch on interprocedural optimization.This will give the compiler a holistic view of the program and open more optimization opportunities for the program as a whole.Note that this will also increase the overall compilation time.Runtime profiling can also increase the chances for the compiler to generate better code.Profile-guided optimization requires a three-stage process.First, compile the application with the compiler flag -prof-gen to instrument the application with profiling code.Second, run the instrumented application with a typical dataset to produce a meaningful profile.Third, feed the compiler with the profile (-prof-use) and let it optimize the code. SummarySwitching to Intel MPI and Intel Composer XE can help improve performance because the two strive to optimally support Intel platforms and deliver good out-of-the-box (OOB) performance.Tuning measures can further improve the situation.The next chapters will reiterate the quick and dirty examples of this chapter and show you how to push the limits.

Cited by 15 works. doi:10.1007/978-1-4302-6497-2 Open-access PDF

Authors

References