Warm tip: This article is reproduced from serverfault.com, please click

using custom system image (from PackageCompiler.jl) in conjunction with MPI in Julia

发布于 2020-11-14 21:41:42

I’ve been recently playing with the MPI wrappers for Julia (MPI.jl) – yesterday I built a dumb test problem in both C and Julia and was comparing performance, and Julia is pretty close to C which is impressive!

Julia/C parallel comparison

I thought I might be able to close the gap even further by using the PackageCompiler.jl package to speed up the initial loading cost in Julia, but I can’t get it to play nicely. If I run:

julia --sysimage myImage.so --project myProject.jl

it works fine (where myImage.so is a system image I generated with PackageCompiler.jl), but if I run:

mpiexec -n np julia --sysimage myImage.so --project myProject.jl

I get a signal 6 abort. This is my first experience with both the MPI.jl and PackageCompiler.jl packages, so any tips/insights are much appreciated!

Questioner
kirklong
Viewed
0
kirklong 2020-11-30 05:58:38

This does work! The problem was that I recently updated Julia and had made my script executable with #!/usr/bin/env julia. When I compiled the system image that ended up using Julia 1.5.x while the symlink in /usr/bin still pointed to the old Julia (1.4.x).

So if you want to run your Julia project in Parallel with a custom image you can indeed just write:

mpiexec -n np julia --sysimage myImage.so --project myProject.jl

and it will run blazing fast! (assuming your OS isn't confused about which Julia to use)