Skip to content

Commit cd9c0ff

Browse files
committed
Merge branch 'master' into woptim/spack-envs
2 parents 2a2a467 + 4e19ce9 commit cd9c0ff

File tree

89 files changed

+356
-275
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+356
-275
lines changed

CMakeLists.txt

+74-24
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ if (WITH_FORTRAN)
114114
enable_language(Fortran)
115115
set(CMAKE_Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/fortran")
116116
set(CALIPER_Fortran_CMAKE_MSG "Yes, using ${CMAKE_Fortran_COMPILER_ID} ${CMAKE_Fortran_COMPILER_VERSION}")
117+
set(CALIPER_HAVE_FORTRAN TRUE)
117118
endif()
118119

119120
if (BUILD_TESTING)
@@ -306,8 +307,11 @@ if (WITH_ADIAK)
306307
list(APPEND CALIPER_EXTERNAL_LIBS ${CMAKE_DL_LIBS})
307308
endif()
308309
else()
310+
set(CALIPER_HAVE_ADIAK FALSE)
309311
message(WARNING "Adiak support was requested but Adiak was not found")
310312
endif()
313+
else()
314+
set(CALIPER_HAVE_ADIAK FALSE)
311315
endif()
312316

313317
if (WITH_KOKKOS)
@@ -452,7 +456,7 @@ endif()
452456
if (WITH_LDMS)
453457
include(FindLDMS)
454458
if (LDMS_FOUND)
455-
set(CALIPER_HAVE_LDMS TRUE)
459+
set(CALIPER_HAVE_LDMS TRUE)
456460
set(CALIPER_LDMS_CMAKE_MSG "Yes, using ${LDMS_LIBLDMS} ${LDMS_LIBSTREAM}")
457461
list(APPEND CALIPER_EXTERNAL_LIBS ${LDMS_LIBLDMS} ${LDMS_LIBSTREAM})
458462
message("Include Directory: ${LDMS_INCLUDE_DIRS}")
@@ -473,7 +477,19 @@ configure_file(
473477
include_directories(${PROJECT_BINARY_DIR}/include)
474478
include_directories(include)
475479

476-
if(INSTALL_HEADERS)
480+
add_subdirectory(ext)
481+
add_subdirectory(src)
482+
483+
add_subdirectory(examples/apps EXCLUDE_FROM_ALL)
484+
485+
if (BUILD_TESTING)
486+
add_subdirectory(test)
487+
endif()
488+
if (BUILD_DOCS)
489+
add_subdirectory(doc EXCLUDE_FROM_ALL)
490+
endif()
491+
492+
if (INSTALL_HEADERS)
477493
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
478494
FILES_MATCHING PATTERN "*.h")
479495
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
@@ -487,15 +503,32 @@ if(INSTALL_HEADERS)
487503
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/caliper
488504
FILES_MATCHING PATTERN "*.h")
489505

490-
if (WITH_FORTRAN)
506+
if (CALIPER_HAVE_FORTRAN)
491507
install(
492508
DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/
493509
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/caliper/fortran
494510
FILES_MATCHING PATTERN "*.mod")
495511
endif()
512+
513+
install(
514+
DIRECTORY
515+
"python/caliper-reader/caliperreader"
516+
DESTINATION
517+
"${CMAKE_INSTALL_LIBDIR}/caliper"
518+
FILES_MATCHING
519+
PATTERN "*.py"
520+
)
521+
522+
install(
523+
PROGRAMS
524+
"python/cali2traceevent.py"
525+
"python/cali2traceevent"
526+
DESTINATION
527+
${CMAKE_INSTALL_BINDIR}
528+
)
496529
endif()
497530

498-
if(INSTALL_CONFIG)
531+
if (INSTALL_CONFIG)
499532
# Create pkg-config .pc file
500533
set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
501534
set(PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
@@ -506,31 +539,48 @@ if(INSTALL_CONFIG)
506539
${PROJECT_SOURCE_DIR}/caliper.pc.in
507540
${PROJECT_BINARY_DIR}/caliper.pc)
508541

509-
# Make caliper findable for cmake
510-
configure_file(
511-
${PROJECT_SOURCE_DIR}/caliper-config.cmake.in
512-
${PROJECT_BINARY_DIR}/caliper-config.cmake
513-
@ONLY)
542+
include(CMakePackageConfigHelpers)
514543

