Skip to content

Commit

Permalink
set CPU_CORES only at startup and not during build. fixes JuliaLang#6102
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Mar 11, 2014
1 parent cf86d64 commit 7662f72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ end


function _start()
Sys.init_sysinfo()
if CPU_CORES > 8 && !("OPENBLAS_NUM_THREADS" in keys(ENV)) && !("OMP_NUM_THREADS" in keys(ENV))
# Prevent openblas from stating to many threads, unless/until specifically requested
ENV["OPENBLAS_NUM_THREADS"] = 8
Expand Down
2 changes: 1 addition & 1 deletion base/sysinfo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import ..Base: show, uv_error

global CPU_CORES

function __init__()
function init_sysinfo()
# set CPU core count
global const CPU_CORES = int(
haskey(ENV,"JULIA_CPU_CORES") ?
Expand Down

0 comments on commit 7662f72

Please sign in to comment.