khiops
khiops copied to clipboard
OpenMPI `mpiexec` Fails on Some Ubuntu Linux Systems with Atypical `PATH`
Description
On Ubuntu Linux operating systems, the openmpi-bin native package installs a symlink to mpiexec in /usr/bin as /usr/bin/mpiexec.openmpi.
However update-alternatives also sets a symlink to mpiexec into the /bin directory, through the following graph:
/bin/mpiexec -> /etc/alternatives/mpiexec -> /usr/bin/mpiexec.openmpi .
The latter symlink is set to the unqualified orterun upon the openmpi-bin package install, which means the first one is taken, i.e. the one in /bin/orterun (which is also supposedly copied from /usr/bin by update-alternatives).
In this context, if, for some reason, PATH contains /bin before /usr/bin, type -P mpiexec returns /bin/mpiexec, which, upon tentative launch, fails with
--------------------------------------------------------------------------
A prefix was supplied to mpiexec that only contained slashes.
This is a fatal error; mpiexec will now abort. No processes were launched.
--------------------------------------------------------------------------
Questions/Ideas
- In order to ensure robustness to these corner cases, it suffices to use
readlink -f $(type -P mpiexec)inkhiops_env, instead of the plaintype -P mpiexec, thus:type -P mpiexecreturns/bin/mpiexecreadlink -f /bin/mpiexecreturns/usr/bin/orterun.
Context
- Khiops version: 10.3.1
- Log file (use
khiops -e log.txt): N/A - Scenario file (use
khiops -o scenario._kh): Any - OS description (use
khiops -s): Some Ubuntu Linux distributions