1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#
# ----------------------------------------------------------------------------
from spack.package import *
class Omnitrace(CMakePackage):
"""Application Profiling, Tracing, and Analysis"""
homepage = "https://amdresearch.github.io/omnitrace"
git = "https://github.com/AMDResearch/omnitrace.git"
maintainers = ["jrmadsen"]
version("main", branch="main", submodules=True)
version("1.4.0", commit="23fb3946c7f4c0702b1b168e1d78b8b62597e3f1", submodules=True)
version("1.3.1", commit="641225f88304909fd2ca5407aec062d0fdf0ed8b", submodules=True)
version("1.3.0", commit="4dd144a32c8b83c44e132ef53f2b44fe4b4d5569", submodules=True)
version("1.2.0", commit="f82845388aab108ed1d1fc404f433a0def391bb3", submodules=True)
# override build_type to default to Release because this has a significant
# impact on build-time and the size of the build
variant(
"build_type",
default="Release",
description="CMake build type",
values=("Debug", "Release", "RelWithDebInfo", "MinSizeRel"),
)
variant(
"rocm",
default=True,
description="Enable ROCm API, kernel tracing, and GPU HW counters support",
)
variant("strip", default=False, description="Faster binary instrumentation, worse debugging")
variant(
"python", default=False, description="Enable support for Python function profiling and API"
)
variant("papi", default=True, description="Enable HW counters support via PAPI")
variant("ompt", default=True, description="Enable OpenMP Tools support")
variant(
"tau",
default=False,
description="Enable support for using TAU markers in omnitrace instrumentation",
)
variant(
"caliper",
default=False,
description="Enable support for using Caliper markers in omnitrace instrumentation",
)
variant(
"perfetto_tools",
default=False,
description="Install perfetto tools (e.g. traced, perfetto)",
)
variant(
"mpi",
default=False,
description=(
"Enable intercepting MPI functions and aggregating output during finalization "
"(requires target application to use same MPI installation)"
),
)
variant(
"mpi_headers",
default=True,
description=(
"Enable intercepting MPI functions but w/o support for aggregating output "
"(target application can use any MPI installation)"
),
)
extends("python", when="+python")
# hard dependencies
depends_on("cmake@3.16:", type="build")
depends_on("dyninst@11.0.1:", type=("build", "run"))
depends_on("libunwind", type=("build", "run"))
# soft dependencies
depends_on("hip", when="+rocm")
depends_on("rocm-smi-lib", when="+rocm")
depends_on("roctracer-dev", when="+rocm")
depends_on("rocprofiler-dev", when="@1.3.0: +rocm")
depends_on("papi+shared", when="+papi")
depends_on("mpi", when="+mpi")
depends_on("tau", when="+tau")
depends_on("caliper", when="+caliper")
depends_on("python@3:", when="+python", type=("build", "run"))
def cmake_args(self):
spec = self.spec
args = [
self.define("SPACK_BUILD", True),
self.define("OMNITRACE_BUILD_PAPI", False),
self.define("OMNITRACE_BUILD_PYTHON", True),
self.define("OMNITRACE_BUILD_DYNINST", False),
self.define("OMNITRACE_BUILD_LIBUNWIND", False),
self.define("OMNITRACE_BUILD_STATIC_LIBGCC", False),
self.define("OMNITRACE_BUILD_STATIC_LIBSTDCXX", False),
self.define_from_variant("OMNITRACE_BUILD_LTO", "ipo"),
self.define_from_variant("OMNITRACE_USE_HIP", "rocm"),
self.define_from_variant("OMNITRACE_USE_MPI", "mpi"),
self.define_from_variant("OMNITRACE_USE_OMPT", "ompt"),
self.define_from_variant("OMNITRACE_USE_PAPI", "papi"),
self.define_from_variant("OMNITRACE_USE_RCCL", "rocm"),
self.define_from_variant("OMNITRACE_USE_ROCM_SMI", "rocm"),
self.define_from_variant("OMNITRACE_USE_ROCTRACER", "rocm"),
self.define_from_variant("OMNITRACE_USE_ROCPROFILER", "rocm"),
self.define_from_variant("OMNITRACE_USE_PYTHON", "python"),
self.define_from_variant("OMNITRACE_USE_MPI_HEADERS", "mpi_headers"),
self.define_from_variant("OMNITRACE_STRIP_LIBRARIES", "strip"),
self.define_from_variant("OMNITRACE_INSTALL_PERFETTO_TOOLS", "perfetto_tools"),
# timemory arguments
self.define("TIMEMORY_UNITY_BUILD", False),
self.define("TIMEMORY_BUILD_CALIPER", False),
self.define_from_variant("TIMEMORY_USE_TAU", "tau"),
self.define_from_variant("TIMEMORY_USE_CALIPER", "caliper"),
]
if "+tau" in spec:
tau_root = spec["tau"].prefix
args.append(self.define("TAU_ROOT_DIR", tau_root))
if "+python" in spec:
pyexe = spec["python"].command.path
args.append(self.define("PYTHON_EXECUTABLE", pyexe))
args.append(self.define("Python3_EXECUTABLE", pyexe))
if "+mpi" in spec:
args.append(self.define("MPI_C_COMPILER", spec["mpi"].mpicc))
args.append(self.define("MPI_CXX_COMPILER", spec["mpi"].mpicxx))
return args
def setup_build_environment(self, env):
if "+tau" in self.spec:
import glob
# below is how TAU_MAKEFILE is set in packages/tau/package.py
pattern = join_path(self.spec["tau"].prefix.lib, "Makefile.*")
files = glob.glob(pattern)
if files:
env.set("TAU_MAKEFILE", files[0])
def setup_run_environment(self, env):
if "+python" in self.spec:
env.prepend_path("PYTHONPATH", join_path(self.prefix.lib, "python", "site-packages"))
|