use CPUselect.jl
This commit is contained in:
parent
4c26db6ee8
commit
10cbd4c6f3
20
AutFN.jl
20
AutFN.jl
@ -38,17 +38,6 @@ end
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
function cpuinfo_physicalcores()
|
||||
maxcore = -1
|
||||
for line in eachline("/proc/cpuinfo")
|
||||
if startswith(line, "core id")
|
||||
maxcore = max(maxcore, parse(Int, split(line, ':')[2]))
|
||||
end
|
||||
end
|
||||
maxcore < 0 && error("failure to read core ids from /proc/cpuinfo")
|
||||
return maxcore + 1
|
||||
end
|
||||
|
||||
function parse_commandline()
|
||||
s = ArgParseSettings()
|
||||
|
||||
@ -86,14 +75,9 @@ function parse_commandline()
|
||||
end
|
||||
|
||||
function main()
|
||||
include("CPUselect.jl")
|
||||
set_parallel_mthread(PARSEDARGS, workers=true)
|
||||
|
||||
parsed_args = parse_commandline()
|
||||
if parsed_args["cpus"] ≠ nothing
|
||||
if parsed_args["cpus"] > cpuinfo_physicalcores()
|
||||
warn("Number of specified cores exceeds the physical core cound. Performance will suffer.")
|
||||
end
|
||||
Blas.set_num_threads(parsed_args["cpus"])
|
||||
end
|
||||
|
||||
N = parsed_args["N"]
|
||||
radius = 2
|
||||
|
Loading…
Reference in New Issue
Block a user