Skip to content

Commit 5cec1c2

Browse files
committed
Documentation updates
1 parent af4157d commit 5cec1c2

File tree

4 files changed

+50
-110
lines changed

4 files changed

+50
-110
lines changed

README.md

+9-57
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@ Caliper: A Performance Analysis Toolbox in a Library
77

88
Caliper is a performance instrumentation and profiling library for HPC
99
(high-performance computing) programs. It provides source-code annotation
10-
APIs for marking regions of interest in C, C++, and Fortran code, as well as
11-
a set of built-in performance measurement recipes for a wide range of
12-
performance engineering use cases, such as lightweight always-on profiling,
13-
event tracing, or performance monitoring. Alternatively, users can create
14-
custom measurement configurations for specialized use cases.
10+
APIs for marking regions of interest in C, C++, Fortran, and Python codes,
11+
as well as performance measurement functionality for a wide range of use cases,
12+
such as runtime profiling, event tracing, and performance monitoring.
1513

16-
Caliper can either generate simple human-readable reports or machine-readable
14+
Caliper can generate simple human-readable reports or machine-readable
1715
JSON or .cali files for automated data processing with user-provided scripts
1816
or analysis frameworks like [Hatchet](https://github.com/LLNL/hatchet)
1917
and [Thicket](https://github.com/LLNL/thicket).
@@ -29,15 +27,11 @@ Features include:
2927
* Flexible key:value data model to capture application-specific
3028
features for performance analysis
3129
* Fully threadsafe implementation, support for parallel programming
32-
models like MPI
33-
* Event-based as well as sample-based performance measurements
30+
models like MPI, OpenMP, Kokkos, CUDA, and ROCm
31+
* Event-based and sample-based performance measurements
3432
* Trace and profile recording
3533
* Connection to third-party tools, e.g. NVidia's NSight tools, AMD
3634
ROCProf, or Intel(R) VTune(tm)
37-
* Measurement and profiling functionality such as timers, PAPI
38-
hardware counters, and Linux perf_events
39-
* Memory annotations to associate performance measurements
40-
with memory regions
4135

4236
Documentation
4337
------------------------------------------
@@ -58,9 +52,8 @@ package manager:
5852

5953
$ spack install caliper
6054

61-
To build Caliper manually, you need cmake 3.12+ and a current
62-
C++11-compatible Compiler. Clone Caliper from github and proceed
63-
as follows:
55+
Building Caliper manually requires cmake 3.12+ and a C++11-compatible
56+
Compiler. Clone Caliper from github and proceed as follows:
6457

6558
$ git clone https://github.com/LLNL/Caliper.git
6659
$ cd Caliper
@@ -156,7 +149,7 @@ Other measurement configurations besides runtime-report include:
156149
157150
* loop-report: Print summary and time-series information for loops.
158151
* mpi-report: Print time spent in MPI functions.
159-
* callpath-sample-report: Print a time spent in functions using call-path sampling.
152+
* sample-report: Print time spent in functions using sampling.
160153
* event-trace: Record a trace of region enter/exit events in .cali format.
161154
* hatchet-region-profile: Record a region time profile for processing with
162155
[Hatchet](https://github.com/LLNL/hatchet) or cali-query.
@@ -168,47 +161,6 @@ You can also create entirely custom measurement configurations by selecting and
168161
configuring Caliper services manually. See the "Manual configuration" section
169162
in the documentation to learn more.
170163
171-
#### ConfigManager API
172-
173-
A distinctive Caliper feature is the ability to enable performance
174-
measurements programmatically with the ConfigManager API. For example, we often
175-
let users activate performance measurements with a command-line argument.
176-
177-
With the C++ ConfigManager API, built-in performance measurement and
178-
reporting configurations can be activated within a program using a short
179-
configuration string. This configuration string can be hard-coded in the
180-
program or provided by the user in some form, e.g. as a command-line
181-
parameter or in the programs's configuration file.
182-
183-
To use the ConfigManager API, create a `cali::ConfigManager` object, add a
184-
configuration string with `add()`, start the requested configuration
185-
channels with `start()`, and trigger output with `flush()`:
186-
187-
```C++
188-
#include <caliper/cali-manager.h>
189-
// ...
190-
cali::ConfigManager mgr;
191-
mgr.add("runtime-report");
192-
// ...
193-
mgr.start(); // start requested performance measurement channels
194-
// ... (program execution)
195-
mgr.flush(); // write performance results
196-
```
197-
198-
The `cxx-example` program uses the ConfigManager API to let users specify a
199-
Caliper configuration with the `-P` command-line argument, e.g.
200-
``-P runtime-report``:
201-
202-
$ ./examples/apps/cxx-example -P runtime-report
203-
Path Min time/rank Max time/rank Avg time/rank Time %
204-
main 0.000129 0.000129 0.000129 5.952930
205-
mainloop 0.000080 0.000080 0.000080 3.691740
206-
foo 0.000719 0.000719 0.000719 33.179511
207-
init 0.000021 0.000021 0.000021 0.969082
208-
209-
See the [Caliper documentation](https://software.llnl.gov/Caliper) for more
210-
examples and the full API and configuration reference.
211-
212164
Authors
213165
------------------------------------------
214166

doc/sphinx/AnnotationAPI.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ following example shows both::
267267
num_dimensions);
268268
...
269269

270-
CALI_DATATRACKER_FREE(arrayA);
271-
CALI_DATATRACKER_FREE(matA);
270+
CALI_DATATRACKER_UNTRACK(arrayA);
271+
CALI_DATATRACKER_UNTRACK(matA);
272272
}
273273

274274
API Reference

doc/sphinx/CaliperBasics.rst

+35-49
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ With the source-code annotations in place, we can run performance measurements.
102102
By default, Caliper does not record data - we have to activate performance
103103
profiling at runtime.
104104
An easy way to do this is to use one of Caliper's built-in measurement
105-
configurations. For example, the `runtime-report` config prints out the time
105+
recipes. For example, the `runtime-report` recipe prints out the time
106106
spent in the annotated regions. You can activate built-in measurement
107-
configurations with the :ref:`configmgr_api` or with the
107+
recipes with the :ref:`configmgr_api` or with the
108108
:envvar:`CALI_CONFIG` environment variable.
109109
Let's try this on Caliper's cxx-example program:
110110

@@ -119,7 +119,7 @@ Let's try this on Caliper's cxx-example program:
119119
foo 0.000646 0.000646 0.000646 38.429506
120120
init 0.000017 0.000017 0.000017 1.011303
121121
122-
Like most built-in configurations, the runtime-report config works for MPI and
122+
Like most built-in recipes, the runtime-report config works for MPI and
123123
non-MPI programs. By default, it reports the minimum, maximum, and average
124124
exclusive time (seconds) spent in each marked code region across MPI ranks
125125
(the three values are identical in non-MPI programs). Exclusive time is the
@@ -140,8 +140,8 @@ of exclusive region times:
140140
foo 0.000624 0.000624 0.000624 52.392947
141141
init 0.000003 0.000003 0.000003 0.251889
142142
143-
Caliper provides many more performance measurement configurations in addition
144-
to `runtime-report` that make use of region annotations. For example,
143+
Caliper provides many more performance measurement configurations that
144+
make use of region annotations. For example,
145145
`hatchet-region-profile` writes a .cali file with region times for processing
146146
with `Hatchet <https://github.com/LLNL/hatchet>`_. See
147147
:ref:`more-on-configurations` below to learn more about different
@@ -248,12 +248,12 @@ measurements programmatically with the ConfigManager API. For example, we often
248248
let users activate performance measurements with a command-line argument.
249249

250250
The ConfigManager API provides access to Caliper's built-in measurement
251-
configurations (see :ref:`more-on-configurations` below). The ConfigManager
251+
recipes (see :ref:`more-on-configurations` below). The ConfigManager
252252
interprets a short configuration string that can be hard-coded in the program
253253
or provided by the user in some form, e.g. as a command-line parameter or
254254
in the program's configuration file.
255255

256-
To access and control the built-in configurations, create a
256+
To use the ConfigManager API, create a
257257
:cpp:class:`cali::ConfigManager` object. Add a configuration string with
258258
``add()``, start the requested configuration channels with ``start()``,
259259
and trigger output with ``flush()``. In MPI programs, the ``flush()`` method
@@ -321,25 +321,20 @@ More on configurations
321321
--------------------------------
322322

323323
A configuration string for the ConfigManager API or the
324-
:envvar:`CALI_CONFIG` environment variable is a comma-separated list of
325-
*configs* and *parameters*.
324+
:envvar:`CALI_CONFIG` environment variable is a list of
325+
*configs* (like `runtime-report`) and *parameters*.
326+
Multiple configs can be specified, separated by comma.
326327

327-
A *config* is the name of one of Caliper's built-in measurement configurations,
328-
e.g. `runtime-report`. Multiple configs can be specified, separated by comma.
329-
330-
Most configs have optional parameters, e.g. `output` to name an output file.
331-
Parameters can be specified as a list of key-value pairs in parentheses after
332-
the config name, e.g. `runtime-report(output=report.txt,io.bytes)`. For
328+
Parameters can configure output options or enable additional functionality.
329+
They can be specified as a list of key-value pairs in parentheses
330+
after the config name, e.g. `runtime-report(output=report.txt,io.bytes)`. For
333331
boolean parameters, only the key needs to be added to enable it; for example,
334332
`io.bytes` is equal to `io.bytes=true`. You can also add parameters outside
335333
of parentheses; these apply to all configs.
336334

337-
Many optional parameters enable additional Caliper functionality. For example,
338-
the `profile.mpi` option enables MPI function profiling, the `io.bytes` option
339-
reports I/O bytes written and read, and the `mem.highwatermark` option reports
340-
the memory high-watermark. In the example below, the `mem.highwatermark`
341-
option for `runtime-report` adds the "Allocated MB" column that shows the
342-
maximum amount of memory that was allocated in each region:
335+
In the example below, we enable the `mem.highwatermark` option in
336+
`runtime-report`. This adds the "Allocated MB" column that shows the maximum
337+
amount of memory that was allocated in each region:
343338

344339
.. code-block:: sh
345340
@@ -350,12 +345,11 @@ maximum amount of memory that was allocated in each region:
350345
foo 0.000778 0.000778 0.000778 8.930211 0.000016
351346
init 0.000020 0.000020 0.000020 0.229568 0.000000
352347
353-
You can use the cali-query program to list available configs and their parameters.
354-
For example, ``cali-query --help=configs`` lists all configs and their options.
355-
You can also query parameters for a specific config, e.g.
348+
You can use ``cali-query --help=configs`` to list all available recipes and their
349+
parameters. You can also query parameters for a specific recipe, e.g.
356350
``cali-query --help=runtime-report``.
357351

358-
Some available performance measurement configs include:
352+
Some available performance measurement recipes include:
359353

360354
runtime-report
361355
Print a time profile for annotated regions.
@@ -429,8 +423,21 @@ Like other region annotations, loop and iteration annotations are meant for
429423
high-level regions, not small, frequently executed loops inside kernels.
430424
We recommend to only annotate top-level loops, such as the main timestepping
431425
loop in a simulation code.
432-
With the loop annotations in place, we can use the loop-report config to print
433-
loop performance information:
426+
427+
With loop annotations in place, we can use the `loop.stats` option to print
428+
the minimum, maximum, and average time per loop iteration:
429+
430+
.. code-block:: sh
431+
432+
$ ./examples/apps/cxx-example -P runtime-report,loop.stats 5000
433+
Path Time (E) Time (I) Time % (E) Time % (I) Iterations Time/iter (min) Time/iter (avg) Time/iter (max)
434+
main 0.000070 8.010493 0.000870 99.995709
435+
init 0.000004 0.000004 0.000047 0.000047
436+
mainloop 0.172615 8.010420 2.154765 99.994792 5000 0.000110 0.001591 0.003317
437+
foo 7.837805 7.837805 97.840027 97.840027
438+
439+
More detailed loop timing information is available with the loop-report
440+
recipe:
434441

435442
.. code-block:: sh
436443
@@ -571,27 +578,6 @@ save global attributes in the form of key-value pairs:
571578
cali_set_global_int_byname("iterations", iterations);
572579
cali_set_global_string_byname("caliper.config", configstr.c_str());
573580

574-
Most machine-readable output formats, e.g. the hatchet JSON format written by the
575-
hatchet-region-profile config, include this data:
576-
577-
.. code-block:: sh
578-
579-
$ ./examples/apps/cxx-example -P hatchet-region-profile,output=stdout
580-
{
581-
"data": [
582-
...
583-
],
584-
...
585-
"caliper.config": "hatchet-region-profile,output=stdout",
586-
"iterations": "4",
587-
"cali.caliper.version": "2.5.0-dev",
588-
"cali.channel": "hatchet-region-profile"
589-
}
590-
591-
Note how the "iterations" and "caliper.config" attributes are stored as
592-
top-level attributes in the JSON output. Caliper adds some built-in metadata
593-
attributes as well, such as the Caliper version ("cali.caliper.version").
594-
595581
An even better way to record metadata is the `Adiak <https://github.com/LLNL/Adiak>`_
596582
library. Adiak makes metadata attributes accessible to multiple tools, and
597583
provides built-in functionality to record common information such as user
@@ -608,7 +594,7 @@ above, and also the user name, launch date, and MPI job size:
608594
adiak::value("iterations", iterations);
609595
adiak::value("caliper.config", configstr.c_str());
610596

611-
Most Caliper configs automatically import metadata attributes set through
597+
Most Caliper recipes automatically import metadata attributes set through
612598
Adiak (Adiak support must be enabled in the Caliper build configuration). The
613599
spot config for the Spot web visualization framework requires that metadata
614600
attributes are recorded through Adiak.

doc/sphinx/build.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ WITH_ROCTRACER
8888
Enable support for ROCm/HIP performance analysis (runtime API profiling and
8989
GPU activity tracing).
9090

91+
WITH_ROCPROFILER
92+
Enable roctx adapters and support for ROCm/HIP performance analysis with the
93+
rocprofiler-sdk API (available with ROCm 6.2 and higher).
94+
9195
WITH_SAMPLER
9296
Enable time-based sampling on Linux.
9397

@@ -143,8 +147,6 @@ The CMake package defines the following variables and targets:
143147
+----------------------------+------------------------------------------+
144148
| caliper | The Caliper runtime library (target) |
145149
+----------------------------+------------------------------------------+
146-
| caliper-tools-util | Utilities for caliper tools (target) |
147-
+----------------------------+------------------------------------------+
148150

149151
In most cases, just link the "caliper" target.
150152

0 commit comments

Comments
 (0)