Skip to content

Instantly share code, notes, and snippets.

@moble
moble / README.md
Last active August 17, 2021 03:34
Speed up execution of `@everywhere` in julia
NOTE: A somewhat streamlined version of this approach can be found in this other gist, which involves only one simple script. You could still use the timing files from this gist if you want to check the details.

As described in detail here, julia can take really excessive amounts of time to execute the first @everywhere statement on many processes — around 1 hour for thousands of processes — even if the actual code being executed everywhere is trivial. Basically, the Distributed functions need to be precompiled to make this happen quickly.

This gist provides a simple way to do so — at least on Slurm clusters (though the same principles should apply elsewhere). The key file is organizer.jl; just submit it as a batch job (adjusting the SBATCH directives as needed), and it should create a sysimage that you can use to run futur