Skip to content

Commit 65b0927

Browse files
IanButterworthnalimilan
authored andcommitted
Precompile pidlocks: add to NEWS and docs (#50385)
1 parent ce70ddd commit 65b0927

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Compiler/Runtime improvements
3737
* The mark phase of the garbage collector is now multi-threaded ([#48600]).
3838
* [JITLink](https://llvm.org/docs/JITLink.html) is enabled by default on Linux aarch64 when Julia is linked to LLVM 15 or later versions ([#49745]).
3939
This should resolve many segmentation faults previously observed on this platform.
40+
* The precompilation process now uses pidfile locks and orchestrates multiple julia processes to only have one process
41+
spend effort precompiling while the others wait. Previously all would do the work and race to overwrite the cache files.
42+
([#49052])
4043

4144
Command-line option changes
4245
---------------------------

doc/src/manual/environment-variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ should have at the terminal.
378378

379379
## System and Package Image Building
380380

381-
### `JULIA_CPU_TARGET`
381+
### [`JULIA_CPU_TARGET`](@id JULIA_CPU_TARGET)
382382

383383
Modify the target machine architecture for (pre)compiling
384384
[system](@ref sysimg-multi-versioning) and [package images](@ref pkgimgs-multi-versioning).

doc/src/manual/faq.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,17 +1035,15 @@ Modifying OpenBLAS settings or compiling Julia with a different BLAS library, eg
10351035

10361036
### How do I manage precompilation caches in distributed file systems?
10371037

1038-
When using `julia` in high-performance computing (HPC) facilities, invoking
1039-
_n_ `julia` processes simultaneously creates at most _n_ temporary copies of
1040-
precompilation cache files. If this is an issue (slow and/or small distributed
1041-
file system), you may:
1042-
1043-
1. Use `julia` with `--compiled-modules=no` flag to turn off precompilation.
1044-
2. Configure a private writable depot using `pushfirst!(DEPOT_PATH, private_path)`
1045-
where `private_path` is a path unique to this `julia` process. This
1046-
can also be done by setting environment variable `JULIA_DEPOT_PATH` to
1047-
`$private_path:$HOME/.julia`.
1048-
3. Create a symlink from `~/.julia/compiled` to a directory in a scratch space.
1038+
When using Julia in high-performance computing (HPC) facilities with shared filesystems, it is recommended to use a shared
1039+
depot (via the `JULIA_DEPOT_PATH` environment variable). Since Julia v1.10, multiple Julia processes on functionally similar
1040+
workers and using the same depot will coordinate via pidfile locks to only spend effort precompiling on one process while the
1041+
others wait. The precompilation process will indicate when the process is precompiling or waiting for another that is
1042+
precompiling. If non-interactive the messages are via `@debug`.
1043+
1044+
However, due to caching of binary code, the cache rejection since v1.9 is more strict and users may need to set the
1045+
[`JULIA_CPU_TARGET`](@ref JULIA_CPU_TARGET) environment variable appropriately to get a single cache that is usable throughout the HPC
1046+
environment.
10491047

10501048
## Julia Releases
10511049

0 commit comments

Comments
 (0)