beautypg.com

Simple hpcpi session using labels, Step 3: flushing the data, Step 4: using the label with hpcpiprof – HP XC System 3.x Software User Manual

Page 60

background image

Simple HPCPI Session Using Labels

In the following session, the user associates the label myLabel with the performance data for a
single process, myApp. This example also uses the label with hpcpiprof to extract performance
data for myApp, including data for routines called by myApp from a shared library.

The following HPCPI session shows the commands for using HPCPI with labels. The steps are
numbered and described in the sections that follow.

% module load hpcpi

#1 Set up & run hpcpid

% setenv HPCPIDB /tmp/hpcpidb # (continued)
% mkdir -p $HPCPIDB

# (continued)

% hpcpid

# (continued)

% hpcpictl label myLabel ./myApp #2 Create the label & run the app
% hpcpictl flush

#3 Flush the data

% hpcpiprof -label myLabel

#4 Use the label with hpcpiprof

% hpcpiprof -label myLabel libm-2.3.4.so
% hpcpictl quit

#5 Stop the HPCPI daemon

Step 1: Setting Up the Environment and Starting the Daemon

To set up the HPCPI path, database and start the daemon, as described in

“Simple HPCPI Session”

(page 31)

, enter the following commands:

% module load hpcpi
% setenv HPCPIDB my_directory
% mkdir -p $HPCPIDB
% hpcpid

Step 2: Establishing the Label and Running the Application

The hpcpictl label command establishes a label and runs the specified binary. By default,
HPCPI associates all performance data for the process with the specified label. The label is active
until the process terminates.

To establish the label myLabel, run myApp, and associate all data for that process with myLabel,
enter the following commands:

% hpcpictl label myLabel ./myApp

Step 3: Flushing the Data

To flush the HPCPI data to disk after the application completes, enter the following command:

% hpcpictl flush

This ensures the HPCPI data is written to disk and visible to the HPCPI analysis tools.

Step 4: Using the Label with hpcpiprof

The hpcpiprof utility supports the -label label_name option to isolate data associated
with a label. When you enter the hpcpiprof command without an image name, it displays
per-image statistics for all images on the system. The image with the most CPU cycles used is
typically the kernel (vmlinux-2.6.9-34.7hp.XCsmp), as shown in the following example
from a lightly loaded system:

% hpcpiprof

Event Name Events Period Samples
---------- ------------- ------ ---------
CPU_CYCLES 7969037220000 60000 132817287

CPU_CYCLES % cum% image
---------- ----- ------ ----------------------------
385649e7 48.4% 48.4% vmlinux-2.6.9-34.7hp.XCsmp
198708e7 24.9% 73.3% libm-2.3.4.so
192510e7 24.2% 97.5% myApp

60

Using HPCPI Labels