In both cases the output matches exactly what you have told Open MPI to do. The hexadecimal number in cpus ...
shows the allowed CPUs (the affinity mask) for the process. This is a bit field with each bit representing one logical CPU.
With --bind-to-core
each MPI process is bound to its own CPU core. Rank 0 ([...,0]
) has its affinity mask set to 0001
which means logical CPU 0. Rank 1 ([...,1]
) has its affinity mask set to 0002
which means logical CPU 1. The logical CPU numbering probably matches the HWThread
identifier in the output with the topology information.
With --bind-to-socket
each MPI process is bound to all cores of the socket. In your particular case the affinity mask is set to 000f
, or 0000000000001111
in binary, which corresponds to all four cores in the socket. Only a single hyperthread per core is being assigned.
You can further instruct Open MPI how to select the sockets on multisocket nodes. With --bysocket
the sockets are selected in round-robin fashion, i.e. the first rank is placed on the first socket, the next rank is placed on the next socket, and so on until there is one process per socket, then the next rank is again put on the first socket and so on. With --bycore
each sockets receives as much consecutive ranks as is the number of cores in that socket.
I would suggest that you read the manual for mpirun
for Open MPI 1.4.x, especially the Process Binding section. There are some examples there with how the different binding options interact with each other. The --cpu-set
option is not mentioned in the manual, although Jeff Squyres has written a nice page on processor affinity features in Open MPI (it is about v1.5, but most if not all of it applies to v1.4 also).