Re: [PATCH] core-count: A new program to count the number of cpucores (original) (raw)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
From: | Gilles Espinasse |
---|---|
Subject: | Re: [PATCH] core-count: A new program to count the number of cpucores |
Date: | Mon, 26 Oct 2009 08:07:42 +0100 |
----- Original Message ----- From: "Giuseppe Scrivano" <address@hidden> To: "Bruno Haible" <address@hidden> Cc: <address@hidden>; <address@hidden>; "Jim Meyering" <address@hidden> Sent: Monday, October 26, 2009 12:45 AM Subject: Re: [PATCH] core-count: A new program to count the number of cpucores
...
> If it is meant as a tool for helping the parallelization of tasks at the > shell script level, then it needs to take into account > 1) the fact that the current process may be limited to a certain subset > of the available CPUs. See the Linux/NetBSD function > pthreadsetaffinitynp [5][6] and the IRIX notion of a CPU that is > available only to root processes [7].
Probably it is better to add an option, making a difference between the number of "real" and "effective" cores. Where it is not possible to know correctly the latter, they'll coincide.
> 2) the wish of users to not use all processors at once. Users may want to > save 1 CPU for their GUI interactions. This can most comfortably be > done through an environment variable, such as > OMPNUMTHREADS. [8]
What about leave to the user the decisione to use less threads/processes than core-count reports?
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))" hugefile
Cheers, Giuseppe
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.
Probably the first usage of core-count will be to feed make -j
Gilles
- Re: [PATCH] md5: accepts a new --threads option, (continued)
* Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/18
* Re: [PATCH] md5: accepts a new --threads option, Giuseppe Scrivano, 2009/10/18
* Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/18
* Re: [PATCH] md5: accepts a new --threads option, Giuseppe Scrivano, 2009/10/25
* Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/25
* Re: [PATCH] md5: accepts a new --threads option, Jim Meyering, 2009/10/25
* [PATCH] core-count: A new program to count the number of cpu cores (was: [PATCH] md5: accepts a new --threads option), Giuseppe Scrivano, 2009/10/25
* Re: [PATCH] core-count: A new program to count the number of cpu cores (was: [PATCH] md5: accepts a new --threads option), Pádraig Brady, 2009/10/25
* Re: [PATCH] core-count: A new program to count the number of cpu cores, Bruno Haible, 2009/10/25
* Re: [PATCH] core-count: A new program to count the number of cpu cores, Giuseppe Scrivano, 2009/10/25
* Re: [PATCH] core-count: A new program to count the number of cpucores,Gilles Espinasse <=
* Re: [PATCH] core-count: A new program to count the number of cpucores, Pádraig Brady, 2009/10/26
* Re: [PATCH] core-count: A new program to count the number of cpucores, Paolo Bonzini, 2009/10/26
* Re: [PATCH] core-count: A new program to count the number of cpucores, Giuseppe Scrivano, 2009/10/26
* Re: [PATCH] core-count: A new program to count the number of cpucores, Bruno Haible, 2009/10/26
* Re: [PATCH] core-count: A new program to count the number of cpucores, Pádraig Brady, 2009/10/27
* Re: [PATCH] core-count: A new program to count the number of cpu cores, Bruno Haible, 2009/10/26
* Re: [PATCH] core-count: A new program to count the number of cpu cores, Giuseppe Scrivano, 2009/10/27
* Re: [PATCH] core-count: A new program to count the number of cpu cores, Paolo Bonzini, 2009/10/27
* Re: [PATCH] core-count: A new program to count the number of cpu cores, Pádraig Brady, 2009/10/27
* Re: [PATCH] core-count: A new program to count the number of cpu cores, Pádraig Brady, 2009/10/27
- Prev by Date:Re: [PATCH] core-count: A new program to count the number of cpu cores
- Next by Date:env+nice, one bug fix, two test corrections
- Previous by thread:Re: [PATCH] core-count: A new program to count the number of cpu cores
- Next by thread:Re: [PATCH] core-count: A new program to count the number of cpucores
- Index(es):