beautypg.com

3 getting started with hpcpi, Simple hpcpi session, Step 1: loading the hpcpi environment – HP XC System 3.x Software User Manual

Page 31: Chapter 3: “getting started with hpcpi

background image

3 Getting Started with HPCPI

This chapter shows the commands used in a simple HPCPI user session.

NOTE:

The program analyzed in this chapter is a simple program selected for illustrative

purposes and is not representative of the types of programs most users analyze.

This chapter addresses the following topics:

“Simple HPCPI Session” (page 31)

“Step 1: Loading the HPCPI Environment” (page 31)

“Step 2: Setting the HPCPI Database Environment Variable (HPCPIDB)” (page 31)

“Step 3: Creating the HPCPI Database Directory” (page 32)

“Step 4: Starting the HPCPI Daemon” (page 32)

“Step 5: Running the Code You Want to Analyze” (page 32)

“Step 6: Flushing the HPCPI Data to Disk” (page 32)

“Step 7: Viewing Per Image Statistics for the System” (page 32)

“Step 8: Viewing Per Procedure Statistics for the Application” (page 33)

“Step 9: Viewing Per Instruction Statistics” (page 33)

“Step 10: Stopping the HPCPI Daemon” (page 33)

Simple HPCPI Session

The following HPCPI session shows the basic commands for setting up and starting HPCPI to
collect data, and commands to analyze the data. The steps are numbered and described in the
sections that follow.

% module load hpcpi

#1 Load the HPCPI environment
# (or setenv PATH /opt/hpcpi/bin:$PATH)

% setenv HPCPIDB /tmp/hpcpidb #2 Set the DB environment variable
% mkdir -p $HPCPIDB

#3 Create the DB directory

% hpcpid

#4 Start the HPCPI daemon

% ./myApp

#5 Run the image you want to profile

% hpcpictl flush

#6 Flush the data

% hpcpiprof

#7 View per-image statistics

% hpcpiprof myApp

#8 View per-procedure statistics

% hpcpilist routine1 myapp

#9 View per-line statistics

% hpcpictl quit

#10 Stop the HPCPI daemon

Step 1: Loading the HPCPI Environment

The HPCPI daemon and utilities are installed in the /opt/hpcpi/bin directory by default. On
systems with the modules utility installed, you can enter the following command to add
/opt/hpcpi/bin

to your PATH environment variable:

% module load hpcpi

Alternatively, you can manually add /opt/hpcpi/bin to your PATH. For example, you can
enter the following command:

% setenv PATH /opt/hpcpi/bin:$PATH

Step 2: Setting the HPCPI Database Environment Variable (HPCPIDB)

The environment variable HPCPIDB enables you to set the default HPCPI database directory for
the HPCPI daemon and HPCPI utilities. Enter the appropriate shell command to set the HPCPIDB
environment variable to the directory you want to use for the HPCPI database. For example, you
can use a command similar to the following:

% setenv HPCPIDB my_directory

Simple HPCPI Session

31