ompi icon indicating copy to clipboard operation
ompi copied to clipboard

Regression when HOME is not set

Open haampie opened this issue 3 years ago • 1 comments

In OpenMPI 4.1.4 there was some questionable behavior when HOME was not set, namely it tried to open \0/.openmpi/mca-params.conf.

$ env -i PATH=/usr/bin:/bin strace -f mpicc --version |& grep '\.openmpi'
openat(AT_FDCWD, "(null)/.openmpi/mca-params.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
$ echo $?
0

It seems this is fixed on the main branch, but in a surprising way, namely mpicc errors when HOME is not set.

$ env -i PATH=/usr/bin:/bin mpicc --version
[hostname:12345] Error: Unable to get the user home directory

$ echo $?
1

I would expect this to be ignored, just like it's not an error when the file ~/.openmpi/mca-params.conf does not exist.

Can this be fixed please? This issue leads to build failures in env -i type of build environments.

haampie avatar Aug 30 '22 15:08 haampie

this issue needs some additional context. Apparently a variant of spack environments works without a HOME directory defined, causing problems with spack installs of open mpi unless one disables use of HOME param files on the config line. This then introduces potential surprises to end users of the installed package as they may be expecting for Open MPI to use a param file in ~/.openmpi

hppritcha avatar Aug 30 '22 15:08 hppritcha