Multiple machines with same file system, should Julia recompile on each?

At work, we have a system where I have a single user account, a desktop on my desk, and multiple compute machines I can ssh into. All these share the same, shared, file system. E.g. they use the same .julia folder, if i add a package in one machine they are avaiable when I ssh into another machine. They all share he same config file etc.

However, I am having tons of problems with precompilation. Pretty much every time I start Julia I have to go through long precompilation processes. I have a package with my project, and every time I run using MyProjectPackage, there is precompilation, often without making any actual changes.

One question I had is, if I precompile something on one of these machines, since they have a shared file system, should/should not Julia be precompiled on all machines? Right now separate precompilations on all machines seems very much to be the case (with everything etting stuch if I attempt to run something on two machines separately).

Is this expected behaviour, or are my problems likely due to something else?

1 Like

Are the CPUs diffferent? You might need to launch julia with flags to make it not use native cpu features and instead pick a common baseline.

1 Like

Yeah, the CPUs are different. You mean something like

julia -Cgeneric

?

1 Like

you don’t want -Cgeneric. That will limit you to instructions from the 1990s. You probably want -Cx86-64-v3 if all your CPUs are from the past 10 years ago or -Cx86-64-v4 if they all have AVX-512.

3 Likes

Thanks, that sounds good, also helps me know the flag to use.

Here are the flags the Julia binaries are using.

3 Likes

Thanks, very useful!

Similar problem with essentially the same solution. Just cross-posting it here in case it helps anyone: Julia 1.9, same depot with different machines?

There is also the environment variable JULIA_MAX_NUM_PRECOMPILE_FILES, which someone in this forum suggested to set to a higher value (e.g. ~50) if disk space is not a big issue. It does seem to help in my case (heterogeneous cluster machines) to reduce the number of potential (re-)precompilations.

1 Like