8 Configuring HP Caliper

HP Caliper gives you multiple methods for configuring how HP Caliper collects data and reports results.

Specifying Option Values with a .caliperinit Initialization File

If you have an initialization file (called .caliperinit), HP Caliper automatically uses it at startup for data collection or data reporting runs. Putting the options in an initialization file simplifies the command line you use. This file is not required, but can be useful.

For example, you can specify your preferred sorting options for each type of report as well as global settings for all of your reports, such as system library to exclude and output file locations, and even the name of the application program and its arguments. With your preferences in the

.caliperinit file, you can then simply type:

$ caliper ecount

The resulting report uses your predefined preferences. Using this approach, you can change your preferences without having to change the HP Caliper command line in a Makefile.

The initialization file must be named .caliperinit. It can be in the current working directory, your home directory, or in both locations. When you start HP Caliper, it looks first in the working directory for a .caliperinit file. It then looks in your home directory.

By default, if you have a .caliperinit file, HP Caliper will use it. (That is, the

--read-init-fileoption is set to True.) You can set this option to False if you do not want the file read for a particular run.

NOTE: See “Multiple Ways to Specify HP Caliper Option Values” (p. 48) for information about what you have to do differently to specify options in the .caliperinit file. Also see “Hierarchy for Processing an Option Value” (p. 49).

Example of a .caliperinit File

A.caliperinit file is a Python script, similar to an HP Caliper measurement configuration file. Figure 21 (page 93) shows an example .caliperinit file. This file is available in the software kit in the location examples/startup_file/caliperinit in the HP Caliper home directory. You can copy the file and edit it to suit your needs. You must rename it to .caliperinit.

92 Configuring HP Caliper