Skip to content

Limit how many threads used during precompile #2404

@Moelf

Description

@Moelf

ran into this error today on a Linux machine with 2 CPUs, 28 cores, reporting 56 threads.

(@v1.6) pkg> precompile
┌ Error: Pkg.precompile error
│   exception =
│    IOError: could not spawn `....julia-1.6.0-rc1/bin/julia -Cnative -Jjulia-1.6.0-rc1/lib/julia/sys.so -g1 -O0 --output-ji .....julia/compiled/v1.6/MacroTools/jl_KkrSks --output-incremental=yes --startup-file=no --history-file=no --warn-overwrite=yes --color=yes --eval 'eval(Meta.parse(read(stdin,String)))'`: resource temporarily unavailable (EAGAIN)
│    Stacktrace:
│      [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Any})
│        @ Base ./process.jl:99
│      [2] JuliaLang/julia#639
│        @ ./process.jl:112 [inlined]
│      [3] setup_stdios(f::Base.var"#639#640"{Cmd}, stdios::Vector{Any})
│        @ Base ./process.jl:196
│      [4] _spawn

└ @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1012

This is on a shared system with many people. I personally would think it makes sense to add a limit so that CPU usage during precompile is also bounded by <= JULIA_NUM_THREADS since if the user doesn't want to occupy too much resource during computation, they likely don't want to during precompile. cc @IanButterworth thanks for the help on Slack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions