12.07.2015 Views

Commonly Used Metrics for Performance Analysis - Power.org

Commonly Used Metrics for Performance Analysis - Power.org

Commonly Used Metrics for Performance Analysis - Power.org

SHOW MORE
SHOW LESS

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

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

<strong>Metrics</strong> <strong>for</strong> Per<strong>for</strong>mance <strong>Analysis</strong>the program execution time is split between the “pm_utilization” and the “pm_vsu0” groups.4.2.1.2 Running hpmcount under the poe environmentUnlike tprof (see 4.1.2.2), hpmcount can be run <strong>for</strong> each task of a parallel job. Task binding, by using thelaunch utility or something similar, is recommended to increase accuracy and reproducibility. An examplemight be:export MP_PROCS=8export TARGET_CPU_LIST=-1export HPM_EVENT_GROUP=pm_utilization:upoe launch hpmcount –d –o hpm.out myprogNote that additional environment variables needed by poe are implied. An alternative way of specifying thegroup(s) to be collected has been used here – by setting the HPM_EVENT_GROUP variable.4.2.1.3 libhpmThe libhpm library is part of the bos.pmapi.lib fileset distributed with the standard AIX release. It can betreated as a way to get hpmcount in<strong>for</strong>mation <strong>for</strong> sections of codeFor event counts resolved by code regions, one can use calls to libhpm.a routines as a quicker way to collecta large group of events than profiling with tprof to control the collection of HPM group statistics.Using libhpm.a can be divided into 3 steps: modifying the source code base, building the executable, andrunning.libhpm.a supports calls from Fortran and C/C++ code; the examples will be in C.1. There are 4 necessary calls that need to be inserted in the base source code: hpmInit(1,"SomeString"); [Fortran – f_hpminit(,”string”) ]at a point be<strong>for</strong>e any statistics are to be collected. Inserting this call at the start of execution in the mainprogram is the simplest course. The specified “SomeString” is arbitrary, but it seems most sensible to derive itfrom the program name. hpmTerminate(1); [Fortran – f_hpmterminate(,”string”) ]This is the matching call to hpmInit(). The argument (an integer) must agree with the first argument of thehpmInit() call. This call signals that HPM data collection has ended. hpmStart(2,"String"); [Fortran – f_hpmstart(,”string”) ]Insert this call at the start of every code section where one wants to collect HPM data. The integer identifierhas to be unique (there are usually many hpmStart() calls inside a program; all have to be uniquelyidentified). The string is user-defined and it is recommended that it briefly describe the code block beingmeasured. The string (along with the range of lines in the block) is reported as part of the libhpm output.There is a significant execution overhead from this call, so it is best to put it outside loop blocks. Having anyparticular hpmStart hpmStop(2); [Fortran – f_hpmstop() ]This is the matching call to hpmStart(). The argument must agree with the first argument of the hpmInit() call.This call signals the end of HPM data collection <strong>for</strong> a section of code.2. Link with needed librariesxlc –o myprog_hpm myprog.o –llibhpm –lpmapi –lm3. Use an appropriate execution environmentexport HPM_OUTPUT_NAME=libhpm.outCopyright ©2011 IBM Corporation Page 13 of 52

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

Saved successfully!

Ooh no, something went wrong!