khiops icon indicating copy to clipboard operation
khiops copied to clipboard

OpenMPI `mpiexec` Fails on Some Ubuntu Linux Systems with Atypical `PATH`

Open popescu-v opened this issue 8 months ago • 0 comments

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) in khiops_env, instead of the plain type -P mpiexec, thus:
    • type -P mpiexec returns /bin/mpiexec
    • readlink -f /bin/mpiexec returns /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

popescu-v avatar Apr 29 '25 09:04 popescu-v