Per #6298, we had an accidental change in behavior of mpirun --host aaa,bbb between version v2.1.x and v3.0.x. A fix just went in to master in #6493.
Here's what happened:
The question is: should we put this fix on any of v3.0.x, v3.1.x, and/or v4.0.x?
The ordering of hosts in the --host list matters:
$ mpirun --host aaa,bbb rank_test
aaa: MCW rank 0
bbb: MCW rank 1
$ mpirun --host bbb,aaa rank_test
aaa: MCW rank 1
bbb: MCW rank 0
The ordering of hosts in the --host list does not matter (note: this behavior was unintentional. It was always intended that we honor the ordering of hosts in the --host list):
$ mpirun --host aaa,bbb rank_test
aaa: MCW rank 0
bbb: MCW rank 1
$ mpirun --host bbb,aaa rank_test
aaa: MCW rank 0
bbb: MCW rank 1
We need to discuss this and decide what to do. Points (in no particular order):
I think we noticed in PR #4327, but never got the cycles to get back to it. I'd like to verify this change also fixes that issue (I think it should)
Two good points were made on the webex:
--host (and --hostfile) ordering semantics consistent across all of these release series.With these arguments, it seems to make sense to back-port the commits from #6493 to v3.0.x, v3.1.x, and v4.0.x.
I attempted to make PRs for v3.0.x, v3.1.x, and v4.0.x. Unfortunately, master's nidmap.c has diverged quite a bit from each of these 3 branches. @rhc54 graciously said he would work on the ports for these branches.
Removed the "Target v2.x" label -- the fix is not needed for the v2.x series.
I came across this issue today, in a case where I need mpirun to place the final rank on a specific node. On 3.1.x it seems to currently be impossible to achieve it in any other way than writing the whole rankfile, am I right about it?
Please also note that it's not that easy to build OpenMPI >= 4.0 on some recent-ish distributions, such as Ubuntu 18.04, because 4.0 requires a newer version of hwloc than provided by the distribution. It's achievable, but it's definitely a considerable effort to upgrade the system libraries.
@marmistrz I'm curious about your statement: why can't you build Open MPI >v4.0 on some recent Linux distributions? Open MPI comes with its own embedded hwloc that satisfies Open MPI's requirements -- meaning that even if the distro's hwloc is old, the embedded hwloc should be sufficient. Is that not working properly?
@jsquyres when I built OpenMPI with --with-hwloc the configure script complained it cannot build the external hwloc. Using --with-hwloc=internal did the trick, but was counterintuitive.
FWIW: You can just not specify --with-hwloc at all, an Open MPI should first try to use an external hwloc, and if that fails, fall back to the internal hwloc.
Anyway, this is probably a bug in the m4 scripts, as the doc precisely says that --with-hwloc should use the internal hwloc:
"internal" (or no DIR value) forces Open MPI to use its internal copy of hwloc.
Ah, that might be a bug in the docs. FWIW: the use of hwloc has evolved over time in Open MPI:
--with-hwloc is not specified), we try external first, and if that fails, fall back to internal.