Skip to content

Commit 36f9346

Browse files
committed
liblikwid_available check + minor code reorg
1 parent f3efb5f commit 36f9346

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/misc.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Query the access mode used by LIKWID, i.e. either
7676
"""
7777
accessmode() = LIKWID.get_configuration().daemonMode
7878

79+
function liblikwid_available()
80+
return Libdl.find_library(liblikwid) != ""
81+
end
82+
7983
"Run a Cmd object, returning the stdout & stderr contents plus the exit code"
8084
function _execute(cmd::Cmd)
8185
out = Pipe()
@@ -261,3 +265,12 @@ LIKWID_MODE(mode) = ENV["LIKWID_MODE"] = mode;
261265
LIKWID_EVENTS(eventstr::AbstractString) = ENV["LIKWID_EVENTS"] = eventstr;
262266
LIKWID_THREADS(cpustr::AbstractString) = ENV["LIKWID_THREADS"] = cpustr;
263267
LIKWID_MPI_CONNECT(x::AbstractString) = ENV["LIKWID_MPI_CONNECT"] = x;
268+
269+
"""
270+
Query the paranoia level of the performance events system
271+
"""
272+
function perf_event_paranoid()
273+
open(perf_paranoid_path, "r") do io
274+
parse(Int, readline(io))
275+
end
276+
end

0 commit comments

Comments
 (0)