Le 07/01/2013 17:59, Jeff Squyres (jsquyres) a écrit : > On Jan 7, 2013, at 9:05 AM, Samuel Thibault <samuel.thiba...@inria.fr> wrote: > >> HWLOC_COMPONENTS=^cuda,opencl >> >> disables cuda *and* opencl, while intuition would have told me that it >> disables cuda but enables opencl. >> >> Also, one would for instance want to be able to do this: >> >> HWLOC_COMPONENTS=x86,^cuda,^opencl,nvml > > (Sorry -- am just returning today from winter vacation...) > > FWIW: in OMPI, way back when we implemented this, we considered supporting > what you describe. But then we thought -- wait, why would I ever do that? > > More specifically: you only ever want to specify exactly what you *do* or *do > not* want to be loaded. Why would you ever list both? > > Taking your example: HWLOC_COMPONENTS=foo,^bar,^baz,^yow > Is the same as: HWLOC_COMPONENTS=foo,yow > > So why bother listing ^bar and ^baz? > > Generalizing that, why would you ever specify *some* components to exclude > and *some* components to exclude? It seems much cleaner to either exclude > some (and therefore include the rest), or include some (and exclude the rest). >
Your argument works for selecting among I/O components like cuda/nvml/opencl that are all independent (like several components in the same framework in OMPI). But it doesn't work when the order matters between components that discover the same things. Like "I want x86 first because it works better than the solaris component on my machine, and then the other usual components for to discover everything else". Remember that HWLOC_COMPONENTS="foo" means "foo first and then all the usual ones that do not conflict". It's not "only foo", which should be written as "foo,stop" (should be rare since the core excludes all conflicting components automatically). BTW, if we change the hwloc syntax, we may want to not use ^ to avoid confusion with OMPI. ~ and ! could work but some shells may not like them? Brice