Re: [hwloc-users] quick question

2010-07-22 Thread Samuel Thibault
Hello,

Rupert Brooks, le Thu 22 Jul 2010 09:20:34 -0400, a écrit :
> So i apologize if this question has been asked many times before.  Is
> there a way using hwloc (or otherwise) that i can identify which core
> of the machine a thread is currently using?

Hwloc provides a function to get the current affinity mask.  This
doesn't however give which processor the thread is really currently
running on.

One issue with such function is that the returned value is potentially
outdated very quickly, when the OS is allowed to move threads. That's
probably why I haven't seen it provided by OSes. In the case of Linux,
you can check e.g. top's P column (Last used cpu), or you can also check
the 39th field of /proc//stat which provides the same information.

In practice, I usually trust the OS in respecting the affinity mask, and
just use lstopo --top to get the affinity mask that the OS is supposed
to respect.

Samuel


[hwloc-users] quick question

2010-07-22 Thread Rupert Brooks
Hi,

First, i have to report a little bug with the web site - the searching
of the users list archives seems not to work when i tried to search i
got the following error message

Search Hardware Locality [Users] List Archive Index file error: Could
not open the index file './index.swish-e': No such file or directory

So i apologize if this question has been asked many times before.  Is
there a way using hwloc (or otherwise) that i can identify which core
of the machine a thread is currently using?  This would be useful to
determine if hwloc is properly doing its job, and to verify certain
hypotheses that i have about performance of my program - specifically
that performance drops sharply when the OS scheduler moves the thread
from one physical chip to another.  Ideally i would like to do this in
both windows and linux but a solution for either would be great.

Cheers,
Rupert

--
Rupert Brooks
rupert.bro...@gmail.com