# Precompilation error using Distributed on HPC

**URL:** <https://discourse.julialang.org/t/precompilation-error-using-distributed-on-hpc/109823>\
**Category:** General Usage\
**Created:** [February 6, 2024, 5:14pm UTC](https://discourse.julialang.org/t/precompilation-error-using-distributed-on-hpc/109823 "2024-02-06T17:14:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hijit](https://avatars.discourse-cdn.com/v4/letter/h/7ba0ec/32.png) [@hijit](https://discourse.julialang.org/u/hijit)\
**Post date:** [February 6, 2024, 5:14pm UTC](https://discourse.julialang.org/t/precompilation-error-using-distributed-on-hpc/109823/1 "2024-02-06T17:14:50Z")

</div>

I keep getting the following strange error from each of the workers when running my code on multiple workers in an HPC environment:

> Warning: Module Distributed with build ID … is missing from the cache. This may mean Distributed does not support precompilation but is imported by a module that does.

The code runs otherwise without error and I get the correct output. Furthermore, locally I can precompile and run the same code without issue, but I want to diagnose the issue before it causes problems down the road.

My code is structured as following.

```julia
using Distributed
@everywhere using LQMRunner
@everywhere using LatticeQM.Operators
@everywhere using LatticeQM.Spectrum
@everywhere import LinearAlgebra: BLAS.set_num_threads, mul!, lmul!, Diagonal
@everywhere set_num_threads(1)

if length(ARGS) != 0
	@time startprcs(ARGS[1])
	println("FINISHED...SLEEPING.")
	sleep(3)
else
	error("No job was provided to the script.")
end

```

Where startprcs eventually calls a method contained in a submodule of LQMRunner which is written to utilize the Distributed workers. This submodule imports Distributed to utilize the workers, in particular it utilizes the myid() and remote\_do() methods.

EDIT: I have tried

```julia
using LQMRunner
@everywhere using LQMRunner

```

to force precompilation before the code is passed to the workers but I get the same warnings from all of my workers.

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [April 10, 2024, 10:40pm UTC](https://discourse.julialang.org/t/precompilation-error-using-distributed-on-hpc/109823/2 "2024-04-10T22:40:40Z")

</div>

Did you find a solution? I’m facing a similar problem.

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [April 11, 2024, 5:33am UTC](https://discourse.julialang.org/t/precompilation-error-using-distributed-on-hpc/109823/3 "2024-04-11T05:33:13Z")

</div>

which julia version are you running?

---

<div class="post-metadata">

**Author:** ![jbrea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jbrea/32/3879_2.png) [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Post date:** [April 11, 2024, 7:48am UTC](https://discourse.julialang.org/t/precompilation-error-using-distributed-on-hpc/109823/4 "2024-04-11T07:48:06Z")

</div>

1.10.2, packages are updated.

EDIT: My problem is solved. I changed the DEPOT\_PATH at the start of the running julia session. This worked as expected when I was not using Distributed. However, when using Distributed I got warnings as in the OP. The only thing that worked was exporting JULIA\_DEPOT\_PATH _before_ starting the julia session.

It is unclear to me, why changing the DEPOT\_PATH doesn’t play nicely with Distributed…

---

<div class="post-metadata">

**Author:** ![fatteneder](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fatteneder/32/33991_2.png) [@fatteneder](https://discourse.julialang.org/u/fatteneder)\
**Post date:** [April 11, 2024, 8:48am UTC](https://discourse.julialang.org/t/precompilation-error-using-distributed-on-hpc/109823/5 "2024-04-11T08:48:44Z")

</div>

Maybe it is because changes to `DEPOT_PATH` in an active session on the main process are not automatically reflected on remote workers, whereas with running `JULIA_DEPOT_PATH=... julia` you set up the environment variable so that it is inherited when the main process spawns remote workers?
