[mpich-discuss] MPICH associating process with a core
Gus Correa
gus at ldeo.columbia.edu
Tue Mar 2 13:01:19 CST 2010
Hi John Xu
This issue has been discussed many times on this list.
See some postings here:
https://lists.mcs.anl.gov/mailman/mmsearch/mpich-discuss?config=mpich-discuss.htsearch;method=and;format=long;sort=score;words=affinity;page=2
I am a bit out of date with the recent MPICH2 improvements, however,
with MPICH I don't know of any better solution than
using top or another tool to get the PIDs, then associate them
to cores with taskset and perhaps numactl (if you have AMD processors).
Not a clean solution for sure, but relatively simple if you
are the only user of the computer(s)/node(s).
I hope this helps,
Gus Correa
---------------------------------------------------------------------
Gustavo Correa
Lamont-Doherty Earth Observatory - Columbia University
Palisades, NY, 10964-8000 - USA
---------------------------------------------------------------------
John Xu wrote:
> Thanks a lot, Nicolas.
>
> I am running MPI on my simulator and trying to evaluate MPI
> performance with core hardware
> changes. Therefore, I prefer to have deterministic simulation output
> for mapping multiple processes into the processor
> which may have several cores in one SMP processor.
>
> My initial interest is to query which process falls on what core and
> therefore I can correlate the performance
> events with the process.
>
> It will be nice to control which process going to a particular core as
> well. But according to you, that is not
> very easy to do. I will check out the Wiki pages as pointed out by you
> to see if there is a way to do so.
>
> I hope the process will not migrate between the cores, at least at
> this stage of my evaluation.
> Right now, I am not observing such behavior as it appears.
> If it does, what is the proper way to enforce strong core affinity?
> Can we do it on a core basis?
>
> thanks,
> john
>
> On Tue, Mar 2, 2010 at 2:10 AM, Nicolas Rosner <nrosner at gmail.com> wrote:
>> 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
>>
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
More information about the mpich-discuss
mailing list