HP Caliper Advisor Rule Writer Guide

tested. All that matters is that each database is an HP Caliper database and was
created by a compatible version of HP Caliper.
3. All the databases are scanned for executable objects to analyze that match the
selection criteria. By default, all objects with performance data are analyzed.
Alternatively, you can use the -analysis-focus command-line option or the
analysis_focus variable in the .caliperinit file to choose specific objects
to analyze. If multiple versions of the same object exist, the one with the most
recent modification date/time is chosen and the older versions are ignored. The
list of objects to analyze is now sorted in alphabetic name order.
If the Advisor cannot find any of the requested objects in the databases given, the
run terminates with an appropriate message.
4. Every available dataset is located and either associated with a selected analysis
object or discarded. The first dataset found for an analysis object is considered its
reference dataset. Note that this is the only time that the order of databases on the
command line makes any difference.
If a later dataset for an object is not compatible with the reference dataset, it is
discarded. (The dataset would be considered incompatible if the measurement
run was made on a different type of processor, on a different speed of processor,
on a different operating system, or on an earlier version of the object.) If a dataset
contains performance data for an object that wasn’t selected, then it, too, is
discarded.
At this point, every analysis object has its own unique list of one or more datasets.
Each list is then separately sorted in descending order of measurement run time.
When a rule requests performance data for an object, its datasets will be searched
in this order. Usually, only one dataset will satisfy a request or none will.
Occasionally, the requested data will be available from more than one dataset. In
this case, by default, the data from the longest measurement run will be used.
5. All the specified rule files are read and compiled in the order given by the
--rule-files command-line option or the rule_files variable in the
.caliperinit file. If no rule files are provided, then the default rule file is used.
In the compilation, all of the rule files are compiled into a shared dictionary (name
space) that is isolated from the Advisors dictionary to avoid name conflicts and
processing errors. A later rule function with the same name (within the same file
or from an earlier file) overrides any earlier instance of the function. Any one rule
file is only processed once.
If there are any Python errors (usually syntax problems), an error message is
generated and the run terminates.
28 How the HP Caliper Advisor Works