Skip to content

Commit

Permalink
Rename abi_file --> abi_source_file
Browse files Browse the repository at this point in the history
  • Loading branch information
sloede committed May 30, 2022
1 parent 573ae38 commit 162653a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions docs/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ enum {

#define MPI_ARGV_NULL ((char**) NULL)
```
you need to put the corresponding entries in your ABI file `abi_file.jl`:
you need to put the corresponding entries in your ABI file `abi_source_file.jl`:
```julia
const MPI_Request = Cuint
@const_ref MPI_REQUEST_NULL MPI_Request 0
Expand All @@ -139,10 +139,10 @@ Please note that sometimes information is also stored in ancillary header files
`mpi_types.h` or `mpi_ext.h`).

You can then use [`MPIPreferences.use_system_binary`](@ref) to configure MPI.jl
to use your custom file by providing the path via the `abi_file` keyword
to use your custom file by providing the path via the `abi_source_file` keyword
argument, e.g.,
```shell
julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary(; abi_file="path/to/abifile.jl)'
julia --project -e 'using MPIPreferences; MPIPreferences.use_system_binary(; abi_source_file="path/to/file.jl)'
```
You need to restart Julia for the change to take effect.

Expand Down
18 changes: 9 additions & 9 deletions lib/MPIPreferences/src/MPIPreferences.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ end

# Default is empty string, indicating that the information in `abi` should be used to load the
# correct ABI file
const abi_file = @load_preference("abi_file", "")
const abi_source_file = @load_preference("abi_source_file", "")

"""
MPIPreferences.use_jll_binary(binary; export_prefs=false, force=true)
Expand Down Expand Up @@ -93,7 +93,7 @@ end
library_names = ["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"],
mpiexec = "mpiexec",
abi = nothing,
abi_file = nothing,
abi_source_file = nothing,
export_prefs = false,
force = true)
Expand All @@ -115,7 +115,7 @@ Options:
- `abi`: the ABI of the MPI library. By default this is determined automatically
using [`identify_abi`](@ref). See [`abi`](@ref) for currently supported values.
- `abi_file`: the ABI file for the MPI library. By default, for ABIs supported by MPI.jl, the
- `abi_source_file`: the ABI file for the MPI library. By default, for ABIs supported by MPI.jl, the
corresponding ABI file is loaded automatically. This argument allows one to override the
automatic selection, e.g., to provide an ABI file for an MPI ABI unknown to MPI.jl.
Expand All @@ -127,7 +127,7 @@ function use_system_binary(;
library_names=["libmpi", "libmpi_ibm", "msmpi", "libmpich", "libmpitrampoline"],
mpiexec="mpiexec",
abi=nothing,
abi_file=nothing,
abi_source_file=nothing,
export_prefs=false,
force=true,
)
Expand All @@ -142,10 +142,10 @@ function use_system_binary(;
if isnothing(abi)
abi = identify_abi(libmpi)
end
if isnothing(abi_file)
abi_file = ""
if isnothing(abi_source_file)
abi_source_file = ""
else
abi_file = abspath(abi_file)
abi_source_file = abspath(abi_source_file)
end
if mpiexec isa Cmd
mpiexec = collect(mpiexec)
Expand All @@ -154,13 +154,13 @@ function use_system_binary(;
"binary" => binary,
"libmpi" => libmpi,
"abi" => abi,
"abi_file" => abi_file,
"abi_source_file" => abi_source_file,
"mpiexec" => mpiexec,
export_prefs=export_prefs,
force=force
)

@warn "The underlying MPI implementation has changed. You will need to restart Julia for this change to take effect" binary libmpi abi abi_file mpiexec
@warn "The underlying MPI implementation has changed. You will need to restart Julia for this change to take effect" binary libmpi abi abi_source_file mpiexec

if VERSION <= v"1.6.5" || VERSION == v"1.7.0"
@warn """
Expand Down
6 changes: 3 additions & 3 deletions src/consts/consts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ macro const_ref(name, T, expr)
:(const $(esc(name)) = Ref{$T}())
end

# If `abi_file` is empty, choose ABI file based on ABI string, otherwise load the specified file
@static if MPIPreferences.abi_file == ""
# If `abi_source_file` is empty, choose ABI file based on ABI string, otherwise load the specified file
@static if MPIPreferences.abi_source_file == ""
@static if MPIPreferences.abi == "MPICH"
include("mpich.jl")
elseif MPIPreferences.abi == "OpenMPI"
Expand All @@ -43,7 +43,7 @@ end
error("Unknown MPI ABI $(MPIPreferences.abi)")
end
else
include(MPIPreferences.abi_file)
include(MPIPreferences.abi_source_file)
end

# Initialize the ref constants from the library.
Expand Down

0 comments on commit 162653a

Please sign in to comment.