MPI.jl icon indicating copy to clipboard operation
MPI.jl copied to clipboard

Allow one to specify an ABI file via MPIPreferences

Open sloede opened this issue 3 years ago • 7 comments

This is an attempt to fix #574 and to resolve #575. Input welcome.

sloede avatar May 25 '22 14:05 sloede

should we just make it the abi key?

simonbyrne avatar May 27 '22 22:05 simonbyrne

should we just make it the abi key?

I don't think we can we use that for Platform support.

I am not sure if MPIPreferences is the right place. I would just add it as a preference setting to MPI.jl

vchuravy avatar May 28 '22 00:05 vchuravy

should we just make it the abi key?

I thought about it but decided against it. To me, using this is a last resort when all other options fail. Thus I would not pollute the abi key with this additional functionality. Also, this allows to still set the abi key to something useful (e.g., MichaelMPI. Even though abi_file will ensure that abi is not used for selecting the constants file, it can still be used to document which kind of ABI is in use.

I am not sure if MPIPreferences is the right place. I would just add it as a preference setting to MPI.jl

Really? I thought that MPIPreferences.use_system_binary would be the perfect place, since it controls all other aspects of the implementation selection as well. Further, I think it makes it less intuitive for users if they have to use two different packages (MPIPreferences.jl and MPI.jl) to set preferences. This is really a design choice, however, thus if you feel strongly about adding this option to MPI.jl directly, I can also add it there (if you tell me where you think it should go).

sloede avatar May 28 '22 20:05 sloede

My reasoning is that the information in MPIPreferences.jl is used by other packages (that's why we separated it), but which mpiconst file to load is really only relevant to MPI.jl

vchuravy avatar May 28 '22 20:05 vchuravy

OK. How would you design the API? Add new functions use_custom_abi_file(path) and use_default_abi_file()? Or set_abi_file!(path_or_nothing)? Or something completely different?

sloede avatar May 28 '22 20:05 sloede

I like use_custom_abi_file and use_default_abi_file for symmetry, but I have no strong feeling.

vchuravy avatar May 28 '22 20:05 vchuravy

There are two potential downsides (that I know of) with putting the preference in MPI.jl and not MPIPreferences.jl

  • It requires an additional section of preferences in LocalPreferences.toml, making it (potentially) harder to see with one glance all relevant MPI preferences.
  • If the abi_file is moved/nonexistent, there is no way to fix the path anymore except by hand, since MPI.jl will fail during precompilation if the file does not exist.

The first one is maybe not so bad, but the second one needs to be handled imho. The only option I see is that one could check for the ABI files existence and it that fails, output something like

@error "Path to ABI file '$abi_file' not found. Fix with `use_custom_abi_file(path)` or `use_default_abi_file()` and restart Julia."

without attempting to include it.

Any thoughts/suggestions?

sloede avatar May 28 '22 20:05 sloede