bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] core-count: A new program to count the number of cpucores


From: Pádraig Brady
Subject: Re: [PATCH] core-count: A new program to count the number of cpucores
Date: Mon, 26 Oct 2009 10:33:21 +0000
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Gilles Espinasse wrote:
> ----- Original Message ----- 
> From: "Giuseppe Scrivano" <address@hidden>
>>
>> For example, assuming that `sort' will soon get the --threads option and
>> an user decides to use all cores except one to sort a file, then it can
>> be done as:
>>
>> sort --threads="$(($(core-count) - 1))" huge_file


> that assume --threads is able to handle negative count or 0
> Would not be more efficient to handle the count in core-count?
> That mean core-count should always report a minimum of 1 and discount from
> total the number passed as an option.

Hmm it's a bit surprising that min()/max() are not available
as $((shell arithmetic)) or in `expr`.  Consequently I agree that
adding the option you suggest is useful.  What will we call it though?
Maybe:

  --ignore=N    If possible reduce the count by N

> Probably the first usage of core-count will be to feed make -j

Note for commands that do split the data internally
and process in parallel, I dislike the --threads name
since it implies a particular implementation.
So how about sort -j,--jobs to match `make`?
Though personally I like --mproc ?

cheers,
Pádraig.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]