summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjalcaraz <jordi_alc@hotmail.com>2024-01-30 19:07:33 -0800
committerGitHub <noreply@github.com>2024-01-30 19:07:33 -0800
commit376653ec3dd81adae058643f22a91f02a4661818 (patch)
treea1735c4880ac9c6191b26d4bd0114a187c004437
parent28eea2994f04ec73f647cf636de433fbc9317c4c (diff)
downloadspack-376653ec3dd81adae058643f22a91f02a4661818.tar.gz
spack-376653ec3dd81adae058643f22a91f02a4661818.tar.bz2
spack-376653ec3dd81adae058643f22a91f02a4661818.tar.xz
spack-376653ec3dd81adae058643f22a91f02a4661818.zip
Updated last commit of TAU package with Dyninst test (#42387)
* Updated last commit of TAU package with Dyninst test * The path to dyninst was missing when loading TAU
-rw-r--r--var/spack/repos/builtin/packages/tau/package.py51
1 files changed, 48 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/tau/package.py b/var/spack/repos/builtin/packages/tau/package.py
index 62038729fa..7a42d1ae10 100644
--- a/var/spack/repos/builtin/packages/tau/package.py
+++ b/var/spack/repos/builtin/packages/tau/package.py
@@ -393,17 +393,29 @@ class Tau(Package):
# in the latter case.
if files:
env.set("TAU_MAKEFILE", files[0])
+ if "+dyninst" in self.spec:
+ path_to_dyn_lib = self.spec["dyninst"].prefix.lib
+ dyninst_apirt = join_path(path_to_dyn_lib, "libdyninstAPI_RT.so")
+ env.set("DYNINSTAPI_RT_LIB", dyninst_apirt)
+ env.append_path("LD_LIBRARY_PATH", path_to_dyn_lib)
+ env.append_path("LD_LIBRARY_PATH", self.prefix.lib)
matmult_test = join_path("examples", "mm")
+ dyninst_test = join_path("examples", "dyninst")
+ makefile_test = join_path("examples", "Makefile")
+ makefile_inc_test = join_path("include", "Makefile")
@run_after("install")
def setup_build_tests(self):
"""Copy the build test files after the package is installed to an
install test subdirectory for use during `spack test run`."""
self.cache_extra_test_sources(self.matmult_test)
+ self.cache_extra_test_sources(self.dyninst_test)
+ self.cache_extra_test_sources(self.makefile_test)
+ self.cache_extra_test_sources(self.makefile_inc_test)
- def _run_matmult_test(self):
- mm_dir = join_path(self.test_suite.current_test_cache_dir, self.matmult_test)
+ def _run_matmult_test(self, test_dir):
+ mm_dir = join_path(test_dir, self.matmult_test)
self.run_test(
"make",
["all"],
@@ -437,6 +449,39 @@ class Tau(Package):
mm_dir,
)
+ def _run_dyninst_test(self, test_dir):
+ dyn_dir = join_path(test_dir, self.dyninst_test)
+ flags = "serial"
+ if "+mpi" in self.spec:
+ flags = "mpi"
+ self.run_test("make", ["all"], [], 0, False, "Build example code", False, dyn_dir)
+ self.run_test(
+ "tau_run",
+ ["-T", flags, "./klargest", "-v", "-o", "./klargest.i"],
+ [],
+ 0,
+ False,
+ "Instrument code with dyninst",
+ False,
+ dyn_dir,
+ )
+ self.run_test(
+ "./klargest.i", [], [], 0, False, "Execute instrumented code", False, dyn_dir
+ )
+ self.run_test(
+ "pprof",
+ [],
+ [],
+ 0,
+ False,
+ "Run pprof profile analysis tool on profile output",
+ False,
+ dyn_dir,
+ )
+
def test(self):
+ test_dir = self.test_suite.current_test_cache_dir
# Run mm test program pulled from the build
- self._run_matmult_test()
+ self._run_matmult_test(test_dir)
+ if "+dyninst" in self.spec:
+ self._run_dyninst_test(test_dir)