bug-coreutils
[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 cpu cores


From: Jim Meyering
Subject: Re: [PATCH] core-count: A new program to count the number of cpu cores
Date: Fri, 06 Nov 2009 13:22:57 +0100

Pádraig Brady wrote:
> Attached is an updated version in which I
>
> Removed the --available option.
> It just didn't seem to fit when I was documenting it
> The alias argument is a bit of a stretch since they're
> disabled in shell scripts and I can't see anyone aliasing
> nproc anyway. Also some people may think they need to
> specify --available.
>
> Mentioned online processors in the help,
> and reworded most of it.
>
> Added a man page
>
> Diagnose --ignore="invalid"
>
> move tests from nproc/ to misc/
>
> remove the cpuinfo test as that compares against
> the number of online processors which nproc has no
> way to determine independently at present. One could
> add NPROC_ONLINE to the gnulib interface corresponding
> to an --online option but I don't think that's required.
...

Sounds fine to me.
Thanks again for handling this.

> diff --git a/tests/misc/nproc-positive b/tests/misc/nproc-positive
...
> +for i in '-1000' '0' '1' ' 2' '1000'; do

Please remove all of these single quotes.  They're not needed.

> +    procs=$(OMP_NUM_THREADS="$i" nproc)

Same for the double quotes around $i, since
all values are well-behaved.

> +    test "$procs" -gt 0 || fail=1
> +done
> +
> +for i in '0' ' 1' '1000'; do
> +    procs=$(nproc --ignore="$i")
> +    test "$procs" -gt 0 || fail=1
> +done
> +
> +for i in '-1' 'N'; do
> +    nproc --ignore="$i" && fail=1
> +done
> +
> +Exit $fail




reply via email to

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