Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Hardware Locality Development mailing list

Subject: [hwloc-devel] get cpu where a process/thread is executing
From: Brice Goglin (Brice.Goglin_at_[hidden])
Date: 2011-02-08 11:30:54

Here's a draft of patch to add the ability to know where a thread/proc
is currently running [39]

If we only support single threads, we can return a single CPU number. If
we support multithreaded processes, we must return multiple numbers. So
I am returning a cpuset here.

The API (get_cpuexec and get_proc_cpuexec) is similar to get_cpubind
(for current thread or process) and get_proc_cpubind (for a random PID)
and the implementation would use similar backend methods (I only
implemented get_proc_cpubind, in the monothreaded case for now).

Two questions:
* I am not such a big fan of get_cpuexec and get_proc_cpuexec names, any
better names?
* Do we want something to retrieve the current location of pages in
memory too? Linux can do this on a page per page basis with the
move_pages syscall