@@ -102,9 +102,9 @@ With the source-code annotations in place, we can run performance measurements.
102
102
By default, Caliper does not record data - we have to activate performance
103
103
profiling at runtime.
104
104
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
106
106
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
108
108
:envvar: `CALI_CONFIG ` environment variable.
109
109
Let's try this on Caliper's cxx-example program:
110
110
@@ -119,7 +119,7 @@ Let's try this on Caliper's cxx-example program:
119
119
foo 0.000646 0.000646 0.000646 38.429506
120
120
init 0.000017 0.000017 0.000017 1.011303
121
121
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
123
123
non-MPI programs. By default, it reports the minimum, maximum, and average
124
124
exclusive time (seconds) spent in each marked code region across MPI ranks
125
125
(the three values are identical in non-MPI programs). Exclusive time is the
@@ -140,8 +140,8 @@ of exclusive region times:
140
140
foo 0.000624 0.000624 0.000624 52.392947
141
141
init 0.000003 0.000003 0.000003 0.251889
142
142
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,
145
145
`hatchet-region-profile ` writes a .cali file with region times for processing
146
146
with `Hatchet <https://github.com/LLNL/hatchet >`_. See
147
147
:ref: `more-on-configurations ` below to learn more about different
@@ -248,12 +248,12 @@ measurements programmatically with the ConfigManager API. For example, we often
248
248
let users activate performance measurements with a command-line argument.
249
249
250
250
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
252
252
interprets a short configuration string that can be hard-coded in the program
253
253
or provided by the user in some form, e.g. as a command-line parameter or
254
254
in the program's configuration file.
255
255
256
- To access and control the built-in configurations , create a
256
+ To use the ConfigManager API , create a
257
257
:cpp:class: `cali::ConfigManager ` object. Add a configuration string with
258
258
``add() ``, start the requested configuration channels with ``start() ``,
259
259
and trigger output with ``flush() ``. In MPI programs, the ``flush() `` method
@@ -321,25 +321,20 @@ More on configurations
321
321
--------------------------------
322
322
323
323
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.
326
327
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
333
331
boolean parameters, only the key needs to be added to enable it; for example,
334
332
`io.bytes ` is equal to `io.bytes=true `. You can also add parameters outside
335
333
of parentheses; these apply to all configs.
336
334
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:
343
338
344
339
.. code-block :: sh
345
340
@@ -350,12 +345,11 @@ maximum amount of memory that was allocated in each region:
350
345
foo 0.000778 0.000778 0.000778 8.930211 0.000016
351
346
init 0.000020 0.000020 0.000020 0.229568 0.000000
352
347
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.
356
350
``cali-query --help=runtime-report ``.
357
351
358
- Some available performance measurement configs include:
352
+ Some available performance measurement recipes include:
359
353
360
354
runtime-report
361
355
Print a time profile for annotated regions.
@@ -429,8 +423,21 @@ Like other region annotations, loop and iteration annotations are meant for
429
423
high-level regions, not small, frequently executed loops inside kernels.
430
424
We recommend to only annotate top-level loops, such as the main timestepping
431
425
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:
434
441
435
442
.. code-block :: sh
436
443
@@ -571,27 +578,6 @@ save global attributes in the form of key-value pairs:
571
578
cali_set_global_int_byname("iterations", iterations);
572
579
cali_set_global_string_byname("caliper.config", configstr.c_str());
573
580
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
-
595
581
An even better way to record metadata is the `Adiak <https://github.com/LLNL/Adiak >`_
596
582
library. Adiak makes metadata attributes accessible to multiple tools, and
597
583
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:
608
594
adiak::value("iterations", iterations);
609
595
adiak::value("caliper.config", configstr.c_str());
610
596
611
- Most Caliper configs automatically import metadata attributes set through
597
+ Most Caliper recipes automatically import metadata attributes set through
612
598
Adiak (Adiak support must be enabled in the Caliper build configuration). The
613
599
spot config for the Spot web visualization framework requires that metadata
614
600
attributes are recorded through Adiak.
0 commit comments