AFAIK scripts should use getconf tags NPROCESSORS_CONF,
NPROCESSORS_MAX or NPROCESSORS_ONLN (or just NPROCESSORS_ONLN because
it describes the number of currently online cores) to determinate the
number of processors it can use. This works on almost all platforms
(Linux, FreeBSD, OpenBSD) and within ksh93's getconf.

Has nproc any special feature not exposed by the getconf NPROCESSORS_*
interface?

Olga

On Thu, May 13, 2010 at 6:00 PM, John Sonnenschein
<john.sonnensch...@oracle.com> wrote:
> nproc uses sysconf(3M) for determining the number of processors on Solaris 
> which means that zones with CPU pools will see the number in the pool, rather 
> than the number in the machine.
>
> It may be worthwhile updating the documentation to reflect this, but then 
> again sysconf(3C) itself is not documented in this way.
>
> -JohnS
>
> On 2010-05-13, at 8:15 AM, Darren J Moffat wrote:
>
>> On 13/05/2010 15:19, Alan Coopersmith wrote:
>>>>         Between 7.4 and 8.5, the following new command was introduced:
>>>>
>>>>         /usr/bin/
>>>>                 nproc
>>>>                        Location                     Uncommitted
>>>>                        Invocation                   Uncommitted
>>>>                        Human-readable output        Not an Interface
>>
>> What API is nproc calling on Solaris to get the "number of processing units" 
>> ?
>>
>> What happens when it is run in a Zone that is part of a processor pool ?  I 
>> think the "-a" output won't actually be "all installed".
>>
>> My concern here is that this command could depending how it is implemented 
>> be very misleading on Solaris because of the processor virualisation and 
>> resource management functionality we have.
>>
>> At the moment I'm not suggested it be dropped or its documentation be 
>> changed in anyway, just trying to understand it it has a chance of giving 
>> the user a reasonable (ideally actually correct) answer.
>>
>> --
>> Darren J Moffat
>> _______________________________________________
>> opensolaris-arc mailing list
>> opensolaris-arc@opensolaris.org
>
> _______________________________________________
> opensolaris-arc mailing list
> opensolaris-arc@opensolaris.org
>



-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     olga.kryzhanov...@gmail.com   \-`\-'----.
 `'-..-| /       http://twitter.com/fleyta     \ |-..-'`
      /\/\     Solaris/BSD//C/C++ programmer   /\/\
      `--`                                      `--`
_______________________________________________
opensolaris-arc mailing list
opensolaris-arc@opensolaris.org

Reply via email to