OpenMPI 4.x uses temporary files for UNIX sockets, which are limited to 100 character path length. This can become an issue on macOS, which by default sets POSIX environment variable TMPDIR to a pseudorandom path under “/var” about 50 character long. We have experienced this as a race condition that becomes more likely as the number of MPI workers is eight or more.
A workaround is to set an alias for mpiexec or within CMake test properties etc. such that mpiexec gets a sufficiently short working path so that UNIX sockets don’t fail due to excessive path length.