Skip to content

MPIPreferences persists through pre-compilation cache. #646

Closed
@t-bltg

Description

@t-bltg

As discussed with @giordano on slack, and I scratched my head a long time on this one:

julia> using MPIPreferences
julia> MPIPreferences.use_jll_binary("MPICH_jll")  # persistent `.toml` written
[...]

# restart julia
julia> using MPICH_jll, OpenMPI_jll  # precompiles
julia> MPICH_jll.is_available()
true
julia> MPIPreferences.use_jll_binary("OpenMPI_jll")  # I now decide to change the MPI implementation used
[...]

# restart julia
julia> using OpenMPI_jll  # does NOT precompile
julia> OpenMPI_jll.is_available()  # confusing since ~/.julia/environments/v1.8/LocalPreferences.toml states `binary = "OpenMPI_jll"`
false

# delete ~/.julia/compiled/OpenMPI_jll, restart julia
julia> using OpenMPI_jll  # precompiles
julia> OpenMPI_jll.is_available()
true

I believe MPIPreferences should invalidate the pre-compilation cache, or we should do something about host_platform being persistent in the precompilation cache.
I shouldn't have to delete ~/.julia/compiled/OpenMPI_jll manually.

This leads to weird mix-ups such as:

julia> using MPICH_jll
julia> MPICH_jll.is_available()
false
julia> MPICH_jll.host_platform  # notice the mpi=openmpi :s
Linux x86_64 {cxxstring_abi=cxx11, julia_version=1.8.1, libc=glibc, libgfortran_version=5.0.0, libstdcxx_version=3.4.30, mpi=openmpi}
julia> using OpenMPI_jll
julia> OpenMPI_jll.is_available()
false
julia> OpenMPI_jll.host_platform  # notice the mpi=mpich :/
Linux x86_64 {cxxstring_abi=cxx11, julia_version=1.8.1, libc=glibc, libgfortran_version=5.0.0, libstdcxx_version=3.4.30, mpi=mpich}

Encountered in #639 (comment).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions