Re: [hwloc-devel] restricted topology (& topology changes)

2009-09-27 Thread Fawzi Mohamed


On 27-set-09, at 15:34, Samuel Thibault wrote:



I've wondered how to implement topology changes indeed. AIX does
have a SIGRECONFIG signal for this, I don't know any support from
other OSes.


Maybe there's a inotify way to get such changes in Linux.


There is usually no inotify support for virtual files. I've
just tested that it doesn't work for /sys/bus/usb/devices for
instance. We'll have to ask kernel developers for it.


ok just as information osx has such a callback if possible it would  
be

nice to have such functionality abstracted away...


Do you know how it is called?


I have looked for it, and was not able to find the documentation  
again, I suppose that registering for power management changes and  
check if for example hw.activecpu changed should do the trick, but I  
cannot track down the place where I had read something about it...



(problem with macosx is that it doesn't support processor binding
anyway...)


yes it is possible just to group threads that should stay together...

Fawzi

Re: [hwloc-devel] restricted topology (& topology changes)

2009-09-27 Thread Samuel Thibault
Fawzi Mohamed, le Sun 27 Sep 2009 15:26:40 +0200, a écrit :
> thanks for the quick answers, so I think that the answer is for now  
> you can on linux 2.6 if you use cpusets.

Yes, cpusets are supported IIRC.

> >>>I've wondered how to implement topology changes indeed. AIX does
> >>>have a SIGRECONFIG signal for this, I don't know any support from
> >>>other OSes.
> >>
> >>Maybe there's a inotify way to get such changes in Linux.
> >
> >There is usually no inotify support for virtual files. I've
> >just tested that it doesn't work for /sys/bus/usb/devices for
> >instance. We'll have to ask kernel developers for it.
> 
> ok just as information osx has such a callback if possible it would be  
> nice to have such functionality abstracted away...

Do you know how it is called?
(problem with macosx is that it doesn't support processor binding
anyway...)

Samuel


Re: [hwloc-devel] restricted topology (& topology changes)

2009-09-27 Thread Fawzi Mohamed


On 27-set-09, at 14:37, Samuel Thibault wrote:


Brice Goglin, le Sun 27 Sep 2009 14:18:54 +0200, a écrit :

Samuel Thibault wrote:
but shouldn't it return the restricted topology (or have a method  
that

returns the restricted topology).



It should already be the default. To get the whole system, see  
lstopo

--help: --whole-system


Maybe he's referring to when the process launcher does a
sched_setaffinity/numatcl to restrict this process, as opposed to
administrator-wide restriction with linux cpusets or so. We could add
another topology flag for such restrictions.


Ah, right.


thanks for the quick answers, so I think that the answer is for now  
you can on linux 2.6 if you use cpusets.
Having my app starting a a restricted subtask that will see it in its  
topology in a portable way is not possible at the moment, if I  
understood correctly.

Still it is already something.

I've wondered how to implement topology changes indeed. AIX does  
have a
SIGRECONFIG signal for this, I don't know any support from other  
OSes.


Maybe there's a inotify way to get such changes in Linux.


There is usually no inotify support for virtual files. I've just  
tested

that it doesn't work for /sys/bus/usb/devices for instance. We'll have
to ask kernel developers for it.


ok just as information osx has such a callback if possible it would be  
nice to have such functionality abstracted away...


thanks

Fawzi


Re: [hwloc-devel] restricted topology (& topology changes)

2009-09-27 Thread Samuel Thibault
Brice Goglin, le Sun 27 Sep 2009 14:18:54 +0200, a écrit :
> Samuel Thibault wrote:
> >> but shouldn't it return the restricted topology (or have a method that  
> >> returns the restricted topology).
> >> 
> >
> > It should already be the default. To get the whole system, see lstopo
> > --help: --whole-system
> 
> Maybe he's referring to when the process launcher does a
> sched_setaffinity/numatcl to restrict this process, as opposed to
> administrator-wide restriction with linux cpusets or so. We could add
> another topology flag for such restrictions.

Ah, right.

> > I've wondered how to implement topology changes indeed. AIX does have a
> > SIGRECONFIG signal for this, I don't know any support from other OSes.
> 
> Maybe there's a inotify way to get such changes in Linux.

There is usually no inotify support for virtual files. I've just tested
that it doesn't work for /sys/bus/usb/devices for instance. We'll have
to ask kernel developers for it.

Samuel


Re: [hwloc-devel] restricted topology (& topology changes)

2009-09-27 Thread Brice Goglin
Samuel Thibault wrote:
>> but shouldn't it return the restricted topology (or have a method that  
>> returns the restricted topology).
>> 
>
> It should already be the default. To get the whole system, see lstopo
> --help: --whole-system
>   

Maybe he's referring to when the process launcher does a
sched_setaffinity/numatcl to restrict this process, as opposed to
administrator-wide restriction with linux cpusets or so. We could add
another topology flag for such restrictions.

>> Another thing that would be nice to have (but much less important for  
>> me) is having a callback that can be called when/if the topology  
>> changes.
>> 
>
> I've wondered how to implement topology changes indeed. AIX does have a
> SIGRECONFIG signal for this, I don't know any support from other OSes.
> that'd mean having to poll for changes, how often, and in which context?
> (another thread? an explicit polling request from the application?). I'd
> rather avoid the thread usage and just let the application decide both
> how often and in which context. In other words, actually maybe all we
> need is a function to compare two topologies?
>   

Maybe there's a inotify way to get such changes in Linux.

Brice


Re: [hwloc-devel] restricted topology (& topology changes)

2009-09-27 Thread Samuel Thibault
Fawzi Mohamed, le Sun 27 Sep 2009 14:09:59 +0200, a écrit :
> the topology load returns the topology of the whole system (I think),  

Nope, else it's a bug :)

> but shouldn't it return the restricted topology (or have a method that  
> returns the restricted topology).

It should already be the default. To get the whole system, see lstopo
--help: --whole-system

> Another thing that would be nice to have (but much less important for  
> me) is having a callback that can be called when/if the topology  
> changes.

I've wondered how to implement topology changes indeed. AIX does have a
SIGRECONFIG signal for this, I don't know any support from other OSes.
that'd mean having to poll for changes, how often, and in which context?
(another thread? an explicit polling request from the application?). I'd
rather avoid the thread usage and just let the application decide both
how often and in which context. In other words, actually maybe all we
need is a function to compare two topologies?

Samuel