diff --git a/Project.toml b/Project.toml index f81b533..b52f331 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "CPUSummary" uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" authors = ["chriselrod and contributors"] -version = "0.1.12" +version = "0.1.13" [deps] Hwloc = "0e44f5e4-bd66-52a0-8798-143a42290a1d" diff --git a/src/CPUSummary.jl b/src/CPUSummary.jl index d4a77a0..20f5ccb 100644 --- a/src/CPUSummary.jl +++ b/src/CPUSummary.jl @@ -10,9 +10,12 @@ const USE_HWLOC = @load_preference("hwloc", true) use_hwloc(b) = @set_preferences!("hwloc" => b) @static if USE_HWLOC + tmpd = mktempdir() try - p = run(`$(Base.julia_cmd()) --project=$(mktempdir()) -e'using Pkg; Pkg.add("Hwloc"); using Hwloc; Hwloc.gettopology()'`, wait=false) + p = run(`$(Base.julia_cmd()) --project=$tmpd -e'using Pkg; Pkg.add("Hwloc"); using Hwloc; Hwloc.gettopology()'`, wait=false) wait(p) + @show p + @show p.exitcode == 0 && p.termsignal == 0 if p.exitcode == 0 && p.termsignal == 0 include("topology.jl") else @@ -21,7 +24,9 @@ use_hwloc(b) = @set_preferences!("hwloc" => b) end catch use_hwloc(false) - include("generic_topology.jl") + include("generic_topology.jl") + finally + rm(tmpd, recursive=true) end else include("generic_topology.jl") diff --git a/src/generic_topology.jl b/src/generic_topology.jl index 98c9df5..afd2d1b 100644 --- a/src/generic_topology.jl +++ b/src/generic_topology.jl @@ -41,7 +41,7 @@ cache_inclusive(_) = False() else cache_linesize(_) = StaticInt{64}() # assume... end - +cache_size(_) = StaticInt{0}() cache_type(::Union{Val{3},StaticInt{3}}) = Val{:Unified}() cache_size(::Union{Val{3},StaticInt{3}}) = num_cores() * StaticInt{1441792}()