Open MPI logo

Hardware Locality Development Mailing List Archives

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

Subject: Re: [hwloc-devel] get cpu where a process/thread is executing
From: Samuel Thibault (samuel.thibault_at_[hidden])
Date: 2011-02-12 17:23:46


Brice Goglin, le Tue 08 Feb 2011 17:31:52 +0100, a écrit :
> 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.


> * I am not such a big fan of get_cpuexec and get_proc_cpuexec names, any
> better names?

I've often seen things like get_currentcpu

> * 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

That can be useful, yes.

> Index: src/bind.c
> ===================================================================
> --- src/bind.c (r??vision 3167)
> +++ src/bind.c (copie de travail)
> @@ -16,7 +16,9 @@
> #ifdef HAVE_MALLOC_H
> # include <malloc.h>
> #endif
> -
> +# include <proc/readproc.h>
> +#endif

Err, that should rather be a OS-specific hook (libproc is mostly
linux-specific, I'm also wondering whether it's worth depending on it
when parsing /proc/pid/stat is very easy, it's the 39th field). For the
windows case, could you just put a "TODO: use GetCurrentProcessorNumber"