<p dir="auto">I am running Julia in parallel, i.e. I am starting several Julia interpreters simultaneously. Usually this works fine. When a package is outdated, both will recompile it.</p>
<p dir="auto">However, I just encountered this error. It went away when I tried again, so I assume it is a race condition.</p>
<p dir="auto">This is with the release branch of Julia 0.4.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ mpirun -np 2 ~/julia/bin/julia 06-cman-transport.jl MPI
INFO: Recompiling stale cache file /Users/eschnett/.julia/lib/v0.4/MPI.ji for module MPI.
INFO: Recompiling stale cache file /Users/eschnett/.julia/lib/v0.4/MPI.ji for module MPI.
ERROR: LoadError: unlink: no such file or directory (ENOENT)
 in unlink at fs.jl:102
 in rm at file.jl:59
 in create_expr_cache at loading.jl:330
 in recompile_stale at loading.jl:461
 in _require_from_serialized at loading.jl:83
 in _require_from_serialized at /Users/eschnett/julia/lib/julia/sys.dylib
 in require at /Users/eschnett/julia/lib/julia/sys.dylib
 in include at /Users/eschnett/julia/lib/julia/sys.dylib
 in include_from_node1 at /Users/eschnett/julia/lib/julia/sys.dylib
 in process_options at /Users/eschnett/julia/lib/julia/sys.dylib
 in _start at /Users/eschnett/julia/lib/julia/sys.dylib
while loading /Users/eschnett/.julia/v0.4/MPI/examples/06-cman-transport.jl, in expression starting on line 1
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------"><pre class="notranslate"><code class="notranslate">$ mpirun -np 2 ~/julia/bin/julia 06-cman-transport.jl MPI
INFO: Recompiling stale cache file /Users/eschnett/.julia/lib/v0.4/MPI.ji for module MPI.
INFO: Recompiling stale cache file /Users/eschnett/.julia/lib/v0.4/MPI.ji for module MPI.
ERROR: LoadError: unlink: no such file or directory (ENOENT)
 in unlink at fs.jl:102
 in rm at file.jl:59
 in create_expr_cache at loading.jl:330
 in recompile_stale at loading.jl:461
 in _require_from_serialized at loading.jl:83
 in _require_from_serialized at /Users/eschnett/julia/lib/julia/sys.dylib
 in require at /Users/eschnett/julia/lib/julia/sys.dylib
 in include at /Users/eschnett/julia/lib/julia/sys.dylib
 in include_from_node1 at /Users/eschnett/julia/lib/julia/sys.dylib
 in process_options at /Users/eschnett/julia/lib/julia/sys.dylib
 in _start at /Users/eschnett/julia/lib/julia/sys.dylib
while loading /Users/eschnett/.julia/v0.4/MPI/examples/06-cman-transport.jl, in expression starting on line 1
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
</code></pre></div>
<p dir="auto">The standard way to handle this in Unix is to write to a temporary file (<code class="notranslate">$output.tmp</code>), and then use an atomic rename to update the cache (<code class="notranslate">mv("$output.tmp", output)</code>). Removing the file beforehand is not necessary, and can't be done safely unless one locks the directory.</p>
<p dir="auto">Hi all,</p>
<p dir="auto">I am trying to run julia from multiple machines (bash launches multiple julia instances from various machines) and all share the same home dir.</p>
<p dir="auto">The issue is that each machine recompiles the stale cache. (All are share the same package dir). Is this an issue? Is this a known issue? Is there a solution?</p>
<p dir="auto">Thanks</p>