Skip to content

Commit

Permalink
Initial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
VarLad committed Mar 6, 2024
1 parent eb188fd commit 6ff242b
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ version = "0.2.0"

[deps]
CoverageTools = "c36e975a-824b-4404-a568-ef97ca766997"
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
Expand Down
38 changes: 38 additions & 0 deletions src/PerfChecker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,44 @@ using Profile
import TypedTables: Table
import Distributed: remotecall_fetch, addprocs, rmprocs
import CoverageTools: analyze_malloc_files, find_malloc_files, MallocInfo
import Sys
import CpuId

struct HwInfo
cpus::Vector{CPUInfo}
machine::String
word::Int
simdbytes::Int
corecount::Tuple{Int, Int}
end

struct CheckerResult
table::Table
hwinfo::HwInfo
tags::Vector{Symbol}
end

function find_by_tags(tags::Vector{Symbol}, results::CheckerResult; exact_match = true)
results = []
if exact_match
for j in results
if tags == j.tags
push!(results, tags)
else
end
else
for j in results
for i in tags
if i in j.tags
push!(results, tags)
break
end
end
end
end

return results
end

# SECTION - Exports
export @check
Expand Down
2 changes: 0 additions & 2 deletions src/alloc.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
prep(d::Dict, block::Expr, ::Val{:alloc}) = quote
import Pkg
Pkg.instantiate()
import Profile
$block
nothing
Expand Down
34 changes: 34 additions & 0 deletions src/check.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,53 @@ function default_options(d::Dict, v::Symbol)
return merge(di, d)
end

function resolve_versions(d::Dict{String,Any})
for key,value in d
d[key] = resolve_version(x)
end
end

function resolve_version(x::String, y::VersionNumber)

end

function resolve_version(x::String, y::String)

end

function resolve_version(x::String, y::Symbol)

end

macro check(x, d, block1, block2)
block1, block2 = Expr(:quote, block1), Expr(:quote, block2)
quote
di = default_options($d, $x)
g = prep(di, $block1, $x)
h = check(di, $block2, $x)
import Pkg
Pkg.instantiate()
p = remotecall_fetch(Core.eval, 1, Main,
Expr(:toplevel, quote
import Distributed
d = $di
if typeof(d[:path]) == Dict{String, Any}
d[:path] == mktemp()[1]
end
Distributed.addprocs(1; exeflags=["--track-allocation=$(d[:track])", "--project=$(d[:path])", "-t $(d[:threads])"])
end).args...) |> first

remotecall_fetch(Core.eval, p, Main,
Expr(:toplevel, quote
import Pkg;
Pkg.instantiate();
).args...)


if typeof(di.path) == Dict{String, Any}

end

di[:prep_result] = remotecall_fetch(Core.eval, p, Main,
Expr(:toplevel, g.args...))

Expand Down

0 comments on commit 6ff242b

Please sign in to comment.