Skip to content

Commit

Permalink
liblikwid_available check + minor code reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenbauer committed Dec 5, 2022
1 parent f3efb5f commit 36f9346
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ Query the access mode used by LIKWID, i.e. either
"""
accessmode() = LIKWID.get_configuration().daemonMode

function liblikwid_available()
return Libdl.find_library(liblikwid) != ""
end

"Run a Cmd object, returning the stdout & stderr contents plus the exit code"
function _execute(cmd::Cmd)
out = Pipe()
Expand Down Expand Up @@ -261,3 +265,12 @@ LIKWID_MODE(mode) = ENV["LIKWID_MODE"] = mode;
LIKWID_EVENTS(eventstr::AbstractString) = ENV["LIKWID_EVENTS"] = eventstr;
LIKWID_THREADS(cpustr::AbstractString) = ENV["LIKWID_THREADS"] = cpustr;
LIKWID_MPI_CONNECT(x::AbstractString) = ENV["LIKWID_MPI_CONNECT"] = x;

"""
Query the paranoia level of the performance events system
"""
function perf_event_paranoid()
open(perf_paranoid_path, "r") do io
parse(Int, readline(io))
end
end

0 comments on commit 36f9346

Please sign in to comment.