Label examples, Existing processes: -pid pid, Using labels with application arguments – HP XC System 3.x Software User Manual
Page 65: Using the application argument in the label name, Utilities that spawn processes: -pgid this, All processes: -pid -1 -not
Label Examples
This section contains HPCPI label examples.
Existing Processes: -pid pid
You can use the ps utility to determine the PID of an existing process and use the -pid pid
selector to attach a label to performance data for that process. In the following example, you
want to collect data for the process with PID 5515 and use the sleep 99999 command to keep
the label active:
% hpcpictl label myLabel -pid 5515 sleep 99999
Using Labels with Application Arguments
You can run a program with different argument sets and assign unique labels for each execution.
This enables you to compare performance data for different argument sets. In the following
example, you first run HPCPI to execute the program myApp with the argument -normal and
assign the HPCPI label norm_run to the event data generated. The second command uses
HPCPI to execute myApp with the argument -optimized and assign the HPCPI label opt_run
to the event data.
% hpcpictl label norm_run myApp -normal
% hpcpictl label opt_run myApp -optimized
Using the Application Argument in the Label Name
The following shell script creates a new label for each run of an application. It uses the same
script variable for part of the label name and as the argument passed to the application.
foreach n ($sizes)
hpcpictl label size_$n myApp $n
end
Utilities that Spawn Processes: -pgid this
The make and runspec utilities typically spawn multiple processes. The following examples
use the selector -pgid this to associate all spawned processes with the specified labels:
% hpcpictl label make_all -pgid this make all
% hpcpictl label all_runspec -pgid this runspec
If a spawned process explicitly changes its process group, its events will no longer be associated
with the label, but there can be a delay between the time its process group changes and when
hpcpid
detects the change.
Spawned Processes without the Originator: -pgid this -pid this -not
To select data from the processes make spawns (the compilers) but exclude data from the make
process itself, enter the following command:
% hpcpictl label comp_label -pgid this -pid this -not -and make all
All Processes: -pid -1 -not
The selector -pid -1 -not specifies all processes. The -pid -1 specifies a process with PID
-1; but no process meets this specification. The -not operator negates this and selects all processes.
You can use this selector with the sleep utility to measure all processes on a system for a fixed
time period. For example:
% hpcpictl label all30 -pid -1 -not sleep 30
This command captures data for all processes on the system for 30 seconds (the duration of the
sleep 30
command).
Label Examples
65