Skip to content

force singlethreading during precompilation#48592

Merged
IanButterworth merged 2 commits intoJuliaLang:masterfrom
IanButterworth:ib/compilecache_1thread
Feb 10, 2023
Merged

force singlethreading during precompilation#48592
IanButterworth merged 2 commits intoJuliaLang:masterfrom
IanButterworth:ib/compilecache_1thread

Conversation

@IanButterworth
Copy link
Copy Markdown
Member

Only allowing 1 julia thread during precompiling packages makes sense in the context that

  • Pkg.precompile manages multi-processing, and any multithreading during precompilation risks overloading the system
  • The upcoming LLVM image parallel PR Parallelize LLVM image generation #47797 has it's own JULIA_IMAGE_THREADS env var for controlling that multithreading, which Pkg.precompile will be taught to manage

And a niche issue:

A pkgeval run would probably be a good idea for this

@IanButterworth IanButterworth added the needs pkgeval Tests for all registered packages should be run with this change label Feb 8, 2023
@IanButterworth
Copy link
Copy Markdown
Member Author

It seems the -t arg doesn't propagate through julia_cmd() so I've switched it over to JULIA_NUM_THREADS

$ ./julia -t2

julia> Base.julia_cmd()
`/home/ian/Documents/GitHub/julia/usr/bin/julia -Cnative -J/home/ian/Documents/GitHub/julia/usr/lib/julia/sys.so -g1`

@DilumAluthge
Copy link
Copy Markdown
Member

It seems the -t arg doesn't propagate through julia_cmd()

Is this a separate bug that we should fix?

@IanButterworth
Copy link
Copy Markdown
Member Author

Discussed on slack and it seems logical that it doesn't. julia_cmd() only propagates declared args, not promising all are, and propagating -t to subprocesses doesn't seem to make sense.

@IanButterworth IanButterworth changed the title always precompile with only 1 thread force singlethreading during precompilation Feb 9, 2023
@IanButterworth
Copy link
Copy Markdown
Member Author

@nanosoldier runtests()

@nanosoldier
Copy link
Copy Markdown
Collaborator

Your package evaluation job has completed - possible new issues were detected.
A full report can be found here.

@IanButterworth IanButterworth removed the needs pkgeval Tests for all registered packages should be run with this change label Feb 10, 2023
@IanButterworth
Copy link
Copy Markdown
Member Author

IanButterworth commented Feb 10, 2023

pkgeval seems ok to me

@IanButterworth IanButterworth added the backport 1.9 Change should be backported to release-1.9 label Feb 10, 2023
@IanButterworth IanButterworth merged commit c0d2c57 into JuliaLang:master Feb 10, 2023
@IanButterworth IanButterworth deleted the ib/compilecache_1thread branch February 10, 2023 12:19
-`,
"OPENBLAS_NUM_THREADS" => 1),
"OPENBLAS_NUM_THREADS" => 1,
"JULIA_NUM_THREADS" => 1),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

                              "JULIA_NUM_THREADS" => nothing),

@KristofferC KristofferC mentioned this pull request Feb 20, 2023
50 tasks
KristofferC pushed a commit that referenced this pull request Feb 20, 2023
KristofferC pushed a commit that referenced this pull request Feb 20, 2023
KristofferC pushed a commit that referenced this pull request Feb 20, 2023
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
KristofferC pushed a commit that referenced this pull request Feb 21, 2023
@KristofferC KristofferC removed the backport 1.9 Change should be backported to release-1.9 label Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants