MPIPreferences.jl is a small package based on Preferences.jl for selecting MPI implementations. These choices are compile-time constants, and so any changes will require a Julia restart.
MPIPreferences.binary :: String
The currently selected binary. The possible values are
MPIPreferences.abi :: String
The ABI (application binary interface) of the currently selected binary. Supported values are:
"MPICH": MPICH-compatible ABI (https://www.mpich.org/abi/)
"OpenMPI": Open MPI compatible ABI (Open MPI, IBM Spectrum MPI, Fujitsu MPI)
"MicrosoftMPI": Microsoft MPI
"HPE MPT": HPE MPT
use_system_binary(; library_names = ["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpi_cray", "libmpitrampoline"], mpiexec = "mpiexec", abi = nothing, vendor = nothing, export_prefs = false, force = true)
Switches the underlying MPI implementation to a system provided one. A restart of Julia is required for the changes to take effect.
library_names: a name or collection of names of the MPI library, passed to
Libdl.find_library. If the library isn't in the library search path, you can specify the full path to the library.
mpiexec: the MPI launcher executable. The default is
mpiexec, but some clusters require using the scheduler launcher interface (e.g.
aprunon PBS). It is also possible to pass a
Cmdobject to include specific command line options.
vendor: can be either
nothingor a vendor name (such a
vendorhas the value "cray", then the output from
cc --cray-print-opts=allis parsed for which libraries are linked by the Cray Compiler Wrappers. Note that if
mpi_gtl_*is present, then this .so will be added to the preloads. Also note that the inputs to
library_nameswill be overwritten by the library name used by the compiler wrapper.
true, the preferences into the
true, the preferences are set even if they are already set.
use_jll_binary([binary]; export_prefs=false, force=true)
Switches the underlying MPI implementation to one provided by JLL packages. A restart of Julia is required for the changes to take effect.
Available options are:
"MicrosoftMPI_jll"(Only option and default on Winddows)
"MPICH_jll"(Default on all other platform)
export_prefs option determines whether the preferences being set should be stored within
Throws an error if the preferences have been modified in the current Julia session, or if they are modified after this function is called.
This is should be called from the
__init__() function of any package which relies on the values of MPIPreferences.
Identify the MPI implementation from the library version string
dlopen's all preloads specified in the preloads section of MPIPreferences
MPIPreferences utilizes the following keys to store information in the Preferences key-value store.
_format: the version number of the schema. Currently only
binary: the choice of binary. This should be one of the strings listed in
binary == "system", then the following keys are also required (otherwise they have no effect):
libmpi: the filename or path of the MPI dynamic library.
abi: The ABI of the MPI implementation. This should be one of the strings listed in
- a string corresponding to the MPI launcher executable
- an array of strings, with the first entry being the executable and remaining entried being additional flags that should be used with the executable.