[mpich-discuss] MPICH associating process with a core

Nicolas Rosner nrosner at gmail.com
Tue Mar 2 02:10:12 CST 2010


Hi John,

Assuming correct understanding of your question: no, I don't think you
can do that within the limits of the MPI standard itself. Also, you
seem to be assuming strong processor affinity as a fact (as in "each
process will always run on its initially assigned core"), which, as
far as I know, is not necessarily the case.

(In fact, it looks to me like the precise meaning of such a concept
would depend rather heavily on the hardware architecture and
OS-related factors of each system -- which is what makes me guess it
would make sense for the Standard to stay above such lower-level
issues.)

If all you need is the ability to *find out* which physical CPU within
an SMP machine is running a process: assuming your system supports
this, it probably provides a way for you to find out by querying it
directly (e.g. a syscall).

If you need to *control* how processes are mapped to processors, maybe
the more OS-specific layers/wrappers/utils of an MPI implementation
might provide some higher-level assistant, e.g. check out

http://wiki.mcs.anl.gov/mpich2/index.php/Using_the_Hydra_Process_Manager#Process-core_Binding

(Also try googling "hwloc", and perhaps PLPA if you use Linux.)

Perhaps you'd be willing to explain a bit more about what you're
trying to use this for?  Do you really need a physical processor ID,
or are you just trying to enforce a certain distribution of processes
and/or behaviors?  Such needs can often be addressed at a higher level
(without such a strong commitment to a certain flavor of scheduling,
etc).

Hope this helps,

Nicolás


More information about the mpich-discuss mailing list