515-
install(FILES ${PROJECT_BINARY_DIR}/caliper-config.cmake
516-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/caliper)
517-
install(EXPORT caliper-targets
518-
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/cmake/caliper)
544+
write_basic_package_version_file(
545+
"${CMAKE_CURRENT_BINARY_DIR}/caliper-config-version.cmake"
546+
VERSION
547+
${LIBTOOL_INTERFACE}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}
548+
COMPATIBILITY
549+
SameMajorVersion
550+
)
519551

520-
install(FILES ${PROJECT_BINARY_DIR}/caliper.pc
521-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
522-
endif()
552+
set(caliper_INSTALL_INCLUDE_DIR "include/")
523553

524-
add_subdirectory(ext)
525-
add_subdirectory(src)
554+
configure_package_config_file(
555+
"${CMAKE_CURRENT_SOURCE_DIR}/caliper-config.cmake.in"
556+
"${CMAKE_CURRENT_BINARY_DIR}/caliper-config.cmake"
557+
INSTALL_DESTINATION
558+
${CMAKE_INSTALL_DATAROOTDIR}/cmake/caliper
559+
PATH_VARS
560+
caliper_INSTALL_INCLUDE_DIR
561+
)
526562

527-
add_subdirectory(examples/apps EXCLUDE_FROM_ALL)
563+
install(
564+
FILES
565+
"${CMAKE_CURRENT_BINARY_DIR}/caliper-config-version.cmake"
566+
"${CMAKE_CURRENT_BINARY_DIR}/caliper-config.cmake"
567+
DESTINATION
568+
"${CMAKE_INSTALL_DATAROOTDIR}/cmake/caliper"
569+
)
528570

529-
if (BUILD_TESTING)
530-
add_subdirectory(test)
531-
endif()
532-
if (BUILD_DOCS)
533-
add_subdirectory(doc EXCLUDE_FROM_ALL)
571+
install(
572+
EXPORT
573+
caliper-targets
574+
DESTINATION
575+
"${CMAKE_INSTALL_DATAROOTDIR}/cmake/caliper"
576+
)
577+
578+
install(
579+
FILES
580+
${PROJECT_BINARY_DIR}/caliper.pc
581+
DESTINATION
582+
${CMAKE_INSTALL_LIBDIR}/pkgconfig
583+
)
534584
endif()
535585

536586
#

caliper-config.cmake.in

+22-52
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,28 @@
1-
# - caliper: Context Annotation Library
2-
#
3-
#=============================================================================
4-
# Caliper is a program instrumentation and performance measurement
5-
# framework. It provides data collection mechanisms and a source-code
6-
# annotation API for a variety of performance engineering use cases,
7-
# e.g., performance profiling, tracing, monitoring, and
8-
# auto-tuning.
9-
#
10-
#=== Usage ===================================================================
11-
# This file allows caliper to be automatically detected by other libraries
12-
# using CMake. To build with caliper, you can do one of two things:
13-
#
14-
# 1. Set the caliper_DIR environment variable to the root of the Caliper
15-
# installation. If you loaded caliper through a dotkit, this may already
16-
# be set, and caliper will be autodetected by CMake.
17-
#
18-
# 2. Configure your project with this option:
19-
# -Dcaliper_DIR=<caliper install prefix>/share/
20-
#
21-
# If you have done either of these things, then CMake should automatically find
22-
# and include this file when you call find_package(caliper) from your
23-
# CMakeLists.txt file.
24-
#
25-
#=== Components ==============================================================
26-
# (David's TO DO)
27-
#
28-
# To link against these, just do, for example:
29-
#
30-
# find_package(caliper REQUIRED)
31-
# add_executable(foo foo.c)
32-
# target_link_libraries(foo caliper)
33-
#
34-
# That's all!
35-
#
36-
if (NOT caliper_CONFIG_LOADED)
37-
set(caliper_CONFIG_LOADED TRUE)
1+
@PACKAGE_INIT@
382

39-
# Install layout
40-
set(caliper_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@)
41-
set(caliper_INCLUDE_DIR @CMAKE_INSTALL_FULL_INCLUDEDIR@)
42-
set(caliper_LIB_DIR @CMAKE_INSTALL_FULL_LIBDIR@)
43-
set(caliper_CMAKE_DIR @CMAKE_INSTALL_FULL_DATADIR@/cmake/caliper)
3+
include(CMakeFindDependencyMacro)
444

45-
# Includes needed to use caliper
46-
set(caliper_INCLUDE_PATH ${caliper_INCLUDE_DIR})
47-
set(caliper_LIB_PATH ${caliper_LIB_DIR})
5+
include("${CMAKE_CURRENT_LIST_DIR}/caliper-targets.cmake")
486

49-
include(CMakeFindDependencyMacro)
50-
find_dependency(Threads)
7+
set_and_check(caliper_INCLUDE_DIR "@PACKAGE_caliper_INSTALL_INCLUDE_DIR@")
518

52-
if (@CALIPER_HAVE_ADIAK@)
53-
find_dependency(adiak)
9+
if (@CALIPER_HAVE_ADIAK@)
10+
if (NOT TARGET adiak::adiak)
11+
set(CALIPER_ADIAK_DIR @adiak_DIR@)
12+
if (NOT adiak_DIR)
13+
set(adiak_DIR ${CALIPER_ADIAK_DIR})
14+
endif()
15+
find_dependency(
16+
adiak
17+
CONFIG
18+
NO_DEFAULT_PATH
19+
PATHS
20+
${adiak_DIR}
21+
${adiak_DIR}/lib/cmake/adiak
22+
${PACKAGE_PREFIX_DIR}
23+
${PACKAGE_PREFIX_DIR}/lib/cmake/adiak
24+
)
5425
endif()
55-
56-
# Library targets imported from file
57-
include(${caliper_CMAKE_DIR}/caliper-targets.cmake)
5826
endif()
27+
28+
check_required_components(caliper)

cmake/FindRoctracer.cmake

+11-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ find_library(ROCTRACER_LIBHSAKMT
1616
NAMES hsakmt
1717
HINTS ${ROCM_ROOT_DIR}/lib
1818
)
19+
find_library(ROCTRACER_LIBHSAKMT
20+
NAMES hsakmt
21+
HINTS ${ROCM_ROOT_DIR}/lib
22+
)
23+
find_library(ROCTRACER_AMDHIP64
24+
NAMES amdhip64
25+
HINTS ${ROCM_ROOT_DIR}/lib
26+
)
1927

2028
find_path(ROCTRACER_INCLUDE_DIR
2129
NAMES roctracer.h
@@ -33,7 +41,9 @@ set(ROCTRACER_INCLUDE_DIRS
3341
set(ROCTRACER_LIBRARIES
3442
${ROCTRACER_LIBROCTRACER}
3543
${ROCTRACER_LIBHSARUNTIME}
36-
${ROCTRACER_LIBHSAKMT})
44+
${ROCTRACER_LIBHSAKMT}
45+
${ROCTRACER_AMDHIP64}
46+
)
3747

3848
include(FindPackageHandleStandardArgs)
3949

doc/sphinx/CaliperBasics.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ of exclusive region times:
142142
143143
Caliper provides many more performance measurement configurations in addition
144144
to `runtime-report` that make use of region annotations. For example,
145-
`hatchet-region-profile` writes a json file with region times for processing
145+
`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
148148
configurations and their options.
@@ -327,11 +327,10 @@ maximum amount of memory that was allocated in each region:
327327
foo 0.000778 0.000778 0.000778 8.930211 0.000016
328328
init 0.000020 0.000020 0.000020 0.229568 0.000000
329329
330-
You can use the cali-query and mpi-caliquery programs to list available
331-
configs and their parameters (note that cali-query does not list MPI-dependent
332-
options and configs). For example, ``mpi-caliquery --help=configs`` lists all
333-
configs and their options. You can also query parameters for a specific config,
334-
e.g. ``mpi-caliquery --help=runtime-report``.
330+
You can use the cali-query program to list available configs and their parameters.
331+
For example, ``cali-query --help=configs`` lists all configs and their options.
332+
You can also query parameters for a specific config, e.g.
333+
``cali-query --help=runtime-report``.
335334

336335
Some available performance measurement configs include:
337336

@@ -528,7 +527,7 @@ high-water mark:
528527
2500 1382 2.502447 552.259448 0.000016
529528
3750 1085 2.634396 411.859113 0.000016
530529
531-
See :doc:`BuiltinConfigurations` or run ``mpi-caliquery --help=loop-report``
530+
See :doc:`BuiltinConfigurations` or run ``cali-query --help=loop-report``
532531
to learn about all loop-report options. Loop profiling is also available
533532
with other configs, notably the `spot` config producing output for the Spot
534533
performance visualization web framework.

doc/sphinx/calql.rst

+18-18
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ profile for an application's main loop and printing results in a
1010
table, sorted by time, is accomplished with the following statement:
1111
::
1212

13-
SELECT *, count(), sum(time.duration)
13+
SELECT *, count(), sum(time.duration.ns)
1414
WHERE loop=mainloop
1515
GROUP BY function
1616
FORMAT table
17-
ORDER BY time.duration
17+
ORDER BY time.duration.ns
1818

1919
Quick reference
2020
--------------------------------
@@ -92,7 +92,7 @@ For example, we can use the scale() operator to scale a value before
9292
subsequent aggregations::
9393

9494
LET
95-
sec=scale(time.duration,1e-6)
95+
sec=scale(time.duration.ns,1e-9)
9696
SELECT
9797
path,sum(sec)
9898

@@ -102,15 +102,15 @@ aggregate blocks of 10 iterations in a time-series profile::
102102
LET
103103
block=truncate(iteration#mainloop,10)
104104
SELECT
105-
block,sum(time.duration)
105+
block,sum(time.duration.ns)
106106
GROUP BY
107107
block
108108

109109
The first() operator returns the first attribute out of a list of attribute
110110
names found in an input record. It can also be used to rename attributes::
111111

112112
LET
113-
time=first(time.duration,sum#time.duration)
113+
time=first(time.duration.ns,sum#time.duration.ns)
114114
SELECT
115115
sum(time) AS Time
116116
GROUP BY
@@ -133,11 +133,11 @@ records that contain "omp.work" regions, and then uses that to compute
133133
efficiency from the total and "work" time:
134134

135135
LET
136-
work=first(time.duration) IF omp.work
136+
work=first(time.duration.ns) IF omp.work
137137
SELECT
138-
sum(time.duration) AS Total,
139-
sum(work) AS Work,
140-
ratio(work,time.duration) AS Efficiency
138+
sum(time.duration.ns) AS Total,
139+
sum(work) AS Work,
140+
ratio(work,time.duration.ns) AS Efficiency
141141
GROUP BY
142142
path
143143

@@ -163,10 +163,10 @@ aggregations (e.g., ``min(count())``) within a query are not supported.
163163
The ``AS`` keyword assigns a user-defined name to a selected attribute
164164
or aggregation result. Example::
165165

166-
SELECT sum(time.duration) AS "Time (usec)" FORMAT table
166+
SELECT sum(time.duration.ns) AS "Time (nsec)" FORMAT table
167167

168-
Here, the `table` formatter uses "Time (usec)" instead of "sum#time.duration" as
169-
column name for the ``sum(time.duration)`` column. Only some
168+
Here, the `table` formatter uses "Time (nsec)" instead of "sum#time.duration.ns" as
169+
column name for the ``sum(time.duration.ns)`` column. Only some
170170
formatters (table, tree, json, and json-split) support ``AS``.
171171

172172
Inclusive aggregation operations (`inclusive_sum`, `inclusive_scale`, and
@@ -180,15 +180,15 @@ A more complex example::
180180

181181
SELECT
182182
*,
183-
scale(time.duration,1e-6) AS Time,
184-
inclusive_percent_total(time.duration) AS "Time %"
183+
scale(time.duration.ns,1e-9) AS Time,
184+
inclusive_percent_total(time.duration.ns) AS "Time %"
185185
GROUP BY
186186
path
187187
FORMAT
188188
tree
189189

190-
The computes the (exclusive) sum of `time.duration` divided by 100000 and the inclusive
191-
percent-of-total for `time.duration`. Example output::
190+
The computes the (exclusive) sum of `time.duration.ns` divided by 100000000 and
191+
the inclusive percent-of-total for `time.duration.ns`. Example output::
192192

193193
Path Time Time %
194194
main 5 100
@@ -280,11 +280,11 @@ attribute name and not an alias assigned with ``AS``: ::
280280

281281
SELECT
282282
*,
283-
sum(time.inclusive.duration) AS Time
283+
sum(time.inclusive.duration.ns) AS Time
284284
FORMAT
285285
table
286286
ORDER BY
287-
sum#time.inclusive.duration DESC,
287+
sum#time.inclusive.duration.ns DESC,
288288
iteration#mainloop
289289

290290
function loop iteration#mainloop Time

0 commit comments

Comments
 (0)