I use "sched_setaffinity" in the code to pin MPI process to core. But can only do so if I have access to source code.Of course, I can pin it after the code is running, but sometimes this is not a good solution since pin will need to be done on after process been created but before it starts to execute the compute kernel.
So, a very simple question, isthere an option in mpirun (or mpiexec) such that I can pin the MPI process to core? For example, something like this:
mpirun -nc 2 -pincore 0 6 -np 10 .....
-np 10 => 10 mpi processes.
-nc 2 => use 2 cores per node, or run 2 mpi processes per node
-pincore0 6 => pin the mpi processes to core ID 0 and core ID 6
Obvious, I am thinking about a two sockets Westmere per node, and I want each mpi process run on on different socket, so I pin to core 0 and core 6 (of course, it can make is more general, like 0:5, will pin the process to 0,1,2,...5)